]> git.baikalelectronics.ru Git - kernel.git/commit
pipe: Increase the writer-wakeup threshold to reduce context-switch count
authorDavid Howells <dhowells@redhat.com>
Thu, 31 Oct 2019 15:59:24 +0000 (15:59 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 15 Nov 2019 16:22:54 +0000 (16:22 +0000)
commitbcc6108336cb584440a2bf5f017ed50e31cccbaa
treeff53c378d7ba72dcd451334b331a4359ec96e77e
parent36ca86f31878ea3222331e8ce3a3d82ec016e22d
pipe: Increase the writer-wakeup threshold to reduce context-switch count

Increase the threshold at which the reader sends a wake event to the
writers in the queue such that the queue must be half empty before the wake
is issued rather than the wake being issued when just a single slot
available.

This reduces the number of context switches in the tests significantly,
without altering the amount of work achieved.  With my pipe-bench program,
there's a 20% reduction versus an unpatched kernel.

Suggested-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/pipe.c