diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2016-05-20 16:56:28 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-20 17:58:30 -0700 |
commit | bbddabe2e436aa7869b3ac5248df5c14ddde0cbf (patch) | |
tree | 0d30da210546c32852aafc68ae36d4fab1f163d6 /.mailmap | |
parent | f0281a00fe80f0e689dd51e68c3aed5f6ef1bf58 (diff) | |
download | op-kernel-dev-bbddabe2e436aa7869b3ac5248df5c14ddde0cbf.zip op-kernel-dev-bbddabe2e436aa7869b3ac5248df5c14ddde0cbf.tar.gz |
mm: filemap: only do access activations on reads
Andres observed that his database workload is struggling with the
transaction journal creating pressure on frequently read pages.
Access patterns like transaction journals frequently write the same
pages over and over, but in the majority of cases those pages are never
read back. There are no caching benefits to be had for those pages, so
activating them and having them put pressure on pages that do benefit
from caching is a bad choice.
Leave page activations to read accesses and don't promote pages based on
writes alone.
It could be said that partially written pages do contain cache-worthy
data, because even if *userspace* does not access the unwritten part,
the kernel still has to read it from the filesystem for correctness.
However, a counter argument is that these pages enjoy at least *some*
protection over other inactive file pages through the writeback cache,
in the sense that dirty pages are written back with a delay and cache
reclaim leaves them alone until they have been written back to disk.
Should that turn out to be insufficient and we see increased read IO
from partial writes under memory pressure, we can always go back and
update grab_cache_page_write_begin() to take (pos, len) so that it can
tell partial writes from pages that don't need partial reads. But for
now, keep it simple.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: Andres Freund <andres@anarazel.de>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '.mailmap')
0 files changed, 0 insertions, 0 deletions