[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c384c5ea0911171650t1c441dc4v746d31e4154fcb30@mail.gmail.com>
Date: Wed, 18 Nov 2009 01:50:05 +0100
From: Leon Woestenberg <leon.woestenberg@...il.com>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Jean Delvare <khali@...ux-fr.org>,
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>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: yield() in i2c non-happy paths hits BUG under -rt patch
Hello,
On Mon, Nov 16, 2009 at 4:56 PM, Mark Brown
<broonie@...nsource.wolfsonmicro.com> wrote:
> On Fri, Nov 13, 2009 at 11:03:39PM +0100, Thomas Gleixner wrote:
>
>> Q: Why put people yield() into their code ?
>> A: Because:
>> - it is less nasty than busy waiting for a long time
>> - it works better
>
> ...
>
>> I can see the idea of using yield() to let other tasks making progress
>> in situations where the hardware is a design failure as well,
>> e.g. bitbang devices. But if we have to deal with hardware which is
>> crap by design yield() is the worst of all answers simply due to its
>> horrible semantics.
>
> What other options are there available for the first case (which is
> often why things work better with the use of yield) that don't involve
> sleeps, or is the idea that in situations like this drivers should
> always sleep?
>
Good point.
I think the yield()s in the device driver code means "I need a small
delay before the hardware is ready" which might translate to some
arbitrary "let me msleep()" or "do not select this task in the next
scheduler run, EVEN IF this task is highest priority".
Can we mark a task sleeping infinitely short, in such a way that the
scheduler does not schedule it at first resched?
During a next timer timeout check, the task would be marked schedulable again.
I assume this is rather dirty and has too much overhead on the timer interfaces.
Regards,
Leon.
--
Leon
--
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