]> git.ipfire.org Git - people/ms/linux.git/commit - fs/gfs2/file.c
gfs2: Fix should_fault_in_pages() logic
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 7 Mar 2022 22:30:03 +0000 (23:30 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 23 Mar 2022 15:51:46 +0000 (16:51 +0100)
commitbb7f5d96aaa87d5aee2f5eb98ae0b84f08988489
treef97d5b95ac13a330a9a4d6001a8601d336c50492
parentb2963932346f0631c5145f656a22d4237f0956fa
gfs2: Fix should_fault_in_pages() logic

Fix the fault-in window size logic:
* Use a maximum window size of 1 MiB instead of BIO_MAX_VECS * PAGE_SIZE.
  The previous window size was always one page because the pages variable
  was accidentally being defined and then redefined in
  should_fault_in_pages().
* The nr_dirtied heuristic for guessing when there might be memory
  pressure often results in very small window sizes.  Don't let
  nr_dirtied drop below 8 pages (as btrfs does).
* Compute the window size in units of bytes, not pages.
* Account for page overlap (unaligned iterators).

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/file.c