Re: [PATCH] syscall latency improvement #1

Paul Mackerras (paulus@samba.org)
Sat, 26 Jan 2002 10:07:54 +1100 (EST)


David Howells writes:

> The attached patch does the following to 2.5.3-pre5:
>
> * consolidates various status items that are found in the lower reaches of
> task_struct into one 32-bit word, thus allowing them to be tested
> atomically without the need to disable interrupts in entry.S.

I'm no expert on the x86 arch-specific code, but it looks to me like
you have misunderstood what is going on there. It seems to me that
you have opened up a race by testing the need_resched and sigpending
flags with interrupts enabled. The race is that you can test those
flags and find them false, and then get an interrupt that sets one or
other of those flags. You will then return to the usermode process
and not act on the need_resched or sigpending until the next
interrupt. So in fact you will reschedule / deliver the signal
eventually, but with extra latency.

In other words, the "atomic" in the comment is not about testing
need_resched and sigpending at the same time, but about making the
process of testing those flags and returning to usermode atomic.

Paul.
-
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/