[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1258636720.4372.350.camel@twins>
Date: Thu, 19 Nov 2009 14:18:40 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Jean Delvare <khali@...ux-fr.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Leon Woestenberg <leon.woestenberg@...il.com>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Sven-Thorsten Dietrich <sven@...bigcorporation.com>,
linux-i2c@...r.kernel.org,
rt-users <linux-rt-users@...r.kernel.org>,
"Ben Dooks (embedded platforms)" <ben-linux@...ff.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: yield() in i2c non-happy paths hits BUG under -rt patch
On Thu, 2009-11-19 at 13:05 +0100, Jean Delvare wrote:
>
> Was yield() turned into NOOP by design, or was it a bug?
Design.
yield() for SCHED_OTHER is not specified, so everything goes.
There's two possible 'sane' options for yield for (CFS's) SCHED_OTHER:
- place the task behind all other tasks of the same nice level
This is however an O(n) operation for CFS since we don't separate
things out based on nice level, hence we don't do that.
- service the task that is most starved of service
That fits nicely into the fairness thing, and is what we default to.
The thing is, that's current in 99% of the cases, otherwise we would
already be running another task.
So its not strictly a NOP, but in practice it is.
There is also another option, place the task behind _all_ other tasks,
but that also surprises people and causes regressions, because they
don't expect yield() to wait _that_ long.
And all this is irrespective of the question of whether yield() is ever
a sane thing to do (I say not).
--
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