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 B6DD3C25B74 for ; Tue, 21 May 2024 16:12:13 +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=pU5P0sFiD7eFaknJXgcgrD91AvyYHX3cj/kLu6BKm8E=; b=pHenCryS4tvJEm JAg/JtrlqGSSoxojK5JiD6Jm6HJhEdEi1NZn9tQEf3OHLOpKjx+Ld7ymgkM58Y4fA1TXly0KFRD6m xv7UDk9GEjC2EDpoExlbBxHY7AaX7VlYaKh5p/6WZ1tXK4crRoISKAQdhuWexQewtKz6liKm16a5D VNpoJRyPDidG23DV+S2u7zXn0Bwy182eVZkBV+wj6nqI2xQ/EguNLbTo9NbqRBireSbEGX2QjoiiE p8RTUxRtKUtaaY5x2UeblZtahjolOByrMVGHfyrKfhp/RzeBH2m6FIt23jqf4lEzf5vZh+VzbGnAL C75suHZN4wUn2U2hC3IA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9S5o-00000000Sxz-3AbV; Tue, 21 May 2024 16:12:00 +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 1s9S5l-00000000SxI-3MlZ for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2024 16:11:59 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9052D61BFE; Tue, 21 May 2024 16:11:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21FCAC2BD11; Tue, 21 May 2024 16:11:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716307916; bh=PVda4OgjthlCL7ySbYlgXdAxVK5l0MruHqLonyOdoT4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PFFpTFpKbes/L275L+fKRvqYwGC7FJVCHI2Dgjpaedk9stHFAJ52yzIQ7p7/s/kmn cxcfQm9uI5ATr4MJ/8GT0v++mwx9wqKxFm4PWs4eU/czQsHJfujZmbzX8NKvFzsQpM IvRiGqILJw4mafA3347JsBec0mSjyGgMXmMFnbrcO4KpgMrjmhV8/VdN0wHJ3qwFEa 8eqikN/rqxMZgCAYU5Lei7QES0ZB0nBHzHWHzvdif+QJk5FyZWICWHC0th73Q49Wn7 JKHeSFC1wfQeDJIDW5+Qoh5M0Tdp6L9qBBR2Kjhe4XouylIuOqdiOb7TeFWr2XZ9KJ g//UCA5wx8+Aw== Date: Tue, 21 May 2024 19:10:07 +0300 From: Mike Rapoport To: Eric Chanudet 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 , Michael Ellerman Subject: Re: [PATCH] arm64: init: override deferred_page_init_max_threads Message-ID: References: <20240520231555.395979-5-echanude@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240520231555.395979-5-echanude@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240521_091158_252057_C8AA5583 X-CRM114-Status: GOOD ( 18.88 ) 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 (added powerpc folks) 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%) | > > Signed-off-by: Eric Chanudet > --- > arch/arm64/mm/init.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > 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? > int pfn_is_map_memory(unsigned long pfn) > { > phys_addr_t addr = PFN_PHYS(pfn); > -- > 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