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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A0F2C25B75 for ; Thu, 23 May 2024 15:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ol0vGKjqhdIC3rZY0GZ53KHDn8ogjqbXPKu3U1Yh7Jc=; b=aiglXWH98OTRXm bsaqQ1M5kzhieyKWFLks+ppJ7OMN5Ng1RlnGu4GaSbJ9euTHw/MVgW2lGeqYi06GwJWF5LL4/LjWM 9c5dkQiIi1+DCGJWv8Xr0Nz9TlnPOBAq0k6BICpY72PwU2yNqfAiVKt8Ov/jbOaTw6Qzblk/7+6a2 odoABS5IqYGEymZDFPDMLXY2uqpqZOvuP6UJypJVQsDIa9mCF0TS9m6V5l+R1+8EjYTn3BtStosBG 9xeyYEvJ9uV9Zaijda+5+R9XxkFfGzh2pELBgMdx+zzAyVJXjIfuZRIwazokI/IV7qIWJehsAIjed Nj54BnK0Ezj4JLnv8nVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sA9x6-00000006aBp-24Ci; Thu, 23 May 2024 15:01:56 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sA9x2-00000006a8O-3tsG for linux-arm-kernel@lists.infradead.org; Thu, 23 May 2024 15:01:54 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A23DB62853; Thu, 23 May 2024 15:01:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08F92C32781; Thu, 23 May 2024 15:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716476511; bh=vjt+cmVcTd/Pb33Pdy5i3IcyArhpy6Hbpole/X6gRcQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dsR/erEGWqTrpUYgBr8bhaGLVokjd8cGzstRgXhQ2zvCED20LY5mA0MnJl4aB4HJc La4XclaMTB3PLF5t0NJgcHpcBikZatrx9W4WY9ygCpu1jkJvp4V89pXQqDXr566CAL gTkjCgb0GVECIIBAC7rE9Vcc1BNWnE1kQBSn89vMljOj6PktOdWsJ4kFOSyrO2FQOr YJRZELiVBmkHdkK9xYQW0SBB5IY9tYW95xCXMJLE7tBB8hjy9m3a/szl7vBydpvJgo 1cI8r/UjUvpLRpRRJc65nGhaaJ0KJTCyhyGWqb4hhOTwLwf4mJQ8SN2F9cBm49eRrj 334Kp8GdszKmQ== Date: Thu, 23 May 2024 17:59:57 +0300 From: Mike Rapoport To: Eric Chanudet Cc: Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrew Morton , Baoquan He , Michael Ellerman , Nick Piggin , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2] mm/mm_init: use node's number of cpus in deferred_page_init_max_threads Message-ID: References: <20240522203758.626932-4-echanude@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240522203758.626932-4-echanude@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240523_080153_096507_F4C348B8 X-CRM114-Status: GOOD ( 24.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 22, 2024 at 04:38:01PM -0400, Eric Chanudet wrote: > x86_64 is already using the node's cpu as maximum threads. Make that the > default for all archs setting DEFERRED_STRUCT_PAGE_INIT. > > This returns to the behavior prior making the function arch-specific > with commit ecd096506922 ("mm: make deferred init's max threads > arch-specific"). > > Signed-off-by: Eric Chanudet > > --- > Setting DEFERRED_STRUCT_PAGE_INIT and testing on a few arm64 platforms > shows faster deferred_init_memmap completions: > > | | x13s | SA8775p-ride | Ampere R137-P31 | Ampere HR330 | > | | Metal, 32GB | VM, 36GB | VM, 58GB | Metal, 128GB | > | | 8cpus | 8cpus | 8cpus | 32cpus | > |---------|-------------|--------------|-----------------|--------------| > | threads | ms (%) | ms (%) | ms (%) | ms (%) | > |---------|-------------|--------------|-----------------|--------------| > | 1 | 108 (0%) | 72 (0%) | 224 (0%) | 324 (0%) | > | cpus | 24 (-77%) | 36 (-50%) | 40 (-82%) | 56 (-82%) | > > - v1: https://lore.kernel.org/linux-arm-kernel/20240520231555.395979-5-echanude@redhat.com > - Changes since v1: > - Make the generic function return the number of cpus of the node as > max threads limit instead overriding it for arm64. > - Drop Baoquan He's R-b on v1 since the logic changed. > - Add CCs according to patch changes (ppc and s390 set > DEFERRED_STRUCT_PAGE_INIT by default). > > arch/x86/mm/init_64.c | 12 ------------ > mm/mm_init.c | 2 +- > 2 files changed, 1 insertion(+), 13 deletions(-) > > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > index 7e177856ee4f..adec42928ec1 100644 > --- a/arch/x86/mm/init_64.c > +++ b/arch/x86/mm/init_64.c > @@ -1354,18 +1354,6 @@ void __init mem_init(void) > preallocate_vmalloc_pages(); > } > > -#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT > -int __init deferred_page_init_max_threads(const struct cpumask *node_cpumask) > -{ > - /* > - * More CPUs always led to greater speedups on tested systems, up to > - * all the nodes' CPUs. Use all since the system is otherwise idle > - * now. > - */ > - return max_t(int, cpumask_weight(node_cpumask), 1); > -} > -#endif > - > int kernel_set_to_readonly; > > void mark_rodata_ro(void) > diff --git a/mm/mm_init.c b/mm/mm_init.c > index f72b852bd5b8..e0023aa68555 100644 > --- a/mm/mm_init.c > +++ b/mm/mm_init.c > @@ -2126,7 +2126,7 @@ deferred_init_memmap_chunk(unsigned long start_pfn, unsigned long end_pfn, > __weak int __init If s390 folks confirm there's no regression for them I think we can make this static. > deferred_page_init_max_threads(const struct cpumask *node_cpumask) > { > - return 1; > + return max_t(int, cpumask_weight(node_cpumask), 1); > } > > /* Initialise remaining memory on a node */ > -- > 2.44.0 > -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel