[PATCH v2 0/4] Modify memfd_luo code

From: Chenghao Duan

Date: Mon Mar 23 2026 - 07:23:05 EST


I found several modifiable points while reading the code. Please review.

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

<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@xxxxxxxxxx/

Chenghao Duan (4):
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.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)

--
2.25.1