Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1384242pxb; Sun, 22 Aug 2021 15:20:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi5cvZbJNtkfcW0pjBsc+VxaVISwTPGz4+Fx3qBHLaqv4FG7EICfnNxdB48GctXZQwsVJI X-Received: by 2002:a92:2002:: with SMTP id j2mr1383683ile.37.1629670850596; Sun, 22 Aug 2021 15:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629670850; cv=none; d=google.com; s=arc-20160816; b=Zut8SRi9KSYX4my1pDDY34e1XyLZ7oauDfls5znisnHev7UecyTjxwwDFjAGm0bxzS 0JXwyHnWO0rSdAX+GOH8Z3lai1Ow4u0/9I8A3KUWAAf0VU0zMWq8b69FpAv2/7R166D2 aIqapZzA2PkiZDjXRyjwTdUjyHo8Jyg7ojBUIOtmM0Ltc5uiaZQgFqyVnyS3oOWHK4aA uOsGPJmRkApuXnWQoP47Lk2T5ATvCEX/8MZv0fV2axBZ4+8DdLdfe6ADJD2k5JQA2OgZ YHxvPH+sEg9iNu8B0DHfjIRl3uba8HmTSJQhVdIIPJohWBc2X5CxjelkvFzlMUNFtF1o IlOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2wC/fCWQtr11FIxhQIilV4kcqrlg2g+9qDXvLjQdiaY=; b=ZPKlpXQnCrWOztGBzl1kvmdkYASKsQrLJK5w/i8XTDfPJEyyW61Z8pKdjySz0+QuPN YJTDvYQarIbtLkPBBIo3TnMM8k1779UkOMWXnRfT+vctkLlu/QoGTNLZNC/6ZaorCuWh LbIQe2zHiZbrTiX8onfQJY2mfOxepWmKB7sjlJlpB0xeps4KD47MCH6Nl9K1C/Vi599H QrPMDnlIvGo9QgEXo4bEATQ+aVVdftFlN8tdvBAWINM7jvrFhlMaRr2/Ka2j/gMNw5va 0vtcOpaXzf/H8qfUyKuVMTEvZ1HzpA5XofSDL5NJ8rJA5rrVptXXqHZqACC+npw+hzO3 kEkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=KC9ACjBA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m12si1859996ioj.96.2021.08.22.15.20.39; Sun, 22 Aug 2021 15:20:50 -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=@linux-foundation.org header.s=korg header.b=KC9ACjBA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233746AbhHVWUe (ORCPT + 99 others); Sun, 22 Aug 2021 18:20:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:57932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbhHVWUe (ORCPT ); Sun, 22 Aug 2021 18:20:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 892AF61267; Sun, 22 Aug 2021 22:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1629670792; bh=9QiEIQNGBi9nfvqgJV5eTtXQ+nYy4w+IVMveVo1QNHI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KC9ACjBAbvdERDZUfnmGTzJOxTRFJU9//f1GKDlopXubbyDOcDgvh6S6vlaqgpw1p KmmoRTO6nNFOlNV7MhikA4K6QoOIshP2cQFp9+YAmuApcP2Idu51qqrCYIK5IBWwQH LKmuFexhzTPa/fzt0YJ0SYVPShbkgpbpwUdnU48U= Date: Sun, 22 Aug 2021 15:19:52 -0700 From: Andrew Morton To: yaozhenguo Cc: mike.kravetz@oracle.com, corbet@lwn.net, yaozhenguo@jd.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] hugetlbfs: add hugepages_node kernel parameter Message-Id: <20210822151952.23ca9547316dc34c9f3bd482@linux-foundation.org> In-Reply-To: <20210820030536.25737-1-yaozhenguo1@gmail.com> References: <20210820030536.25737-1-yaozhenguo1@gmail.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Aug 2021 11:05:36 +0800 yaozhenguo wrote: > 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 hugepags > in kernel cmdline. But, only four hugepages is used. The others should > 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 specify > node number of hugepages to allocate at boot. > For example add following parameter: > > hugepagesz=1G hugepages_node=1 hugepages=4 > > 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=1,2,5