From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Sandeen <sandeen@redhat.com>
Cc: "linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] xfs: fix reclaimed page accounting in xfs_buf_free
Date: Fri, 21 Aug 2026 16:24:12 -0700 [thread overview]
Message-ID: <20260821232412.GM6072@frogsfrogsfrogs> (raw)
In-Reply-To: <bf0a3369-f788-4519-9883-8d01d42631e5@redhat.com>
On Fri, Aug 21, 2026 at 05:03:37PM -0500, Eric Sandeen wrote:
> 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: e2874632a621 ("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>
Yikes.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_buf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 1a5340baeabf..8256c1d13ce2 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -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);
>
>
next prev parent reply other threads:[~2026-08-21 23:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 22:03 [PATCH] xfs: fix reclaimed page accounting in xfs_buf_free Eric Sandeen
2026-08-21 23:24 ` Darrick J. Wong [this message]
2026-08-24 4:47 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260821232412.GM6072@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox