Re: [RFC][PATCH 6/8] mm: handle_speculative_fault()

From: Linus Torvalds
Date: Thu Jan 07 2010 - 11:32:51 EST




On Thu, 7 Jan 2010, Linus Torvalds wrote:
>
> (Side note: I wonder if we should wake up _all_ readers when we wake up
> any. Right now, we wake up all readers - but only until we hit a writer.
> Which is the _fair_ thing to do, but it does mean that we can end up in
> horrible patterns of alternating readers/writers, when it could be much
> better to just say "release the hounds" and let all pending readers go
> after a writer has had its turn).

Btw, this would still be "mostly fair" in the sense that you couldn't
starve writers. Any writer on the list is still guaranteed to be woken up
next, because now it will be at the front of the queue.

So it would be starvation-proof - new readers that come in _after_ we've
woken up all the old ones would not get to pass the writers. It might be
interesting to test, if somebody has a problematic threaded workload with
lots of page faults and allocations mixxed.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/