Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp343004pxp; Wed, 9 Mar 2022 04:13:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/BcK/fUMuHPvalnqT4H87noUmInf93xnyhaqh1h63zCU/CORZ5PslXnY2Lii5bDg2+rnR X-Received: by 2002:a17:902:b287:b0:151:ba95:b4a3 with SMTP id u7-20020a170902b28700b00151ba95b4a3mr22570830plr.110.1646827998679; Wed, 09 Mar 2022 04:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646827998; cv=none; d=google.com; s=arc-20160816; b=fRA8z96X5fZYWzLhegSG4RGT6sSEsh0X3rk6813U/AcFtwN5VOaEnSW1qd6LCin1Fa g9Nec9n4AVX/u+FSKKTQehEi41DOCyrkc2E+Reux9JMbX7lqfTLUBmt0JCamdw3sKVwy 0vPFS2r4SLWrF0Ema451MUHqDoVouRAFFKKyXLZBhKOl4C9QbVkTmUx80OJb6yKEKYTS 5fS5RfsKTSuS3DSYi6aRbzOUiSmq2HNsvlJFrkLlBYoxRlnX2U65igpa56SVlHcV0dsQ Q1ETyLrYhwTGeAdXBjBNmY9k3p7ezq0+2UuwryZzRtDSXaj+j2bbD3gVmsBdWm7xzjiT 8k0w== 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=c/mG7FVN+CfQanteTVX950RtdIdYr+omod/t3Qb0PBc=; b=JOtzoiW90cxS0xfsSxwF6VgHor8Y+dbmI2UalQ/gr+WbW5muIkDNro6dvcbC/3pxwD 9xMWKl0g6Hjv8MO48p32wFL5IFGkGB2NOf+3xtonDJVzcNwh6r8Fg5AIRLptU9EW2KFy sPwkEjnZZlhoZAtd5eGmBns+RhaTuz24Dp4ZM2lO0q1zx02DypXLygMJxcoOM22yB8Q2 RzHETAs13pKBtBvTgtR421btwibFYZ7ZVRkQcYv5fNa23HOnuLW62FLjw9P+k2TAobwE 3Rb04Kbf0oi8sj5WLE7r7EWvjKG5KSiYHjNJWOVhoQ36c8jmSpjrthXGVF9+kpA+2STr 6krw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=UDZWYsTh; 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 o9-20020a170902d4c900b00153004495e1si1916228plg.333.2022.03.09.04.12.58; Wed, 09 Mar 2022 04:13:18 -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=UDZWYsTh; 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 S231934AbiCILcp (ORCPT + 99 others); Wed, 9 Mar 2022 06:32:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232212AbiCILcc (ORCPT ); Wed, 9 Mar 2022 06:32:32 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6A47170D5F for ; Wed, 9 Mar 2022 03:31:31 -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-out2.suse.de (Postfix) with ESMTPS id 44F721F381; Wed, 9 Mar 2022 11:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646825490; 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=c/mG7FVN+CfQanteTVX950RtdIdYr+omod/t3Qb0PBc=; b=UDZWYsThQjgNLTF389lYj6DmeqinJ2jJTtkXo/kBraeF8tEff7NCD6eqyBDchRx2qYdQwe 2hIHXE8F9jt41cG8a8MG5/xL3wyniKIJTONsRHH9wsyG272mwkfULohQJXDayOnPtNLtsR Mk5xluBuFZ8MuN4eO3FgOhEgItizdZw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646825490; 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=c/mG7FVN+CfQanteTVX950RtdIdYr+omod/t3Qb0PBc=; b=21LSMdrFKMcgWskLwwMjMSqkRf6bIc2kbP2t97CmWVX6tisFvZH6Fpw1pvVIoNuXSpE+ep zt1OvQdGs5zsU4BQ== 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 1EDA013B71; Wed, 9 Mar 2022 11:31:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bT/rBhKQKGJmZgAAMHmgww (envelope-from ); Wed, 09 Mar 2022 11:31:30 +0000 Message-ID: Date: Wed, 9 Mar 2022 12:31:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH] mm/slub: remove forced_order parameter in calculate_sizes Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Miaohe Lin Cc: akpm@linux-foundation.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220309092036.50844-1-linmiaohe@huawei.com> <20220309095522.GA1091946@odroid> From: Vlastimil Babka In-Reply-To: <20220309095522.GA1091946@odroid> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 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_PASS,T_SCC_BODY_TEXT_LINE 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 3/9/22 10:55, Hyeonggon Yoo wrote: > On Wed, Mar 09, 2022 at 05:20:36PM +0800, Miaohe Lin wrote: >> Since commit 32a6f409b693 ("mm, slub: remove runtime allocation order >> changes"), forced_order is always -1. Remove this unneeded parameter >> to simplify the code. >> >> Signed-off-by: Miaohe Lin >> --- >> mm/slub.c | 11 ++++------- >> 1 file changed, 4 insertions(+), 7 deletions(-) >> >> diff --git a/mm/slub.c b/mm/slub.c >> index 180354d7e741..7f09901ae6b2 100644 >> --- a/mm/slub.c >> +++ b/mm/slub.c >> @@ -4038,7 +4038,7 @@ static void set_cpu_partial(struct kmem_cache *s) >> * calculate_sizes() determines the order and the distribution of data within >> * a slab object. >> */ >> -static int calculate_sizes(struct kmem_cache *s, int forced_order) >> +static int calculate_sizes(struct kmem_cache *s) >> { >> slab_flags_t flags = s->flags; >> unsigned int size = s->object_size; >> @@ -4142,10 +4142,7 @@ static int calculate_sizes(struct kmem_cache *s, int forced_order) >> size = ALIGN(size, s->align); >> s->size = size; >> s->reciprocal_size = reciprocal_value(size); >> - if (forced_order >= 0) >> - order = forced_order; >> - else >> - order = calculate_order(size); >> + order = calculate_order(size); >> >> if ((int)order < 0) >> return 0; >> @@ -4181,7 +4178,7 @@ static int kmem_cache_open(struct kmem_cache *s, slab_flags_t flags) >> s->random = get_random_long(); >> #endif >> >> - if (!calculate_sizes(s, -1)) >> + if (!calculate_sizes(s)) >> goto error; >> if (disable_higher_order_debug) { >> /* >> @@ -4191,7 +4188,7 @@ static int kmem_cache_open(struct kmem_cache *s, slab_flags_t flags) >> if (get_order(s->size) > get_order(s->object_size)) { >> s->flags &= ~DEBUG_METADATA_FLAGS; >> s->offset = 0; >> - if (!calculate_sizes(s, -1)) >> + if (!calculate_sizes(s)) >> goto error; >> } >> } > > Looks good to me. > > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Thanks both, added to slab-next > Thanks! > >> -- >> 2.23.0 > > -- > Thank you, You are awesome! > Hyeonggon :-)