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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 923B0C433DB for ; Thu, 21 Jan 2021 10:02:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E3BE323975 for ; Thu, 21 Jan 2021 10:01:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3BE323975 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 184366B0005; Thu, 21 Jan 2021 05:01:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 15A586B0007; Thu, 21 Jan 2021 05:01:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06FD66B0008; Thu, 21 Jan 2021 05:01:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id E17426B0005 for ; Thu, 21 Jan 2021 05:01:58 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A35228249980 for ; Thu, 21 Jan 2021 10:01:58 +0000 (UTC) X-FDA: 77729341116.04.shame60_5a08e1027562 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 7550280142EB for ; Thu, 21 Jan 2021 10:01:58 +0000 (UTC) X-HE-Tag: shame60_5a08e1027562 X-Filterd-Recvd-Size: 2388 Received: from gentwo.org (gentwo.org [3.19.106.255]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 Jan 2021 10:01:57 +0000 (UTC) Received: by gentwo.org (Postfix, from userid 1002) id 5E6563F04E; Thu, 21 Jan 2021 10:01:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 5C1C43EFF6; Thu, 21 Jan 2021 10:01:57 +0000 (UTC) Date: Thu, 21 Jan 2021 10:01:57 +0000 (UTC) From: Christoph Lameter X-X-Sender: cl@www.lameter.com To: Bharata B Rao cc: Vincent Guittot , linux-kernel , linux-mm@kvack.org, David Rientjes , Joonsoo Kim , Andrew Morton , guro@fb.com, vbabka@suse.cz, shakeelb@google.com, Johannes Weiner , aneesh.kumar@linux.ibm.com Subject: Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order In-Reply-To: <20210121053003.GB2587010@in.ibm.com> Message-ID: References: <20201118082759.1413056-1-bharata@linux.ibm.com> <20210121053003.GB2587010@in.ibm.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Thu, 21 Jan 2021, Bharata B Rao wrote: > > The problem is that calculate_order() is called a number of times > > before secondaries CPUs are booted and it returns 1 instead of 224. > > This makes the use of num_online_cpus() irrelevant for those cases > > > > After adding in my command line "slub_min_objects=36" which equals to > > 4 * (fls(num_online_cpus()) + 1) with a correct num_online_cpus == 224 > > , the regression diseapears: > > > > 9 iterations of hackbench -l 16000 -g 16: 3.201sec (+/- 0.90%) > > Should we have switched to num_present_cpus() rather than > num_online_cpus()? If so, the below patch should address the > above problem. There is certainly an initcall after secondaries are booted where we could redo the calculate_order? Or the num_online_cpus needs to be up to date earlier. Why does this issue not occur on x86? Does x86 have an up to date num_online_cpus earlier?