Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3189948lqo; Tue, 21 May 2024 09:12:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/CBeSyYx8q5r1oCy/Yr4wKDfM+sWobMGGlWNAvQyBGG1SZXEtXjNIrsQ/wfAGd8/8SIiGTjF8vodUvT3f1OcXnStISTJv0Kf/ULADqQ== X-Google-Smtp-Source: AGHT+IE0hlAu5jYZpsdOh6T0v1Wdm+qLwoD1+KUXLIkrXADriNN0b9qLszt1kQPK2Szfysz5QT+j X-Received: by 2002:a17:906:ad97:b0:a59:c833:d275 with SMTP id a640c23a62f3a-a5a2d58a4e7mr2066410966b.30.1716307925354; Tue, 21 May 2024 09:12:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716307925; cv=pass; d=google.com; s=arc-20160816; b=vJ87K/xM4ry/b7l/HqZBK1Ok9x5zC3jyzmaxWLShvQU5sMvSDFsMD77w04S2JsFF6Q SmpmbGIiDCJzmXjSoSKZngAEwCRn7ljkh9dkdYRFMO1JEdPOHPAE02sDxS4Z8JI4LW5w N2szKdAJCxR1m6Vkq5JpOijSGEaQXgZEn8w/rDVkQwLtKRJPRsR0ejwm5YF5aUTiFrIq qWLxQ30bynWoBXmG/QuXZoSwtDR8w/8QY/FWOt6k2/QM2+1GfDCl9C+M7wyKBjCXPdgo 2g7pSTXQwhdAiGLlL08XeVTYbLmsLw09qWMy0u9SBZa8OoeAaHuBnBGdWtdHwk4Z9QMx 2KCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iv2/hpBNxo27IJmPI6UX7EuGLZa9oPLsgoKrjCnEwAQ=; fh=2FH1bzj1UK6nZZSaWaD5pwUNAMT2bYKVSrockkiGRHg=; b=v6TMwG4JupPf6vMC+9eeGIdLqiEAVsasxwvPZNJ2h9RRLZW82obM5rj5V0OCSW+2v1 ++0FoG+4xWtgm4RYbmPzsF4CyoH9yWXV3HBNc5lQ+0X6Nu5z6R26jMYhZecg99tQU7oU rqFHD0dO1awzAuX019QgIfF2JPeLRdWXg12zsk64xnzQGWp0ccjWVJI7OEQeaC0/kqRM HKNqalxKu+K9OfbCuopVGEqC8/Caee/1KOa3wqmQvuhHtuM4zp7FWW2INER8jnbyB9Lc i1xQKEkWRPBc5yy9mJ/RXp5GX/UcvOjYkg4H3G93Gh9H44mgef9HfLMUiN+gKYkUJRoa rasQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PFFpTFpK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba28afsi1387177966b.525.2024.05.21.09.12.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 09:12:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PFFpTFpK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 184BD1F22198 for ; Tue, 21 May 2024 16:12:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 930F11CD13; Tue, 21 May 2024 16:11:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PFFpTFpK" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B727A182DB for ; Tue, 21 May 2024 16:11:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716307916; cv=none; b=Ua3FPhNPT4P+e1Mc1s1Wo9yCX2QLtrd213VJYgaEiEYwT85yQ9VvqWEMZjTCT140kiFFqQZa2929I0R1xMrhqoENC/1RsdrLDxqrivnyFZ8im+jjjou8XFlDG1bGvc+JxoMvEPHJR1p03PGZtHuTD5JGGdhfDNB38YmuY+mbkKk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716307916; c=relaxed/simple; bh=PVda4OgjthlCL7ySbYlgXdAxVK5l0MruHqLonyOdoT4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BLbtsptiCM3Wr+a1TO2mCvL9YbP40H0iQlMKzdG5i9UcnXnSFFAJINszFGRLLWltpuEMheF0ncGNe0wW+RIXbDULbwZ7rn6AigiFEsdmdYmrfIUH2V9nEbCV6Ir2nuMJ+OH96IK4Na5iyWthw+Cetx3126O8ZOX/SmGpNClc3tw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PFFpTFpK; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240520231555.395979-5-echanude@redhat.com> (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.