Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3988619pxb; Tue, 26 Jan 2021 09:29:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTYcmitGLU9El2M6rdDhuKSqDgCR+X0cbguCZg9E0QPHWkGt1LsU3vBTm0wkOLfKZdafr9 X-Received: by 2002:a17:906:48f:: with SMTP id f15mr4203912eja.392.1611682182953; Tue, 26 Jan 2021 09:29:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611682182; cv=none; d=google.com; s=arc-20160816; b=g2LeT1cxXoaXl99cFRlan8e3B5BC86iTCiA7Ha/u1X+DC+1nI1rG64vsXdLM4L2w9U VUfCvsNEMy0fKRQHJnq9Z6qpzsfmIcsPkidc2G4v5qHe6YqdQQx0ENutlumaYoMqszLW 1wBjboIf+uy7jVvzRzNHtjZGhEeyfK2FTpmxYOwrUGLzRiAHrPsFAc0L66tTDjXgkoyZ ZCHu7k6e06TdPywPjUvUQOnPSyApE03R+6ADQgi6bMruTXEdpOo8j9ZkDFdW2k61Clhk G/koruWCORLZVeOGbaE63vAiD7nWqIB2FXE9ypwHRgZ959769ipCpVn6O/SMjyQCsm8z Cs5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=AIA/BcttlSHv8GLsr7H6tYhexBrgaN2wOw3GuVCswDU=; b=VfJPffQd/iJzH86eknVlpxIo6Jxh0pIaG/Bf7X4Efg1+TckwCRKf7+i48XcJsaCN1S GzfcKuzV6j9vWttAHlhF8L7K7T+cH9QcUNubs3arjK/u8CQlnHfQn3uwEdgf3fVndt7U Yt3R0//MnfZ9+mjV794ST9YLRNlebmyv6NgiIDqrdI4wk+KBgatkBWHZDrUdZtdkpQTG KMj9rC8AwXkRse03ZG8OvXWlGzmmGlu5lg4EISsowUjt4MFqEd0tCpaZkXZUhgALyIPS +sbrUgVFxW9nGUfGZuDL21j1LPJd+l9BZ1zYIHpBA9qJnsQuyPYg9CSBt/KL75fBzV6r 4fmQ== ARC-Authentication-Results: i=1; mx.google.com; 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 n10si5898618edy.575.2021.01.26.09.28.46; Tue, 26 Jan 2021 09:29:42 -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; 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 S2388397AbhAZFoW (ORCPT + 99 others); Tue, 26 Jan 2021 00:44:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:55492 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727657AbhAYMKV (ORCPT ); Mon, 25 Jan 2021 07:10:21 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B8AA2ACF4; Mon, 25 Jan 2021 12:08:36 +0000 (UTC) Date: Mon, 25 Jan 2021 13:08:32 +0100 From: Oscar Salvador To: David Hildenbrand Cc: Muchun Song , corbet@lwn.net, mike.kravetz@oracle.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, rdunlap@infradead.org, oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, almasrymina@google.com, rientjes@google.com, willy@infradead.org, mhocko@suse.com, song.bao.hua@hisilicon.com, naoya.horiguchi@nec.com, duanxiongchun@bytedance.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v13 09/12] mm: hugetlb: add a kernel parameter hugetlb_free_vmemmap Message-ID: <20210125120827.GA29289@linux> References: <20210117151053.24600-1-songmuchun@bytedance.com> <20210117151053.24600-10-songmuchun@bytedance.com> <7550ebba-fdb5-0dc9-a517-dda56bd105d9@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7550ebba-fdb5-0dc9-a517-dda56bd105d9@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 25, 2021 at 12:43:23PM +0100, David Hildenbrand wrote: > > - 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. The goal was not to ignore altmap but to disable PMD mapping sections when the feature was enabled. Shame on me I did not notice that with this, altmap will be ignored. Something like below maybe: int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, struct vmem_altmap *altmap) { int err; bool populate_base_pages = false; if ((end - start < PAGES_PER_SECTION * sizeof(struct page)) || (is_hugetlb_free_vmemmap_enabled() && !altmap)) populate_base_pages = true; if (populate_base_pages) { err = vmemmap_populate_basepages(start, end, node, NULL); } else if (boot_cpu_has(X86_FEATURE_PSE)) { .... > > -- > Thanks, > > David / dhildenb > > -- Oscar Salvador SUSE L3