History

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.

Linus Torvalds committed 6 years ago

Commit a28c8b91 parent f467a6a3 files · +9 −33Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/pipe_fs_i.h+0−2
@@ -38,7 +38,6 @@ struct pipe_buffer { · 37 unmodified lines
3838 * @readers: number of current readers of this pipe
3939 * @writers: number of current writers of this pipe
4040 * @files: number of struct file referring this pipe (protected by ->i_lock)
41− * @waiting_writers: number of writers blocked waiting for room
4241 * @r_counter: reader counter
4342 * @w_counter: writer counter
4443 * @fasync_readers: reader side fasync
@@ -56,7 +55,6 @@ struct pipe_inode_info { · 11 unmodified lines
5655 unsigned int readers;
5756 unsigned int writers;
5857 unsigned int files;
59− unsigned int waiting_writers;
6058 unsigned int r_counter;
6159 unsigned int w_counter;
6260 struct page *tmp_page;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t