Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1482897pxb; Sun, 22 Aug 2021 19:00:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT3hLl1VAG7ExRNsDsU4y5u39QQRazdQOag2gGqzFkAQ4Ax1FBEX74LmepU1+5LnD6k4RS X-Received: by 2002:a17:906:b183:: with SMTP id w3mr19660207ejy.394.1629684052980; Sun, 22 Aug 2021 19:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629684052; cv=none; d=google.com; s=arc-20160816; b=W8/hfozZCuEXA/NupS3Fydb7VzFl1rvz1uhlE/od0xXUPyJ1M5h4qkOkVepCPN2L4h BSEDNjjRwCMtdwCbdnW3dQxxr03zTBcxreybtjd4yoxG1g7lYBKI3OgIkvW5IV0Fo2Mw tO6TFPhgyLm6Sb7eUViHZ2bXX+h1cr0D0mzRYeK/Crouina2gQv62Jf+Rs3cnWihyv7k 9mRvyQderDQ2x6WHoMQd/7PxWXtnCswZHu/eHcGHRwcIuFWjcmzz6JjXARPtdRZ5zlQq sDGxxROfm94gUCXKf6oN+7/2aTeD8arnlErF1CxNxgpFFru8bbZHWWNb+eiiCTqsKnlc 0pBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=wLsr+R0Fve9ivW+7qc/jUuotRZ00tnDPLOXaKuMzzD4=; b=Y1TVTu1ynsqH6BHBI5SQ1hYGVgQANctQqKDpwx8Tov1K95kO+KQJepwNGvyD5RXoKA euun1O48SDlkvrQFeciCgQjgUGEeDxpbHrTZdb7PeldkwZ8Pdwa/gBJX+UCVMibHlTTA dZWM2PudzZLBdB5PQB9/u8ZUikkXvvgyHPPIBdLPYdxIzO8cvdASrbtfmlxkQbgh1PZx a4IvbdD4HHKOeYhlEvDZaNa8BtIRj/Gt8d/R+zJd7YZyU4W2XlcB0eQ7FiAZnxntaCzC RHgVARrLTc+4yMq5gG59GBckkP0Lp7FpCY1h6B+LGq4VVO8FWI4VfRGJtdLnaQ09+dK1 7pjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RkT7Ab1T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc37si7076006ejc.528.2021.08.22.19.00.30; Sun, 22 Aug 2021 19:00:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RkT7Ab1T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234784AbhHWB6r (ORCPT + 99 others); Sun, 22 Aug 2021 21:58:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233258AbhHWB6q (ORCPT ); Sun, 22 Aug 2021 21:58:46 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BAF0C061575; Sun, 22 Aug 2021 18:58:05 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id n126so17810237ybf.6; Sun, 22 Aug 2021 18:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=wLsr+R0Fve9ivW+7qc/jUuotRZ00tnDPLOXaKuMzzD4=; b=RkT7Ab1TdRuLb9JbE9JxGn14hi9GH2rFmC4TG7zt/+6Ai+lnjwwfRqKVWumQIP1NHz TSwE5cSAXmTimpu03Q5vD3ve+pA3rlI0ZWUKLOq7Mh1//0bcuJ3PP6ZZEC5/jnZIjImj ZXKKvbwiPLSwLLv4pQneuFAMoiDrgjDFCzvM6XPhBAddFaszBV/NNQzXsCgVEWGlMQt4 53/NFAqgHiNJiVdCcDYIugaFG0paytp0T3hs6jBMsSzH64WkXPL88QKUK32ycBqo70xp dKtKHYYFqUXTwqOPO9emQvjbxRor4yx4e4pl/EScwhZE0tNjYn5bLTgmGhyG0Pf7FjWQ 0PFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wLsr+R0Fve9ivW+7qc/jUuotRZ00tnDPLOXaKuMzzD4=; b=l/uJULeYcIuWQt1blH82AruYe1lVAd52sW9lSbMI1LqzK3+eWyZXeBkpLfCF/GfoJH 1pKFr7LsmkuvRZtux2wR+CP99F2LGvCngeJnUJvCuRHPKpcVuYZEqWDlfIR2Fk8jGNV+ rUnyaXbC29Ctw7z8CTrNAC4/3Vt6OCoXvET5Wk/FmbtFHZAMpdCeCM3QoCUaKc+VVGn+ 9vqL7OjwfCXI9qDLGSkjzpJlcCLH2fSw7JYscFqAT06L/ShTF7473hclx6oPz13q4pMv rLZddrroAsjY0RxeoxfadTmAnvsqpTVTAtATjJq/xUQhjZLZRMBCN5MTxPgPJujRf68o balA== X-Gm-Message-State: AOAM5323sJdh0PpDEfH9/+GiLqDqVJQyfx1vuWWKYGYYZZzRiFYviUUQ WKFRCYDBFqszTJlzom3TbfotV6hF8YqqCq+tPgE86CNyBQ1DKQJ/+Rk= X-Received: by 2002:a25:b7c8:: with SMTP id u8mr39872181ybj.268.1629683884334; Sun, 22 Aug 2021 18:58:04 -0700 (PDT) MIME-Version: 1.0 References: <20210820030536.25737-1-yaozhenguo1@gmail.com> <20210822151952.23ca9547316dc34c9f3bd482@linux-foundation.org> In-Reply-To: From: zhenguo yao Date: Mon, 23 Aug 2021 09:57:53 +0800 Message-ID: Subject: Re: [PATCH] hugetlbfs: add hugepages_node kernel parameter To: Matthew Wilcox Cc: mike.kravetz@oracle.com, corbet@lwn.net, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yes, the expanding of hugepages is more elegant. I will change it in the next version. Matthew Wilcox =E4=BA=8E2021=E5=B9=B48=E6=9C=8823=E6= =97=A5=E5=91=A8=E4=B8=80 =E4=B8=8A=E5=8D=886:28=E5=86=99=E9=81=93=EF=BC=9A > > On Sun, Aug 22, 2021 at 03:19:52PM -0700, Andrew Morton wrote: > > On Fri, 20 Aug 2021 11:05:36 +0800 yaozhenguo w= rote: > > > > > We can specify the number of hugepages to allocate at boot. But the > > > hugepages is balanced in all nodes at present. In some scenarios, > > > we only need hugepags in one node. For example: DPDK needs hugepages > > > which is in the same node as NIC. if DPDK needs four hugepags of 1G > > > size in node1 and system has 16 numa nodes. We must reserve 64 hugepa= gs > > > in kernel cmdline. But, only four hugepages is used. The others shoul= d > > > be free after boot.If the system memory is low(for example: 64G), it = will > > > be an impossible task. So, add hugepages_node kernel parameter to spe= cify > > > node number of hugepages to allocate at boot. > > > For example add following parameter: > > > > > > hugepagesz=3D1G hugepages_node=3D1 hugepages=3D4 > > > > > > It will allocate 4 hugepags in node1 at boot. > > > > If were going to do this, shouldn't we permit more than one node? > > > > hugepages_nodes=3D1,2,5 > > I'd think we'd be better off expanding the definition of hugepages. > eg: > > hugepagesz=3D1G hugepages=3D1:4,3:8,5:2 > > would say to allocate 4 pages from node 1, 8 pages from node 3 and 2 > pages from node 5.