[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <531D022E.4070009@meduna.org>
Date: Mon, 10 Mar 2014 01:07:10 +0100
From: Stanislav Meduna <stano@...una.org>
To: David Miller <davem@...emloft.net>, ben@...adent.org.uk
CC: mkl@...gutronix.de, 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 09.03.2014 23:53, David Miller wrote:
> To me it means "I've got nothing to do if other tasks want to run right
> now" Yes, I even see it having this meaning when an RT task executes
> it.
http://www.kernel.org/doc/htmldocs/device-drivers/API-yield.html
lists this exact "while (!event) yield;" pattern as a broken usage
and states "Never use yield as a progress guarantee!!".
> How else can you interpret the intent above?
IMNSHO there is no way to make the yield() honor this intent if it is
called from a SCHED_FIFO or SCHED_RR task and the task unblocking
it is running at a lower priority. On the PREEMPT_RT systems where
the interrupt handlers are threads an application thread running
at higher priority than some interrupt handlers is a common situation.
The semantics of the scheduler here is "run the highest priority
runnable task until it blocks (FIFO) or its time slice is over
and there are more with the _same_ priority (RR)". This scenario
then collapses into a busy loop never making progress.
> If you change it to msleep(1), you're assigning an extra completely
> arbitrary time limit to the yield. The code doesn't want to sleep
> for 1ms, that's not what it's asking for.
The problem is that there is no way to formulate what it is asking
for in scheduler terms only.
Regards
--
Stano
--
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