lkml.org 
[lkml]   [2008]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: use of preempt_count instead of in_atomic() at leds-gpio.c
Henrique de Moraes Holschuh wrote:
> On Fri, 21 Mar 2008, Stefan Richter wrote:
>> and eth1394 to deal with temporary lack of of tlabels. Alas I just
>> recently received a report that eth1394's workaround is unsuccessful on
>> non-preemptible uniprocessor kernels.
>
> Which, I think, is exactly the config where in_atomic() can't be used to
> mean "in_scheduleable_context()" ?

That's coincidence.

The mentioned workaround fails this way:
- tlabel consumer eth1394 (IPv4 over FireWire) grabs lots of tlabels
in soft IRQ context.
- tlabel recycler khpsbpkt (a kthread of ieee1394) sleeps even though
it could start putting tlabels back into the pool.
- eth1394 can't get tlabels anymore, stops the transmit queue,
schedules a workqueue job.
- eth1394's workqueue job (run by the events kthread) tries to acquire
a tlabel. It does so in non-atomic context and hence sleeps in
hpsb_get_tlabel() until the tlabel pool is nonempty again. It would
then wake up the eth1394 transmit queue again.
- Normally, khpsbpkt would have been woken up by now and would have
released a lot of now unused tlabels back into the pool again.
However, on UP preempt_none kernels, khpsbpkt continues to sleep.
(The 1394 stack's lower level runing in IRQ context or perhaps
tasklet context wakes up khpsbpkt.)
- Since it doesn't get a tlabel, eth1394's workqueue jobs sleeps
forever as well.

Result is that all other tasks of the shared workqueue can't be
serviced, notably the keyboard is stuck, and that the eth1394 connection
breaks down. (I haven't started working on a fix, or opened a bugzilla
ticket for it yet. The reporter currently switched his kernel to
PREEMPT which is not affected.)

IOW:
The failure in the workaround is *not* about the in_atomic() being the
wrong question asked in hpsb_get_tlabel() --- no, ieee1394's in_atomic()
abuse works just fine even on UP PREEMPT_NONE. Instead, the failure is
about kthreads not being scheduled in the way that I thought they would.
--
Stefan Richter
-=====-==--- --== =-=-=
http://arcgraph.de/sr/


\
 
 \ /
  Last update: 2008-03-21 14:21    [W:0.101 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site