All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Yadav <pratyush@kernel.org>
To: DaeMyung Kang <charsyam@gmail.com>
Cc: pasha.tatashin@soleen.com,  rppt@kernel.org,
	 akpm@linux-foundation.org, pratyush@kernel.org,
	 linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: memfd_luo: account restored large folios correctly
Date: Tue, 14 Apr 2026 10:48:32 +0000	[thread overview]
Message-ID: <2vxzik9t95rz.fsf@kernel.org> (raw)
In-Reply-To: <20260413165053.164338-1-charsyam@gmail.com> (DaeMyung Kang's message of "Tue, 14 Apr 2026 01:50:53 +0900")

Hi DaeMyung,

On Tue, Apr 14 2026, DaeMyung Kang wrote:

> memfd_luo_retrieve_folios() always passes 1 to
> shmem_inode_acct_blocks() and shmem_recalc_inode(), even when the
> restored folio spans multiple pages.
>
> That mismatches the normal shmem path: shmem_add_to_page_cache()
> accounts the folio in mapping->nrpages using folio_nr_pages(folio),
> and shmem_alloc_and_add_folio() passes the same page count to
> shmem_inode_acct_blocks() and shmem_recalc_inode().
>
> As a result, restored large folios are under-accounted in shmem inode
> and block accounting.
>
> Use folio_nr_pages(folio) here as well.
>
> Fixes: b3749f174d68 ("mm: memfd_luo: allow preserving memfd")
> Signed-off-by: DaeMyung Kang <charsyam@gmail.com>

Thanks for the patch. This bug is already fixed by this patch [0].

[0] https://lore.kernel.org/linux-mm/20260326084727.118437-2-duanchenghao@kylinos.cn/

[...]

-- 
Regards,
Pratyush Yadav


      reply	other threads:[~2026-04-14 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13 16:50 [PATCH] mm: memfd_luo: account restored large folios correctly DaeMyung Kang
2026-04-14 10:48 ` Pratyush Yadav [this message]

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=2vxzik9t95rz.fsf@kernel.org \
    --to=pratyush@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=charsyam@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=rppt@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.