Skip to contentSkip to conversation

softirq-2.4.5-B0

PATCH Andi Kleen 2 participants 2 messages May 27, 2001 1 message not in the archive

lore
Share & tools
lore

Andi Kleen

author
#1 lore raw
In reply to a message not in the archive
Quoted 6 lines · David S. Miller
Quoted 3 lines

the attached softirq-2.4.5-B0 patch fixes this problem by calling do_softirq() from local_bh_enable() [if the bh count is 0, to avoid recursion].

Yikes! I do not like this fix.

Quoted 7 lines

I'd rather local_bh_enable() not become a more heavy primitive.

I know, in one respect it makes sense because it parallels how hardware interrupts work, but not this thing is a function call instead of a counter bump :-(

Any other ideas how to zap this?

I think the right way to fix it is to do a final atomic check for softirqs when the kernel is exited. To be atomic this check neededs to be done with interrupts off until the kernel exited. I just implemented a very similar way into the x86-64 kernel (which needs to turn off interrupts for kernel anyways for other reasons, this just extends the cli area a bit). The same atomic check is needed for race free check of need_schedule (which is still racy on plain i386).

-Andi

#2 lore raw
Quoted 3 lines · Andi Kleen

I think the right way to fix it is to do a final atomic check for softirqs when the kernel is exited. To be atomic this check neededs to be done with interrupts off until the kernel exited. [...]

check out my first softirq patch, it does exactly this. (but has the wrong explanation.)

Quoted 2 lines

[...] The same atomic check is needed for race free check of need_schedule (which is still racy on plain i386).

right, this need_resched race is fixed in the lowlatency patchset.

Ingo