mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 15:40:03 +02:00
xfs: fix reclaimed page accounting in xfs_buf_free
To obtain nr. of pages in "size" bytes, we need howmany(size, PAGE_SIZE)
not howmany(size, PAGE_SHIFT). This over-reports reclaim by orders of
magnitude, up to 4096x on a 64k page system.
Fixes: e2874632a6 ("xfs: use vmalloc instead of vm_map_area for buffer backing memory")
Cc: stable@vger.kernel.org # v6.15+
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
7538ba528c
commit
4164b1e3d7
|
|
@ -139,7 +139,7 @@ xfs_buf_free(
|
|||
ASSERT(list_empty(&bp->b_lru));
|
||||
|
||||
if (!xfs_buftarg_is_mem(bp->b_target) && size >= PAGE_SIZE)
|
||||
mm_account_reclaimed_pages(howmany(size, PAGE_SHIFT));
|
||||
mm_account_reclaimed_pages(howmany(size, PAGE_SIZE));
|
||||
|
||||
if (is_vmalloc_addr(bp->b_addr))
|
||||
vfree(bp->b_addr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user