OSDN Git Service

pipe: remove 'waiting_writers' merging logic
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Dec 2019 21:21:01 +0000 (13:21 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Dec 2019 21:21:01 +0000 (13:21 -0800)
commita28c8b9db8a1014aa572cd19a3bdb9ddebd3e555
tree4f6d8476972bb9b493267df6d0ae021b81519c15
parentf467a6a66419a18f782f87507464a5dedc942dec
pipe: remove 'waiting_writers' merging logic

This code is ancient, and goes back to when we only had a single page
for the pipe buffers.  The exact history is hidden in the mists of time
(ie "before git", and in fact predates the BK repository too).

At that long-ago point in time, it actually helped to try to merge big
back-and-forth pipe reads and writes, and not limit pipe reads to the
single pipe buffer in length just because that was all we had at a time.

However, since then we've expanded the pipe buffers to multiple pages,
and this logic really doesn't seem to make sense.  And a lot of it is
somewhat questionable (ie "hmm, the user asked for a non-blocking read,
but we see that there's a writer pending, so let's wait anyway to get
the extra data that the writer will have").

But more importantly, it makes the "go to sleep" logic much less
obvious, and considering the wakeup issues we've had, I want to make for
less of those kinds of things.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/pipe.c
fs/splice.c
include/linux/pipe_fs_i.h