From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 711C0C19425 for ; Wed, 9 Dec 2020 10:08:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2DACF239E5 for ; Wed, 9 Dec 2020 10:08:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729729AbgLIKIV (ORCPT ); Wed, 9 Dec 2020 05:08:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56543 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728631AbgLIKIU (ORCPT ); Wed, 9 Dec 2020 05:08:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607508413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4m7vcxbiJttn8QYkTQIy6cn6rx9Zw5Muq0IpNVCW1eU=; b=aewuL5p6AwUz2iP28V6V5OjjUwzUJHiHrcOrfmfJm4SKQ047Ui+nu+sY9mS3dZ3AYT4wS5 lH5PsaXDBUEVopWPxfQyACpVJMpXQ2fUo7WkUv4Xd3ffpi4wxMSpUl9uKdAGA5KPs4om5p WGWfODAfWyNI3/0uNXKfUCqmZ3BzFI0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-464-KYNyJPTwP3ei1ybgJrgtcQ-1; Wed, 09 Dec 2020 05:06:49 -0500 X-MC-Unique: KYNyJPTwP3ei1ybgJrgtcQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4D5848030AF; Wed, 9 Dec 2020 10:06:46 +0000 (UTC) Received: from [10.36.114.167] (ovpn-114-167.ams2.redhat.com [10.36.114.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA1BF5D9D3; Wed, 9 Dec 2020 10:06:40 +0000 (UTC) Subject: Re: [External] Re: [PATCH v7 06/15] mm/hugetlb: Disable freeing vmemmap if struct page size is not power of two To: Muchun Song 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)" , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel References: <20201130151838.11208-1-songmuchun@bytedance.com> <20201130151838.11208-7-songmuchun@bytedance.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <4b8a9389-1704-4d8c-ec58-abd753814dd9@redhat.com> Date: Wed, 9 Dec 2020 11:06:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.12.20 11:03, Muchun Song wrote: > On Wed, Dec 9, 2020 at 5:57 PM David Hildenbrand wrote: >> >> On 30.11.20 16:18, Muchun Song wrote: >>> We only can free the tail vmemmap pages of HugeTLB to the buddy allocator >>> when the size of struct page is a power of two. >>> >>> Signed-off-by: Muchun Song >>> --- >>> mm/hugetlb_vmemmap.c | 5 +++++ >>> 1 file changed, 5 insertions(+) >>> >>> diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c >>> index 51152e258f39..ad8fc61ea273 100644 >>> --- a/mm/hugetlb_vmemmap.c >>> +++ b/mm/hugetlb_vmemmap.c >>> @@ -111,6 +111,11 @@ void __init hugetlb_vmemmap_init(struct hstate *h) >>> unsigned int nr_pages = pages_per_huge_page(h); >>> unsigned int vmemmap_pages; >>> >>> + if (!is_power_of_2(sizeof(struct page))) { >>> + pr_info("disable freeing vmemmap pages for %s\n", h->name); >> >> I'd just drop that pr_info(). Users are able to observe that it's >> working (below), so they are able to identify that it's not working as well. > > The below is just a pr_debug. Do you suggest converting it to pr_info? Good question. I wonder if users really have to know in most cases. Maybe pr_debug() is good enough in environments where we want to debug why stuff is not working as expected. -- Thanks, David / dhildenb