From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85CBFC2B9F8 for ; Tue, 25 May 2021 11:55:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0BC7E6140F for ; Tue, 25 May 2021 11:55:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BC7E6140F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9F2E76B006E; Tue, 25 May 2021 07:54:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 97BEF6B0070; Tue, 25 May 2021 07:54:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F5996B0071; Tue, 25 May 2021 07:54:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id 4D3906B006E for ; Tue, 25 May 2021 07:54:59 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EB807181AEF31 for ; Tue, 25 May 2021 11:54:58 +0000 (UTC) X-FDA: 78179597076.30.35E61F8 Received: from outbound-smtp15.blacknight.com (outbound-smtp15.blacknight.com [46.22.139.232]) by imf11.hostedemail.com (Postfix) with ESMTP id 05D6920007E6 for ; Tue, 25 May 2021 11:54:47 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp15.blacknight.com (Postfix) with ESMTPS id E435E1C3D66 for ; Tue, 25 May 2021 12:54:53 +0100 (IST) Received: (qmail 30068 invoked from network); 25 May 2021 11:54:53 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.23.168]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 25 May 2021 11:54:53 -0000 Date: Tue, 25 May 2021 12:54:51 +0100 From: Mel Gorman To: Vlastimil Babka Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim , Sebastian Andrzej Siewior , Thomas Gleixner , Jesper Dangaard Brouer , Peter Zijlstra , Jann Horn Subject: Re: [RFC 05/26] mm, slub: extract get_partial() from new_slab_objects() Message-ID: <20210525115451.GO30378@techsingularity.net> References: <20210524233946.20352-1-vbabka@suse.cz> <20210524233946.20352-6-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210524233946.20352-6-vbabka@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 05D6920007E6 Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.232 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none X-Rspamd-Server: rspam03 X-Stat-Signature: 58t6fm4e753pyhuoybkhgdxhphdr54cj X-HE-Tag: 1621943687-13966 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, May 25, 2021 at 01:39:25AM +0200, Vlastimil Babka wrote: > The later patches will need more fine grained control over individual actions > in ___slab_alloc(), the only caller of new_slab_objects(), so this is a first > preparatory step with no functional change. > > Signed-off-by: Vlastimil Babka > > @@ -2748,6 +2743,10 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, > goto redo; > } > > + freelist = get_partial(s, gfpflags, node, c); > + if (freelist) > + goto check_new_page; > + > freelist = new_slab_objects(s, gfpflags, node, &c); > > if (unlikely(!freelist)) { It's a nit-pick, but why did you not simply do something like this instead of the goto? freelist = get_partial(s, gfpflags, node, c); if (!freelist) freelist = new_slab_objects(s, gfpflags, node, &c); if (unlikely(!freelist)) ... If nothing else, the label may be misleading because c->page may not be new. -- Mel Gorman SUSE Labs