]> www.infradead.org Git - users/willy/xarray.git/commitdiff
filemap: fix the last_index of mm_filemap_get_pages
authorTakaya Saeki <takayas@chromium.org>
Tue, 3 Sep 2024 10:21:00 +0000 (10:21 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 9 Sep 2024 23:39:12 +0000 (16:39 -0700)
In commit b6273b55d885 ("filemap: add trace events for get_pages,
map_pages, and fault"), mm_filemap_get_pages was added to trace page cache
access.  However, it tracks an extra page beyond the end of the accessed
range.  This patch fixes it by replacing last_index with last_index - 1.

Link: https://lkml.kernel.org/r/20240903102100.70405-1-takayas@chromium.org
Fixes: b6273b55d885 ("filemap: add trace events for get_pages, map_pages, and fault")
Signed-off-by: Takaya Saeki <takayas@chromium.org>
Cc: Junichi Uekawa <uekawa@chromium.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/filemap.c

index 88a2ed00847484b27a86ad9a95c093134d308876..7eb4637ea199ce0769fb563ba1a1cdaaa67cd0c0 100644 (file)
@@ -2567,7 +2567,7 @@ retry:
                        goto err;
        }
 
-       trace_mm_filemap_get_pages(mapping, index, last_index);
+       trace_mm_filemap_get_pages(mapping, index, last_index - 1);
        return 0;
 err:
        if (err < 0)