[PATCH v3 0/7] Modify memfd_luo code

Chenghao Duan posted 7 patches 1 week ago
mm/memfd_luo.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
[PATCH v3 0/7] Modify memfd_luo code
Posted by Chenghao Duan 1 week ago
I found several modifiable points while reading the code. Please review.

v3:
v2 patches remain unchanged, and v3 adds 3 additional patches.
<mm/memfd_luo: fix physical address conversion in put_folios cleanup>
<mm/memfd_luo: remove folio from page cache when accounting fails>
<mm/memfd_luo: fix integer overflow in memfd_luo_preserve_folios>

These three patches address issues identified by the AI review,
with the review link as follows:
https://sashiko.dev/#/patchset/20260323110747.193569-1-duanchenghao@kylinos.cn

v2:
https://lore.kernel.org/all/20260323140938.ba8943a5247c14b17bc70142@linux-foundation.org/

As suggested by Pratyush Yadav, add patch
<mm/memfd: use folio_nr_pages() for shmem inode accounting>.
https://lore.kernel.org/all/2vxzqzpebzi2.fsf@kernel.org/

<mm/memfd_luo: optimize shmem_recalc_inode calls in retrieve path>
Same as V1, no logic changes; depends on patch #1 for modifications.

<mm/memfd_luo: remove unnecessary memset in zero-size memfd path>
No modifications have been made.

<mm/memfd_luo: use i_size_write() to set inode size during retrieve>
Add consistency-related descriptions to the commit log.

v1:
https://lore.kernel.org/all/20260319012845.29570-1-duanchenghao@kylinos.cn/

Chenghao Duan (7):
  mm/memfd: use folio_nr_pages() for shmem inode accounting
  mm/memfd_luo: optimize shmem_recalc_inode calls in retrieve path
  mm/memfd_luo: remove unnecessary memset in zero-size memfd path
  mm/memfd_luo: use i_size_write() to set inode size during retrieve
  mm/memfd_luo: fix physical address conversion in put_folios cleanup
  mm/memfd_luo: remove folio from page cache when accounting fails
  mm/memfd_luo: fix integer overflow in memfd_luo_preserve_folios

 mm/memfd_luo.c | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

-- 
2.25.1
Re: [PATCH v3 0/7] Modify memfd_luo code
Posted by Andrew Morton 6 days, 21 hours ago
On Thu, 26 Mar 2026 16:47:20 +0800 Chenghao Duan <duanchenghao@kylinos.cn> wrote:

> Subject: [PATCH v3 0/7] Modify memfd_luo code

I'd like to see a more desriptive title than this.  Maybe "memfd_luo:
various fixes and cleanups".  This isn't a big deal and "Modify
memfd_luo code" is good enough ;)

> Date: Thu, 26 Mar 2026 16:47:20 +0800
> X-Mailer: git-send-email 2.25.1
> 
> I found several modifiable points while reading the code. Please review.
> 
> v3:
> v2 patches remain unchanged, and v3 adds 3 additional patches.
> <mm/memfd_luo: fix physical address conversion in put_folios cleanup>
> <mm/memfd_luo: remove folio from page cache when accounting fails>
> <mm/memfd_luo: fix integer overflow in memfd_luo_preserve_folios>
> 
> These three patches address issues identified by the AI review,
> with the review link as follows:
> https://sashiko.dev/#/patchset/20260323110747.193569-1-duanchenghao@kylinos.cn

OK, I'll add this.  I'm trying to seriously slow things down now but
this series does address a bunch of issues.

Maintainers, there are a few more patches here than were in v2, so
please take a look?

Thanks.