Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4948575rdb; Tue, 12 Dec 2023 14:15:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDGHjuIwcNIqWEYTEA3BJhlFsv9nSN7XPKXJ8xKrres6rW4M+OF+m2oR9D/f/G4B1mLX8l X-Received: by 2002:a17:902:b946:b0:1d2:ecd9:9088 with SMTP id h6-20020a170902b94600b001d2ecd99088mr3236169pls.42.1702419302655; Tue, 12 Dec 2023 14:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702419302; cv=none; d=google.com; s=arc-20160816; b=LYz29ZQx1mfg0l3Uu/w+TSkucOht93V9lLnFTzxldaAWKwkoIFAVf/LwLIBS5wVgS/ Wkz4frrtMbeIxkEbKx3gEWr7tockcaJ6G/WB7MBqPUnA1cQLOPL85VemUvCM4ApRximq TLEOVo1Dmc1n+a67XErxx+7lta709OfOTGNVyGW9pv+clh/i9LgSVDIqwckeoWXqmVXG mpnPav/hfD0KUZc62n6D8f7oea99S+YjsXOB+u7KSQ9KJE+rhfH8WayTptkxwzss9Krx XEGfc1sCFrCJqZvJBrYmTGuL9uepfDMdwESumQGwrMdyM7E2izhU7IlLNWLGPrTKO1ve HiWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=ai/6oa+3xTjAhJGHry+JbJcf+dfhAKDUCjsENuNGuQQ=; fh=MfVP3rO/hpnI1Djdakq8mzrXmt2J1mlCbHmvP8IlwB8=; b=nNJT6xvsj3KqQy80hsKYjUTbR3k8AIZauoftp/vNf7BInBFWGmfT2epXjPiwPbNChN qkBnyi5y/wcTJh/kksipddMOdD27/LSVoJuBWE1LtP5FKRehgNU+zdVY0CEBOJC8wIyO NH/vkkXqMdfCGbiYRFQdOmb/hIzCuqqMCA0EdxQRgLLPWSMXVMT+GP66NV1U+229HZ6R 5YFf/mSv5lIWHiUY1I3xaJioJy0IO01AqDSaUfB7dVd/hnAaaHXz6JSTdXhifa3FwlKH 573JJa+7KBWPBGqVZSSN+G0vDhFAi+bztyKUUoL3YFbaXZ4RXQgh9IicX+xYPugzr2Uu 3EYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SDVhH1j5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id c11-20020a170902d48b00b001cfb4a89e6esi8425535plg.145.2023.12.12.14.15.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 14:15:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SDVhH1j5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1047980A8530; Tue, 12 Dec 2023 14:15:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232371AbjLLWOr (ORCPT + 99 others); Tue, 12 Dec 2023 17:14:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231499AbjLLWOq (ORCPT ); Tue, 12 Dec 2023 17:14:46 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5E609C for ; Tue, 12 Dec 2023 14:14:52 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1cc79f73e58so16835ad.1 for ; Tue, 12 Dec 2023 14:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702419292; x=1703024092; darn=vger.kernel.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=ai/6oa+3xTjAhJGHry+JbJcf+dfhAKDUCjsENuNGuQQ=; b=SDVhH1j5ypoRpu/ZYEY0JntccJr4ZS8uOaF2lJFEBqzOpAnn/pDYQykwTUFqR1aqe6 9wCmlie0S1/2SdX8RY5K9k8CHsXfeINnniNC0BhYhuIV8RBHbcPqrKFGcN0dluGleFIy EW1ADTzcFUMnXaaBHA01mMGE0KuDHEaDpJxbYDvKemugBuVvNXNKt1U2ej9+3ozyeyxP YM+8DSOjBGfbaSJmkNpZ4qVIM7uCCGMh3+oO7pFq6UfVmNKeI2qNfPmbOIlOBBXubRI6 24CGOfpqaxTRiCnox3Kbuf6Ywf4fyf+YrSA8d1y9U/ZrDJW2I/s5l2S1QotstjCD/Wg8 o2VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702419292; x=1703024092; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ai/6oa+3xTjAhJGHry+JbJcf+dfhAKDUCjsENuNGuQQ=; b=b/eMs/JYTUjS0QcBZplLK7oha1eVTulJ8Jmrmjy2i0RR1pTTqWZi9U6oy3K9XQfrr6 +IKGPGAo/A/a/6nJYP7ICXLXvM00X5gxZ27ts70FvsZs/AsA9aiIkthVNeeQ5d+1TYZg 3SEf08jd/xPmCCdYil5XWXRRMrNxhdGED/SZkvIESl7YJoNU4zXGbMqMZnkbr+PA1ma2 3ylJhQwck73DhOHkUIBgYeA2j+ui1hkQpA1DV/q0Gos8C2a4QTJ9WYI20GTKfL9hKuTS 93KyljYVo9W98J3JywfS80CZBDbsjXHPzxShZiMtlBw8SW8EIAdsVDTQRrdHiAYZez80 sTzQ== X-Gm-Message-State: AOJu0Yy5kgxgBELhrfmHiMOU2bBwOlDX6/U4OZAiMHEhokREFSLiuhzF EvksPvMBon8ro+TbK9NSaRvMmA== X-Received: by 2002:a17:902:dac2:b0:1cc:6fa6:fb4a with SMTP id q2-20020a170902dac200b001cc6fa6fb4amr962337plx.22.1702419292041; Tue, 12 Dec 2023 14:14:52 -0800 (PST) Received: from [2620:0:1008:15:fc81:e0ce:797b:3b4b] ([2620:0:1008:15:fc81:e0ce:797b:3b4b]) by smtp.gmail.com with ESMTPSA id e10-20020aa7980a000000b006cef6293132sm6394390pfl.101.2023.12.12.14.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 14:14:51 -0800 (PST) Date: Tue, 12 Dec 2023 14:14:49 -0800 (PST) From: David Rientjes To: Gang Li cc: David Hildenbrand , Mike Kravetz , Muchun Song , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ligang.bdlg@bytedance.com Subject: Re: [RFC PATCH v2 0/5] hugetlb: parallelize hugetlb page init on boot In-Reply-To: <20231208025240.4744-1-gang.li@linux.dev> Message-ID: <996ba32c-78f0-1807-5e64-af5841a820e7@google.com> References: <20231208025240.4744-1-gang.li@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 12 Dec 2023 14:15:00 -0800 (PST) On Fri, 8 Dec 2023, Gang Li wrote: > Hi all, hugetlb init parallelization has now been updated to v2. > > To David Hildenbrand: padata multithread utilities has been used to reduce > code complexity. > > To David Rientjes: The patch for measuring time will be separately included > in the reply. Please test during your free time, thanks. > I'd love to, but what kernel is this based on? :) I can't get this to apply to any kernels that I have recently benchmarked with. > # Introduction > Hugetlb initialization during boot takes up a considerable amount of time. > For instance, on a 2TB system, initializing 1,800 1GB huge pages takes 1-2 > seconds out of 10 seconds. Initializing 11,776 1GB pages on a 12TB Intel > host takes 65.2 seconds [1], which is 17.4% of the total 373.78 seconds boot > time. This is a noteworthy figure. > > Inspired by [2] and [3], hugetlb initialization can also be accelerated > through parallelization. Kernel already has infrastructure like > padata_do_multithreaded, this patch uses it to achieve effective results > by minimal modifications. > > [1] https://lore.kernel.org/all/783f8bac-55b8-5b95-eb6a-11a583675000@google.com/ > [2] https://lore.kernel.org/all/20200527173608.2885243-1-daniel.m.jordan@oracle.com/ > [3] https://lore.kernel.org/all/20230906112605.2286994-1-usama.arif@bytedance.com/ > > # Test result > test no patch(ms) patched(ms) saved > ------------------- -------------- ------------- -------- > 256c2t(4 node) 2M 2624 956 63.57% > 256c2t(4 node) 1G 2679 1582 40.95% > 128c1t(2 node) 2M 1788 684 61.74% > 128c1t(2 node) 1G 3160 1618 48.80% > > # Change log > Changes in v2: > - Reduce complexity with `padata_do_multithreaded` > - Support 1G hugetlb > > v1: > - https://lore.kernel.org/all/20231123133036.68540-1-gang.li@linux.dev/ > - parallelize 2M hugetlb initialization with workqueue > > Gang Li (5): > hugetlb: code clean for hugetlb_hstate_alloc_pages > hugetlb: split hugetlb_hstate_alloc_pages > padata: dispatch works on different nodes > hugetlb: parallelize 2M hugetlb allocation and initialization > hugetlb: parallelize 1G hugetlb initialization > > include/linux/hugetlb.h | 2 +- > include/linux/padata.h | 2 + > kernel/padata.c | 8 +- > mm/hugetlb.c | 201 +++++++++++++++++++++++++++------------- > mm/mm_init.c | 1 + > 5 files changed, 148 insertions(+), 66 deletions(-) > > -- > 2.30.2 > >