The patch titled Subject: shmem: remove vma arg from shmem_get_folio_gfp() has been added to the -mm mm-unstable branch. Its filename is shmem-remove-vma-arg-from-shmem_get_folio_gfp.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/shmem-remove-vma-arg-from-shmem_get_folio_gfp.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Hugh Dickins <hughd@xxxxxxxxxx> Subject: shmem: remove vma arg from shmem_get_folio_gfp() Date: Fri, 29 Sep 2023 20:26:53 -0700 (PDT) The vma is already there in vmf->vma, so no need for a separate arg. Link: https://lkml.kernel.org/r/d9ce6f65-a2ed-48f4-4299-fdb0544875c5@xxxxxxxxxx Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Axel Rasmussen <axelrasmussen@xxxxxxxxxx> Cc: Carlos Maiolino <cem@xxxxxxxxxx> Cc: Christian Brauner <brauner@xxxxxxxxxx> Cc: Chuck Lever <chuck.lever@xxxxxxxxxx> Cc: Darrick J. Wong <djwong@xxxxxxxxxx> Cc: Dave Chinner <dchinner@xxxxxxxxxx> Cc: Jan Kara <jack@xxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Tim Chen <tim.c.chen@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/shmem.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) --- a/mm/shmem.c~shmem-remove-vma-arg-from-shmem_get_folio_gfp +++ a/mm/shmem.c @@ -1938,14 +1938,13 @@ unlock: * vm. If we swap it in we mark it dirty since we also free the swap * entry since a page cannot live in both the swap and page cache. * - * vma, vmf, and fault_type are only supplied by shmem_fault: - * otherwise they are NULL. + * vmf and fault_type are only supplied by shmem_fault: otherwise they are NULL. */ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index, struct folio **foliop, enum sgp_type sgp, gfp_t gfp, - struct vm_area_struct *vma, struct vm_fault *vmf, - vm_fault_t *fault_type) + struct vm_fault *vmf, vm_fault_t *fault_type) { + struct vm_area_struct *vma = vmf ? vmf->vma : NULL; struct address_space *mapping = inode->i_mapping; struct shmem_inode_info *info = SHMEM_I(inode); struct shmem_sb_info *sbinfo; @@ -2158,7 +2157,7 @@ int shmem_get_folio(struct inode *inode, enum sgp_type sgp) { return shmem_get_folio_gfp(inode, index, foliop, sgp, - mapping_gfp_mask(inode->i_mapping), NULL, NULL, NULL); + mapping_gfp_mask(inode->i_mapping), NULL, NULL); } /* @@ -2242,7 +2241,7 @@ static vm_fault_t shmem_fault(struct vm_ } err = shmem_get_folio_gfp(inode, vmf->pgoff, &folio, SGP_CACHE, - gfp, vma, vmf, &ret); + gfp, vmf, &ret); if (err) return vmf_error(err); if (folio) @@ -4910,7 +4909,7 @@ struct folio *shmem_read_folio_gfp(struc BUG_ON(!shmem_mapping(mapping)); error = shmem_get_folio_gfp(inode, index, &folio, SGP_CACHE, - gfp, NULL, NULL, NULL); + gfp, NULL, NULL); if (error) return ERR_PTR(error); _ Patches currently in -mm which might be from hughd@xxxxxxxxxx are shmem-shrink-shmem_inode_info-dir_offsets-in-a-union.patch shmem-remove-vma-arg-from-shmem_get_folio_gfp.patch shmem-factor-shmem_falloc_wait-out-of-shmem_fault.patch shmem-trivial-tidyups-removing-extra-blank-lines-etc.patch shmem-shmem_acct_blocks-and-shmem_inode_acct_blocks.patch shmem-move-memcg-charge-out-of-shmem_add_to_page_cache.patch shmem-_add_to_page_cache-before-shmem_inode_acct_blocks.patch shmempercpu_counter-add-_limited_addfbc-limit-amount.patch