diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2023-06-21 17:45:55 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-06-23 16:59:30 -0700 |
commit | 1a0fc811f5f5addf54499826bd1b6e34e917491c (patch) | |
tree | 8452f5dd9b0d782c10f5d1a775a84851dc02b26b /mm/fadvise.c | |
parent | 1e0877d58b1e22517d8939b22b963c043e6c63fd (diff) | |
download | linux-stable-1a0fc811f5f5addf54499826bd1b6e34e917491c.tar.gz linux-stable-1a0fc811f5f5addf54499826bd1b6e34e917491c.tar.bz2 linux-stable-1a0fc811f5f5addf54499826bd1b6e34e917491c.zip |
mm: rename invalidate_mapping_pagevec to mapping_try_invalidate
We don't use pagevecs for the LRU cache any more, and we don't know that
the failed invalidations were due to the folio being in an LRU cache. So
rename it to be more accurate.
Link: https://lkml.kernel.org/r/20230621164557.3510324-12-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/fadvise.c')
-rw-r--r-- | mm/fadvise.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/mm/fadvise.c b/mm/fadvise.c index fb7c5f43fd2a..f684ffd7f9c9 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c @@ -143,7 +143,7 @@ int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice) } if (end_index >= start_index) { - unsigned long nr_pagevec = 0; + unsigned long nr_failed = 0; /* * It's common to FADV_DONTNEED right after @@ -156,17 +156,15 @@ int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice) */ lru_add_drain(); - invalidate_mapping_pagevec(mapping, - start_index, end_index, - &nr_pagevec); + mapping_try_invalidate(mapping, start_index, end_index, + &nr_failed); /* - * If fewer pages were invalidated than expected then - * it is possible that some of the pages were on - * a per-cpu pagevec for a remote CPU. Drain all - * pagevecs and try again. + * The failures may be due to the folio being + * in the LRU cache of a remote CPU. Drain all + * caches and try again. */ - if (nr_pagevec) { + if (nr_failed) { lru_add_drain_all(); invalidate_mapping_pages(mapping, start_index, end_index); |