lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 26 Jan 2009 12:23:37 -0600
From:	"Hunter, Jon" <jon-hunter@...com>
To:	Andrew Morton <akpm@...ux-foundation.org>,
	Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [RFC] Dynamic Tick and Deferrable Timer Support

Andrew Morton <mailto:akpm@...ux-foundation.org> wrote on Thursday, January 15, 2009 12:16 AM:

> Venki, could you please take a look?

Andrew, Venki, if it helps here are some more details.

The function "__next_timer_interrupt()" (in file kernel/timer.c) consists of two main loops. The first loop (shown below) looks for timer events in tv1.

898         /* Look for timer events in tv1. */
899         index = slot = timer_jiffies & TVR_MASK;
900         do {
901                 list_for_each_entry(nte, base->tv1.vec + slot, entry) {
902                         if (tbase_get_deferrable(nte->base))
903                                 continue;
904
905                         found = 1;
906                         expires = nte->expires;
907                         /* Look at the cascade bucket(s)? */
908                         if (!index || slot < index)
909                                 goto cascade;
910                         return expires;
911                 }
912                 slot = (slot + 1) & TVR_MASK;
913         } while (slot != index);


You can see from the above code snippet, that if a timer event is found for tv1, then it performs a test to see if this timer event is deferrable (lines 902 and 903). If no timer events are found for tv1, then the code enters a second loop, a for-loop with a nested do-while loop, that looks for timer events in tv2-tv5.


927         for (array = 0; array < 4; array++) {
928                 struct tvec *varp = varray[array];
929
930                 index = slot = timer_jiffies & TVN_MASK;
931                 do {
932                         list_for_each_entry(nte, varp->vec + slot, entry) {
933                                 found = 1;
934                                 if (time_before(nte->expires, expires))
935                                         expires = nte->expires;
936                         }
937                         /*
938                          * Do we still search for the first timer or are
939                          * we looking up the cascade buckets ?
940                          */
941                         if (found) {
942                                 /* Look at the cascade bucket(s)? */
943                                 if (!index || slot < index)
944                                         break;
945                                 return expires;
946                         }
947                         slot = (slot + 1) & TVN_MASK;
948                 } while (slot != index);
949
950                 if (index)
951                         timer_jiffies += TVN_SIZE - index;
952                 timer_jiffies >>= TVN_BITS;
953         }


In the above code, you will see that if a timer event is found there is no test to see if this timer event is deferrable. The patch that I proposed simply adds two lines of code that performs the same test as seen in the tv1 loop to check if a timer is deferrable for tv2-tv5. In other words, add lines 902 and 903, in between lines 932 and 933 in the function __next_timer_interrupt().

Cheers
Jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ