Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp797966lql; Mon, 11 Mar 2024 19:26:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9uaxXYRHVe9Ft1zU4DFmda/n4mR/gseqs4+UU3Ok3RHa8LrsUIHIQPLDzafEH1SVdENA/icEYaBdgTJseJsUW2BNVeT8zQq7jyHPXnA== X-Google-Smtp-Source: AGHT+IFAqfwTuJgF7x26Hguzm4Q7RvNVAA/5qNhMMZgCweM8WW4HKQ0RLG2sNRWlChWyfsycU7e/ X-Received: by 2002:a05:651c:1546:b0:2d2:d737:568c with SMTP id y6-20020a05651c154600b002d2d737568cmr5472400ljp.49.1710210388288; Mon, 11 Mar 2024 19:26:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710210388; cv=pass; d=google.com; s=arc-20160816; b=X+c1VMvf5hQ92HGBfUGSGNcjoTknjGiIcZ68EkFl4kZLFUEQCJ2JyzNjKkhrWJuVA+ a/0XtLEZ2uRRUiVWT3Hm3Q7iP46NGJnguNa7v3dVKcdZ+LpSCdwABU6W+qpEfHQCZq5P 8239Hzl3z5bBA1g7SM0CusOHPgLcyZozJq3G7PwvHoO3wvKN/7eoze2oeUvFHraLp2n9 VCpBCSh/477Us20tjCJEfh6/ILBND1jHOROxWUVxVBt80OwLH8IbH8vl4MZcA4BC/Tk9 uF6mw+UUgYy/GIuzfZrWcYK4qGfNbBSJR7SNfHfrAwQlLR86BHV1pxXNe9adis+R6dwQ MXOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=j8bXqps/luirsJ8RKYPi+CeFj7wz4+E9180FYv/b4Y4=; fh=MXGmJ648mhE0nCg4XocPPenAVykMe/6LToJ3dw56kA0=; b=Bb2xWgCvitfetdLE8uff8OZNccp0SP5GsOakFw6vKd5hOGq6OmlxEl2b3Fd6Lusw2Q kVhExWdcllUnV9vdiwJ+doHZc+8oQgkooyXtaMiY/3EwtSa6aW4ZqPmDBJ264DPNdMUG 1p38Q3GWG8yhbGMXjVEJukcXGZNq+RUVHlkzZtoNpLWs90E9yDkThwLuGSt2N46w+SqU J5VPIkr2I5hhzFG4nK3Q9oAFJOhRjUfDmCbj9KzB8fBdEcNofCfUQN3jPIzwQSICQajx 6tZQHKFUJv3phnRknHBfk+AVEfyxgo2uJ3zQN2SxDJy5TG6rSX8mCL5CmZzVpP76SOB0 L4fA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=VOWFjIxO; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-99768-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99768-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id et9-20020a056402378900b0056850941b87si2022258edb.322.2024.03.11.19.26.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 19:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99768-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=VOWFjIxO; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-99768-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99768-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 F0D8E1F220E1 for ; Tue, 12 Mar 2024 02:26:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13AFB6FB9; Tue, 12 Mar 2024 02:26:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="VOWFjIxO" Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (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 50B10811 for ; Tue, 12 Mar 2024 02:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710210381; cv=none; b=HNWm+KII2huSqCWWfUiS8qEOqLhvni8RBRmzctzuUZaRoOkNWPAZ5qRmq6ODtAKj7IDGw8vBrN8N1HVcWDQ0gtwRMOlPq1NkYXhU9u6gxjr06ovY5VXyRMjvVC2Tv4Z5HXyLosHBIEO7cbAzPvSXWZSobhzEEtw+LgCZf0JMOAE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710210381; c=relaxed/simple; bh=BOG56Hxgu8xy+GFwdKiAEcsHH2X1Tu4706t+CFcuHqM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=J0+LKJ5+QKhydZ9ITPvZX3qYSs1M2VICqTudqZDmrC32Ar6P1oCngFauybRhdq8YB6fS04tdcsics1KWmWCycvREJN5V6NGoOJtqutOmIKUCa6jZ5Fx0EtPu1IUIJ8NUF6WArxWG4hiL+Osy/5OxWOSl0DUK26r8O+Q17/7cPjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=VOWFjIxO; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <1c6f90d0-ef3a-4ea4-8de6-ad93c93ed3da@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1710210377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j8bXqps/luirsJ8RKYPi+CeFj7wz4+E9180FYv/b4Y4=; b=VOWFjIxO+KLG+Y2DQgdeXdXmOQt01YCZZIl71j/ooGiYMy1/iZXvWcFbfBJ3i+d1Wb8kHL kxV/sKbb2G2BYvI7ZmvdKpeqasTVvfKLrva39nlG3UkkEX6yJ03kot/SC4l40PI7ABnp6t 6JmikJQvMbZGhNIdUJI7gmlC3ka1voY= Date: Tue, 12 Mar 2024 10:26:07 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v6 8/8] hugetlb: parallelize 1G hugetlb initialization Content-Language: en-US To: Daniel Jordan Cc: Andrew Morton , David Hildenbrand , David Rientjes , Muchun Song , Tim Chen , Steffen Klassert , Jane Chu , "Paul E . McKenney" , Randy Dunlap , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ligang.bdlg@bytedance.com References: <20240222140422.393911-1-gang.li@linux.dev> <20240222140422.393911-9-gang.li@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Gang Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Thanks for your review :) On 2024/3/9 01:35, Daniel Jordan wrote: > On Thu, Feb 22, 2024 at 10:04:21PM +0800, Gang Li wrote: >> Optimizing the initialization speed of 1G huge pages through >> parallelization. >> >> 1G hugetlbs are allocated from bootmem, a process that is already >> very fast and does not currently require optimization. Therefore, >> we focus on parallelizing only the initialization phase in >> `gather_bootmem_prealloc`. >> >> Here are some test results: >> test case no patch(ms) patched(ms) saved >> ------------------- -------------- ------------- -------- >> 256c2T(4 node) 1G 4745 2024 57.34% >> 128c1T(2 node) 1G 3358 1712 49.02% >> 12T 1G 77000 18300 76.23% > > Another great improvement. > >> +static void __init gather_bootmem_prealloc_parallel(unsigned long start, >> + unsigned long end, void *arg) >> +{ >> + int nid; >> + >> + for (nid = start; nid < end; nid++) >> + gather_bootmem_prealloc_node(nid); >> +} >> + >> +static void __init gather_bootmem_prealloc(void) >> +{ >> + struct padata_mt_job job = { >> + .thread_fn = gather_bootmem_prealloc_parallel, >> + .fn_arg = NULL, >> + .start = 0, >> + .size = num_node_state(N_MEMORY), >> + .align = 1, >> + .min_chunk = 1, >> + .max_threads = num_node_state(N_MEMORY), >> + .numa_aware = true, >> + }; >> + >> + padata_do_multithreaded(&job); >> +} > > Looks fine from the padata side. > > Acked-by: Daniel Jordan # padata