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=ham 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 366C3C2B9F8 for ; Tue, 25 May 2021 11:54:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12DDA61413 for ; Tue, 25 May 2021 11:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232093AbhEYL4Z (ORCPT ); Tue, 25 May 2021 07:56:25 -0400 Received: from outbound-smtp57.blacknight.com ([46.22.136.241]:42627 "EHLO outbound-smtp57.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231770AbhEYL4Y (ORCPT ); Tue, 25 May 2021 07:56:24 -0400 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp57.blacknight.com (Postfix) with ESMTPS id E8318FAC00 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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