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]
Message-Id: <20071115.005720.12599943.davem@davemloft.net>
Date:	Thu, 15 Nov 2007 00:57:20 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	dada1@...mosbay.com
Cc:	andi@...stfloor.org, netdev@...r.kernel.org
Subject: Re: [PATCH] NET : rt_check_expire() can take a long time, add a
 cond_resched()

From: Eric Dumazet <dada1@...mosbay.com>
Date: Thu, 15 Nov 2007 09:25:59 +0100

> Please note that :
> 
> if (need_resched())
>      cond_resched();
> 
> will re-test need_resched() once cond_resched() is called.
> 
> So it may sound unnecessary but in the rt_check_expire() case, with a loop 
> potentially doing XXX.XXX iterations, being able to bypass the function call 
> is a clear win (in my bench case, 25 ms instead of 88 ms). Impact on I-cache 
> is irrelevant here as this rt_check_expires() runs once every 60 sec.

BTW, Eric, initially I was going to recommend that you do
something like:

	if ((goal % SOME_POWER_OF_2) == 0)
		cond_resched();

to mitigate this cost but decided it wasn't worth the bother.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ