On Tue, 5 Jun 2001, Linus Torvalds wrote:
> entry.S:
>
> + xorl %ecx,%ecx; \
> testl SYMBOL_NAME(irq_stat)+4(,%eax),%ecx
oops, bogus indeed.
the softirq checks in entry.S are now obsolete and i've removed them in
-C2 completely. (this also explains why this 'dummy' entry.S code had no
effect on performance and stability.) Any code that can somehow end up
delaying softirqs is supposed to restart them explicitly.
this should at least somewhat reduce the cost of having to add a cli to
the need_resched and sigpending checks.
we could avoid the cli in the syscall path by putting an additional check
into the IRQ path: we can check the interrupted EIP and fix up the return
EIP if we interrupted the 'critical path'. (since the window is small,
this check would be triggered rarely.) [the idea is not mine, i think it
came from Chris Evans, and the code is included in the lowlatency
patches.]
> (The "cli" may help the need_resched thing, but I doubt it matters, and
> if that's what you're trying to do then you should move it there,
> instead of having it at the softirq place).
yes, it was there partly for need_resched and sigpending purposes as well,
so a cli before the need_resched and sigpending checks is still needed.
the attached softirq-2.4.6-C2 patch (relative to -B4) has another change
as well:
- to make the local_bh_enable() softirq-check even more lightweight, on
x86 i've moved parts of it into asssembly, with the slow path moved into
an offline section. The assembly code does not mark any register as
clobbered to reduce the register-saving overhead, so it has to save
%eax, %ecx and %edx prior calling do_softirq().
in -C2 a softirq-restart check is straight fall-through code with two
untaken forward-pointing branches, which should put the cost of the
common softirq check on the order of 1-2 cycles. (plus the unavoidable
icache footprint increase.)
(the patch has been sanity compiled & booted on both UP and SMP x86.)
Ingo
This archive was generated by hypermail 2b29 : Thu Jun 07 2001 - 21:00:45 EST