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 A71CEC433E0 for ; Thu, 21 Jan 2021 10:03:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5668E238EE for ; Thu, 21 Jan 2021 10:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729117AbhAUKDd (ORCPT ); Thu, 21 Jan 2021 05:03:33 -0500 Received: from gentwo.org ([3.19.106.255]:52768 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728469AbhAUKCp (ORCPT ); Thu, 21 Jan 2021 05:02:45 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?