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 B2978C25B7A for ; Wed, 22 May 2024 13:41:27 +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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=va6APiLa+lisiJAOdFKW6UmW0lhNBbr+Nud/0mop1QY=; b=FM4AdurwmQgp9N VIQbOhaWgtJZDV/dZoXRQMbqFX+CjAkimPUW/E/K/+WxSimL2ApFE7/QaJgB6OxuIugE1BZBxxiQP iPRV/6S2ium7+ZLPVXCfjSjWwXqbddczm4B+DtQBhmkqyRZh59C144N3vvO8TBoSpjkhhrhW3mK+X 4Jx6RVnBtJg1kCEji0EupXnJYCvVP0KudPaSX5/5BgTbWhZceDe1OnXMq6h2bYo/Kw4e02kCeg1OE 094NLKUSODiOo1iMVAw4rBKTtlQX7eiGL/r/ng1bhW0PKckOl2k/tuM1/hvfwdugGTfrBnhj4EOXL Bhbniz3qK+fJsB0rE/Ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9mDX-000000035Az-0z3N; Wed, 22 May 2024 13:41:19 +0000 Received: from mail.ozlabs.org ([2404:9400:2221:ea00::3]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9mDT-000000035AA-0eKt for linux-arm-kernel@lists.infradead.org; Wed, 22 May 2024 13:41:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1716385269; bh=8/PBiZvFrBuII36XLpoKvRmLCaJ3SFHh2NHdHOARiBY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MGok1PkOYR3nLYgp2li4zheiWLLmwM4Y+kBrvn+tV7pn1awxPXSoeQ54DxwYVsaja 1UWbN6lPGeu3PmJJrNE5EbUBm3eo7ie9TJDDzS9Tpq0JrpWUOXLP7hZL3blpQ6gxdO S5Bz4IcYZh6CDuGTjp5aS2jG4ZgYj0iI+irkVpjI2NizSMSYppN+jR56rb6344idnG qjj4sGLYCEUbV24RTvU82karag+LMEAlbYzrfv3s7aCHJ0da4HnnIMNZT3GlI1XhQn j8gGhZbeBIZ+Ka9piZznvA3dvyIfexnFy0sZUuMdlfFRFCEPMlMdIW+kIaFIXon21V muU/jdiNaS+lA== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Vkss031vVz4wcq; Wed, 22 May 2024 23:41:08 +1000 (AEST) From: Michael Ellerman To: Eric Chanudet , Mike Rapoport Cc: Catalin Marinas , Will Deacon , Baoquan He , Andrew Morton , Zhen Lei , Yajun Deng , Zhang Jianhua , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nick Piggin Subject: Re: [PATCH] arm64: init: override deferred_page_init_max_threads In-Reply-To: References: <20240520231555.395979-5-echanude@redhat.com> Date: Wed, 22 May 2024 23:41:07 +1000 Message-ID: <87plte2ccs.fsf@mail.lhotse> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240522_064115_591932_CAC3A968 X-CRM114-Status: GOOD ( 19.83 ) 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 Eric Chanudet writes: > On Tue, May 21, 2024 at 07:10:07PM +0300, Mike Rapoport wrote: >> (added powerpc folks) Thanks Mike. >> On Mon, May 20, 2024 at 07:15:59PM -0400, Eric Chanudet wrote: >> > This was the behavior prior to making the function arch-specific with >> > commit ecd096506922 ("mm: make deferred init's max threads >> > arch-specific") >> > >> > Architectures can override the generic implementation that uses only one >> > CPU. 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%) | How did you measure this, just some printks in page_alloc_init_late() or something more sophisticated? Just so I can do some comparable measurements. >> > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c >> > index 9b5ab6818f7f..71f5188fe63d 100644 >> > --- a/arch/arm64/mm/init.c >> > +++ b/arch/arm64/mm/init.c >> > @@ -158,6 +158,13 @@ static void __init zone_sizes_init(void) >> > free_area_init(max_zone_pfns); >> > } >> > >> > +#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT >> > +int __init deferred_page_init_max_threads(const struct cpumask *node_cpumask) >> > +{ >> > + return max_t(int, cpumask_weight(node_cpumask), 1); >> > +} >> > +#endif >> > + >> >> Maybe we should make this default and let architectures that want a single >> thread override deferred_page_init_max_threads() to return 1? > > It would affect more archs than I can try this on. Currently, only x86 > (with this change, arm64) return more than one thread. I can test powerpc and we can find someone to test s390. No other arches have it enabled in their defconfig. > I'm happy to send a v2 inverting the logic if you find it preferable. That seems preferable. It's a scalability feature, it makes no sense for the default to be a single thread AFAICS. cheers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel