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  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, 8 Jul 2013 13:10:48 -0700
From:	Linus Torvalds <>
To:	Stephen Hemminger <>
Cc:	Eliezer Tamir <>,
	David Miller <>,
	Linux Kernel Mailing List <>,
	Network Development <>,
	Andrew Morton <>,
	David Woodhouse <>,
	Eliezer Tamir <>
Subject: Re: [PATCH net-next] net: rename low latency sockets functions to
 busy poll

On Mon, Jul 8, 2013 at 1:05 PM, Stephen Hemminger
<> wrote:
>> >
>> >     unsigned long start_time = 0;
>> >     ...
>> >     if (want_busy_poll && !need_resched()) {
>> >         unsigned long now = busy_poll_sched_clock();
>> >         if (!start_time) {
>> >             start_time = now + sysctl.busypoll;
>> >             continue;
>> >         }
>> >         if (time_before(start_time, now))
>> >             continue;
>> >     }
>> >
> Since this code is in hot path, and a special case, looks like a good
> candidate for static branch.

No, it's not static. It's an initializer, yes, but it's not a static
one, and it gets run on every single select()/poll(). Well, every
single one that goes through the loop more than once.

So it's very much a dynamic condition. It's just placed that way to
avoid doing the (relatively expensive) time read for the case where
data is available immediately.

And the "data is available immediately" case is actually fairly
common. Sometimes it's because the producer/network is faster than the
consumer. And sometimes it's because you get big chunks at a time, but
the reader/writer ends up always going through a select() loop without
actually reading/writing everything in a loop until it gets a
full/empty error.

And I bet that both of those cases happen even with programs/networks
that end up using the magic low-latency/busyloop polling flags. So
avoiding the timer read if at all possible is definitely a good idea.

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists