Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4141540pxb; Tue, 26 Jan 2021 13:32:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJy25f3V3VBnyxXrl5ZJ4K3kI4vUHnKGlyCo63UevdfbgAqfOhI37Bn5glMEPholmH+Y/OzE X-Received: by 2002:a05:6402:20e:: with SMTP id t14mr6130061edv.178.1611696763639; Tue, 26 Jan 2021 13:32:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611696763; cv=none; d=google.com; s=arc-20160816; b=Z3G9rG96Eg7nbLQbfrNRPL5VdIXQXZz7CmuesOQdTJmfGOvHog4LhNwX9iRPU/e3ps EE4CPqWL+EHmFk59vlyZKhk9UC/CA4uPuN6FYEi7S20Av+mrks+zLRoW2aROCPrjdjqB Cz6FxHB729169tRGa3l1ev32G4OktnNyCMUb9b0QrIWMDWeKT7pVjENdVaYKI9y1Djit f8k7nmWt8rP5FVB+0b9C98+aiOiqoLwt897Iu56W4M5dnwdUZovPn36Xvo/8VrbN99ay dcPmVcAk9LDyooQNZMNejLy7uSQgjRW/NuOzoa4Tb6Ezz0eT9XAFlsbGC+XZkUVPymk0 tLnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QW8QHydhaLv2kCU+6eTvr2welYmg+FLV/r+/koJuoLk=; b=qHlLRlpA3dy3vjZhTeVfk2eLBdlsD2RQbo8JPLn8Fczoirw1tFwXYP1meb7+5e5GLh 9dCXaVFK7tj6HaYlGbjdQbAocaSgcDtiu5YKDePUtUa/k3iGvnPD9uoWbwnNtfQeg3f/ j7RQQScIasgY84Kkb2meaj9RR4F+i0woVXsFedXj28bao8DqylxVqnLGyRcDmnKCGJhC fuGSIgww90Ld2l5SbnmdsJA4G3AVRjfYBstsMD5wHgT/4KM7ZWEE+wFVvQ6r4Hc9jQgX POcEvcj6NkkPqP/T3ih5iftIGEsfDWxRjJeVr6hfkK6X7+Jd8lTIDRbpigbXwsiqpIbB /Log== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=xjDsgoFJ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si7416242ejb.452.2021.01.26.13.32.18; Tue, 26 Jan 2021 13:32:43 -0800 (PST) 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=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=xjDsgoFJ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388997AbhAZF4B (ORCPT + 99 others); Tue, 26 Jan 2021 00:56:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728012AbhAYMkc (ORCPT ); Mon, 25 Jan 2021 07:40:32 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B8B1C06178A for ; Mon, 25 Jan 2021 04:31:09 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id j21so2890847pls.7 for ; Mon, 25 Jan 2021 04:31:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QW8QHydhaLv2kCU+6eTvr2welYmg+FLV/r+/koJuoLk=; b=xjDsgoFJfGSx+QNEJsDoPpI6efmJI7cXx1rArOBkvxtD5CI8yASxFFYDVnqLbfElBp aLK4FtgR+15ZVnswDysdST3r8KI85QituFeOZJYVdcr8YztK0VXzUEZS8kWbBK1bHUoP S305pTMQi8NXQ4QW/MLiaG+nkJK0HgJb0gd7hWR+K0hSfaOpDfCx4XKA/wSM6NKSJX6N 7BWmQaIN1x1BQ+m9UeMPWDTk+2eY7wqW6BGtJsdjC1Mpl6p4DL+hgAo3reOxHMiQK9Ij Guuma2LpY+FkUSohEtdd9l3WTiP6AWVR4A2xM/CNxhjGd6u94DEW8dTpSSE4V818Ey53 xtiw== 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; bh=QW8QHydhaLv2kCU+6eTvr2welYmg+FLV/r+/koJuoLk=; b=I7k6uO8V8wD8cFZOqHJNjviq0BTq8KFq87MStdyn4g/n8R20ajERtXWFUWr+Kqai+b HEB5Flr6zFAlmM+/QPKkc0KG5ewd8iJUsmRPicuhetKBJjrxbswOG6xXWjipCJmGuQwC t/d5qZhtQK8QQbASohJ3yVppD0tZap3IS6dXikoAQRGpir0PcykJ5wQl8K/AYcMsgAY5 qwgDCOVZYSIwxRZrnMUR4ivIihiDFwXgpuNFdQ+Sw2kwGN3bHUWa2AUguH5b8S4CibhR F0EwGa9+2yymeYhmgYtWdU7/MsnEa90Hr/q5onExcvpAcz/BRV3Vz3hpt5L98tyU+8sw 6a5w== X-Gm-Message-State: AOAM5305yWEqQ/PS6SXxzFoEq2PHO+aikv0sOE+craxAViV7rWvej1Me o9Mxy3X25L9FBT4EnVwkwbFkH3s4RPUq0F1eOOg8ow== X-Received: by 2002:a17:90a:3e81:: with SMTP id k1mr179973pjc.13.1611577869029; Mon, 25 Jan 2021 04:31:09 -0800 (PST) MIME-Version: 1.0 References: <20210117151053.24600-1-songmuchun@bytedance.com> <20210117151053.24600-10-songmuchun@bytedance.com> <7550ebba-fdb5-0dc9-a517-dda56bd105d9@redhat.com> In-Reply-To: <7550ebba-fdb5-0dc9-a517-dda56bd105d9@redhat.com> From: Muchun Song Date: Mon, 25 Jan 2021 20:30:32 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v13 09/12] mm: hugetlb: add a kernel parameter hugetlb_free_vmemmap To: David Hildenbrand Cc: Jonathan Corbet , Mike Kravetz , Thomas Gleixner , mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , viro@zeniv.linux.org.uk, Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , Matthew Wilcox , Oscar Salvador , Michal Hocko , "Song Bao Hua (Barry Song)" , =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 25, 2021 at 7:43 PM David Hildenbrand wrote: > > On 17.01.21 16:10, Muchun Song wrote: > > Add a kernel parameter hugetlb_free_vmemmap to enable the feature of > > freeing unused vmemmap pages associated with each hugetlb page on boot. > > The description completely lacks a description of the changes performed > in arch/x86/mm/init_64.c. Will update. Thanks. > > [...] > > > --- a/arch/x86/mm/init_64.c > > +++ b/arch/x86/mm/init_64.c > > @@ -34,6 +34,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -1557,7 +1558,8 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, > > { > > int err; > > > > - if (end - start < PAGES_PER_SECTION * sizeof(struct page)) > > + if (is_hugetlb_free_vmemmap_enabled() || > > + end - start < PAGES_PER_SECTION * sizeof(struct page)) > > This looks irresponsible. You ignore any altmap, even though current > altmap users (ZONE_DEVICE) will not actually result in applicable > vmemmaps that huge pages could ever use. > > Why do you ignore the altmap completely? This has to be properly > documented, but IMHO it's not even the right approach to mess with > altmap here. Thanks for reminding me of this. Sorry I also did not notice that. > > -- > Thanks, > > David / dhildenb >