Re: kernel/timer.c: next_timer_interrupt() strange/buggy(?) code (2.6.18-rc1-mm2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Montag Juli 17 2006 20:53 schrieb Andreas Mohr:
>         for (i = 0; i < 4; i++) {
>                 j = INDEX(i);
>                 do {
>                         if (list_empty(varray[i]->vec + j)) {
>                                 j = (j + 1) & TVN_MASK;
>                                 continue;
>                         }
>                         list_for_each_entry(nte, varray[i]->vec + j, entry)
>                                 if (time_before(nte->expires, expires))
>                                         expires = nte->expires;
>                         if (j < (INDEX(i)) && i < 3)
>                                 list = varray[i + 1]->vec + (INDEX(i + 1));
>                         goto found;
>                 } while (j != (INDEX(i)));
>         }
> found:

is equivalent to

  for (i = 0; i < 4; i++) {
      j = INDEX(i);
      do {
          if (!list_empty(varray[i]->vec + j)) {
              list_for_each_entry(nte, varray[i]->vec + j, entry)
                  if (time_before(nte->expires, expires))
                      expires = nte->expires;
              if (j < (INDEX(i)) && i < 3)
                  list = varray[i + 1]->vec + (INDEX(i + 1));
              goto found;
          }
          j = (j + 1) & TVN_MASK;
      } while (j != (INDEX(i)));
  }
  found:


But probably the code in timer.c takes account of probabilities, thus it is a 
bit more obscure.

HTH,
-- 
(°=                 =°)
//\ Prakash Punnoor /\\
V_/                 \_V

Attachment: pgp8DfN5VY7C2.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux