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:	Thu, 06 Mar 2014 22:39:58 +0100
From:	Marc Kleine-Budde <mkl@...gutronix.de>
To:	David Miller <davem@...emloft.net>
CC:	linux-rt-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org, kernel@...gutronix.de
Subject: Re: [PATCH] net: sched: dev_deactivate_many(): use msleep(1) instead
 of yield() to wait for outstanding qdisc_run calls

On 03/06/2014 10:06 PM, David Miller wrote:
> From: Marc Kleine-Budde <mkl@...gutronix.de>
> Date: Wed,  5 Mar 2014 00:49:47 +0100
> 
>> @@ -839,7 +839,7 @@ void dev_deactivate_many(struct list_head *head)
>>  	/* Wait for outstanding qdisc_run calls. */
>>  	list_for_each_entry(dev, head, unreg_list)
>>  		while (some_qdisc_is_busy(dev))
>> -			yield();
>> +			msleep(1)
>>  }
> 
> I don't understand this.
> 
> yield() should really _mean_ yield.
> 
> The intent of a yield() call, like this one here, is unambiguously
> that the current thread cannot do anything until some other thread
> gets onto the cpu and makes forward progress.
> 
> Therefore it should allow lower priority threads to run, not just
> equal or higher priority ones.

Yes, we need a call that does what you described, however I'm not sure
if yield() really does that. According to:

http://lxr.free-electrons.com/source/kernel/sched/core.c#L3599

> * Typical broken usage is:
> *
> * while (!event)
> *      yield();
> *
> * where one assumes that yield() will let 'the other' process run that will
> * make event true. If the current task is a SCHED_FIFO task that will never
> * happen. Never use yield() as a progress guarantee!!

My Process runs with SCHED_FIFO and prio > 50, with IRQ at default prio,
which is 50.

Maybe the RT guys can comment on this. I found another interesting
function in the RT patch set: cpu_chill().

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


Download attachment "signature.asc" of type "application/pgp-signature" (243 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ