Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1945061rdb; Tue, 3 Oct 2023 06:07:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXlqOuxmEFfnkA1KsY4aWzVdAJf1x37Ti0cECTOQo7MpejIAVfqw5AiIEyJoTXu4apfGx7 X-Received: by 2002:a05:6e02:dcc:b0:351:4b68:ec32 with SMTP id l12-20020a056e020dcc00b003514b68ec32mr14220647ilj.10.1696338462889; Tue, 03 Oct 2023 06:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696338462; cv=none; d=google.com; s=arc-20160816; b=Sp0KsJyEFJjvs3EBpd2qjvalyMwUvA0nx1tx1KxZYiauaB3dCb4+MMcroFTLFH3BZG LAohWs8Se+ZrvpjxiJ454vKc0RzN4lT97PvjgJQzHM26ItSpFW7+7gI9hcr84WeWkHQ9 vlqv8JM1a2eqWFYJ+P4Q0aK+Gc5Z5YOtyfvgLjKfmJ77HfYc4OIWA8onG7+B01j59w8G xjMUoMyTyAu69X5LsoNnLHivXRv2OoiwA9UjPrSIAve8OheV+MMV9JKT+lKfxmgiDHBS UrjmGvWPXoTapC+Bhg9yEC66MfYpJm38nicBAyNw0pgvqh1WOXmFZ+POeBfAkM9VWqQ7 laAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=FrpETq8twusJ5sdH9d+XrhUFsRvR1gF/4TiRFUUmkNo=; fh=AJq6fOzBFVmx73gpyiQEeL2QptW2TwogVske581TpYk=; b=VpCDrr+4rYBLMsaNDKlNtpMpxaUCxHc07WCvUqDtJY0/8zCC7Jw5hXMVhcRy3O2mQ1 c2WgbvVJ+/2NVGiCF72TXfpBkCWssc5oI6CgslLvKoz7MYRw8PYzYpdu0pCWnMRGgk28 pSBrwhUS6lltcX0Fft55nALwCsnBA7dlb40yUsRZRwboUV3WfLTL9ngFwQZvkBlp5PPC JBO0vZC57EaoIsMetknbzdZwtP9k0BrFBk4R6UkwsUigGLicQCvg2VMKliYK2U6VO30i +l48sCXeY8oeMu5Fjd2GYNYRqKkNuiwkmZaacRBtd64r+d97HEEqbPIwYAS7xZpYH9rF gL5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=tOXjeMZG; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=Tc5HhKdZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a22-20020a637f16000000b00565e92e8734si1364029pgd.769.2023.10.03.06.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 06:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=tOXjeMZG; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=Tc5HhKdZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B891180C056C; Tue, 3 Oct 2023 06:07:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232636AbjJCNHh (ORCPT + 99 others); Tue, 3 Oct 2023 09:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232578AbjJCNHf (ORCPT ); Tue, 3 Oct 2023 09:07:35 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF66893; Tue, 3 Oct 2023 06:07:31 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A76911F45B; Tue, 3 Oct 2023 13:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1696338450; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FrpETq8twusJ5sdH9d+XrhUFsRvR1gF/4TiRFUUmkNo=; b=tOXjeMZGVlb97/Zga+TON5k8gXv2c7gmG4KxASLu0sE/TvavPKgmvnkSVcpY5tCwIgqIMJ JdgDc1Hx1IuePwvXuFIRv9VJMtfufVzx6B8B1RPpjjOF8rfyiHvgKAYr3VGQLitpsCbAl3 fiVAJ0Oh6Dnx/oe7HtEjBFRLL1WG5JI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1696338450; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FrpETq8twusJ5sdH9d+XrhUFsRvR1gF/4TiRFUUmkNo=; b=Tc5HhKdZU8QKXE3JUQyWi4uE30im3D3QubNCSrnQjD7NHbDOKkdpTAkHv1shINBQYVdCIF jz/GIVFtdYoFfJBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9A6D4132D4; Tue, 3 Oct 2023 13:07:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0Aa4JRISHGWVLgAAMHmgww (envelope-from ); Tue, 03 Oct 2023 13:07:30 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 48209A07CC; Tue, 3 Oct 2023 15:07:30 +0200 (CEST) Date: Tue, 3 Oct 2023 15:07:30 +0200 From: Jan Kara To: Hugh Dickins Cc: Andrew Morton , Christian Brauner , Carlos Maiolino , Chuck Lever , Jan Kara , Matthew Wilcox , Johannes Weiner , Axel Rasmussen , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 2/8] shmem: remove vma arg from shmem_get_folio_gfp() Message-ID: <20231003130730.hiag5s6ubditcazg@quack3> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 06:07:40 -0700 (PDT) On Fri 29-09-23 20:26:53, Hugh Dickins wrote: > The vma is already there in vmf->vma, so no need for a separate arg. > > Signed-off-by: Hugh Dickins Sure. Feel free to add: Reviewed-by: Jan Kara Honza > --- > mm/shmem.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/mm/shmem.c b/mm/shmem.c > index 69595d341882..824eb55671d2 100644 > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -1921,14 +1921,13 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index, > * 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; > @@ -2141,7 +2140,7 @@ int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop, > 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); > } > > /* > @@ -2225,7 +2224,7 @@ static vm_fault_t shmem_fault(struct vm_fault *vmf) > } > > 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) > @@ -4897,7 +4896,7 @@ struct folio *shmem_read_folio_gfp(struct address_space *mapping, > > 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); > > -- > 2.35.3 > -- Jan Kara SUSE Labs, CR