Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7893204rwl; Tue, 10 Jan 2023 06:42:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXvxxDBzdBQir9KR96mfBj9Zm0gyAjGNlsaCYifNrimo4ZGYhTcvASmu7T0nzsbk+1OU7LO2 X-Received: by 2002:aa7:c393:0:b0:499:b604:4de6 with SMTP id k19-20020aa7c393000000b00499b6044de6mr5965703edq.25.1673361732599; Tue, 10 Jan 2023 06:42:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673361732; cv=none; d=google.com; s=arc-20160816; b=jAZ99NxnRqeN/b4iZi2kJUILX8zY4QXFMoUNQ5woZtLtKe7rijcVYeDH7RTz6crmjB xvwgtRJjf/oZo9a/r5ddiXjCze1PMzOKQbE6JI6pAmrfag6MEiCR+ZqTOec5snQJb3nn MZfJ14AXAohjTd28QDU/pbseCq714WM5Xmt9iYY3HEZpsF2zR2fRoZg/Wppl2fFdi+7j x+T5yTF7ICcg+1VMznhwTTrZPC4lZbv/6iy348exMc1r9XPLAnK+bw2Hh6r//HWgGgzU gAsBFS4WIc5jfbZ1g97by9ODDhsIfdXcQeSIbMOy2Q9Pur4+qtQqPj2bnI6b83N1cpbE j+BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=+ifLyQ+MOB8va2XR1K/FSEoQ13TM793cM+jcIwLQQ1I=; b=fr67z+UQ8lnJMrEppXuYLpAVwThTuL1wHb+7ScPiwuMOrNY991u7AUwO+Q4oHD+G0p +ax3Lz8auladPeU1Q224RW9E1V0PFxC4Tky+Scskm1E4R4NE1+G307ZTB7cIwJW2xNi7 wx4ZgXwVffX6RQzs8CocGLTyJQonKF7zX5iRb9x5CxlrVbn0fuPFUwoMNN44k2mEXf3s eezaBj8AYMO0rFD/SimGSMi67uG94uBGhYouytOeNwuMMWRGZLQawm8iZlncyJBkrUY+ sep9UU0lRo3ZTKGccJ2v+/tT6SYUPRZpAtGa1mYNbGDayoH5hcXEsxufXUGbFi+I+hZX 4nkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="FWFe/2g3"; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020a056402358a00b0048ba605a150si14063029edc.240.2023.01.10.06.41.59; Tue, 10 Jan 2023 06:42:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="FWFe/2g3"; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233988AbjAJO2S (ORCPT + 53 others); Tue, 10 Jan 2023 09:28:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231228AbjAJO2O (ORCPT ); Tue, 10 Jan 2023 09:28:14 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2466C1C for ; Tue, 10 Jan 2023 06:28:13 -0800 (PST) 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-out1.suse.de (Postfix) with ESMTPS id 8C0864EE9B; Tue, 10 Jan 2023 14:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1673360892; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ifLyQ+MOB8va2XR1K/FSEoQ13TM793cM+jcIwLQQ1I=; b=FWFe/2g3VcdAzJMPRdwrZ/OV4tN95vwMMNoC8plTb9de6EmMq3WlidVmHDvga3gj+unvfS LQGtgpctufOtAovPRn+ZLX+g59MWli6aVvXivzuKbo0sFH3gIWzLL66S0b3jt7IhZsyoT6 kGwDynhFTtXsMT1xiPgKXujn9R2Puw4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1673360892; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ifLyQ+MOB8va2XR1K/FSEoQ13TM793cM+jcIwLQQ1I=; b=6lEdOHu4gM5jCStFiKTGkzXIvnRYZV/jQZj3Wnw6qGvDjmyc4OyNmubcBNTEMiWpGuCES8 lfENQdqnaiBv3ZAA== 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 6EFC41358A; Tue, 10 Jan 2023 14:28:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0W16Gvx1vWOcXgAAMHmgww (envelope-from ); Tue, 10 Jan 2023 14:28:12 +0000 Message-ID: <1e862dbf-1618-c546-f0d9-ca54f129285c@suse.cz> Date: Tue, 10 Jan 2023 15:28:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] mm/sl{a,u}b: fix wrong usages of folio_page() for getting head pages Content-Language: en-US To: SeongJae Park , akpm@linux-foundation.org Cc: willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes , Hyeonggon Yoo <42.hyeyoo@gmail.com> References: <20230110005124.1609-1-sj@kernel.org> From: Vlastimil Babka In-Reply-To: <20230110005124.1609-1-sj@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 On 1/10/23 01:51, SeongJae Park wrote: > The standard idiom for getting head page of a given folio is > '&folio->page', but some are wrongly using 'folio_page(folio, 0)' for > the purpose. Fix those to use the idiom. > > Suggested-by: Matthew Wilcox > Signed-off-by: SeongJae Park Thanks, pushed to slab/for-6.3/cleanups > --- > mm/slab.c | 4 ++-- > mm/slub.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/mm/slab.c b/mm/slab.c > index b77be9c6d6b1..a5398676dc60 100644 > --- a/mm/slab.c > +++ b/mm/slab.c > @@ -1389,7 +1389,7 @@ static void kmem_freepages(struct kmem_cache *cachep, struct slab *slab) > > BUG_ON(!folio_test_slab(folio)); > __slab_clear_pfmemalloc(slab); > - page_mapcount_reset(folio_page(folio, 0)); > + page_mapcount_reset(&folio->page); > folio->mapping = NULL; > /* Make the mapping reset visible before clearing the flag */ > smp_wmb(); > @@ -1398,7 +1398,7 @@ static void kmem_freepages(struct kmem_cache *cachep, struct slab *slab) > if (current->reclaim_state) > current->reclaim_state->reclaimed_slab += 1 << order; > unaccount_slab(slab, order, cachep); > - __free_pages(folio_page(folio, 0), order); > + __free_pages(&folio->page, order); > } > > static void kmem_rcu_free(struct rcu_head *head) > diff --git a/mm/slub.c b/mm/slub.c > index 67020074ecb4..d5f20c062004 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2066,7 +2066,7 @@ static void __free_slab(struct kmem_cache *s, struct slab *slab) > if (current->reclaim_state) > current->reclaim_state->reclaimed_slab += pages; > unaccount_slab(slab, order, s); > - __free_pages(folio_page(folio, 0), order); > + __free_pages(&folio->page, order); > } > > static void rcu_free_slab(struct rcu_head *h)