]> git.baikalelectronics.ru Git - kernel.git/commit
page waitqueue: always add new entries at the end
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Aug 2017 23:45:40 +0000 (16:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Aug 2017 23:45:40 +0000 (16:45 -0700)
commit8ba73319abca7b99b11102961b843bdebfb29f2c
tree5eea08a1005919edf7057f9da6fc18b619ce6c4a
parent6c1188e99d5b031f9344ed71d62e0abeafaeeed0
page waitqueue: always add new entries at the end

Commit 41a603c31797 ("Minor page waitqueue cleanups") made the page
queue code always add new waiters to the back of the queue, which helps
upcoming patches to batch the wakeups for some horrid loads where the
wait queues grow to thousands of entries.

However, I forgot about the nasrt add_page_wait_queue() special case
code that is only used by the cachefiles code.  That one still continued
to add the new wait queue entries at the beginning of the list.

Fix it, because any sane batched wakeup will require that we don't
suddenly start getting new entries at the beginning of the list that we
already handled in a previous batch.

[ The current code always does the whole list while holding the lock, so
  wait queue ordering doesn't matter for correctness, but even then it's
  better to add later entries at the end from a fairness standpoint ]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c