--8323328-593323588-991814802=:1712
Content-Type: TEXT/PLAIN; charset=US-ASCII
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
--8323328-593323588-991814802=:1712
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="softirq-2.4.6-C2"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.33.0106061006420.1712@localhost.localdomain>
Content-Description:
Content-Disposition: attachment; filename="softirq-2.4.6-C2"
LS0tIGxpbnV4L2luY2x1ZGUvYXNtLWkzODYvc29mdGlycS5oLm9yaWcJV2Vk
IEp1biAgNiAwODo1MTo1NCAyMDAxDQorKysgbGludXgva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klHX1NNUA0KLQlHRVRfQ1VS
UkVOVCglZWJ4KQ0KLSNlbmRpZg0KLQljbGkNCi0JQ0hFQ0tfU09GVElSUQ0K
LQlqZSByZXN0b3JlX2FsbA0KLQljYWxsIFNZTUJPTF9OQU1FKGRvX3NvZnRp
cnEpDQogCWptcCByZXN0b3JlX2FsbA0KIA0KIAlBTElHTg0KQEAgLTI3Niw4
ICsyNDgsNiBAQA0KIAlBTElHTg0KIHJldF9mcm9tX2V4Y2VwdGlvbjoNCiAJ
Y2xpDQotCUNIRUNLX1NPRlRJUlENCi0Jam5lIGhhbmRsZV9zb2Z0aXJxDQog
CWNtcGwgJDAsbmVlZF9yZXNjaGVkKCVlYngpDQogCWpuZSByZXNjaGVkdWxl
DQogCWNtcGwgJDAsc2lncGVuZGluZyglZWJ4KQ0KQEAgLTI5MiwxMSArMjYy
LDYgQEANCiAJam5lIHJldF9mcm9tX3N5c19jYWxsDQogCWptcCByZXN0b3Jl
X2FsbA0KIA0KLQlBTElHTg0KLWhhbmRsZV9zb2Z0aXJxOg0KLQljYWxsIFNZ
TUJPTF9OQU1FKGRvX3NvZnRpcnEpDQotCWptcCByZXRfZnJvbV9pbnRyDQot
CQ0KIAlBTElHTg0KIHJlc2NoZWR1bGU6DQogCWNhbGwgU1lNQk9MX05BTUUo
c2NoZWR1bGUpICAgICMgdGVzdA0K
--8323328-593323588-991814802=:1712--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/