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.7 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=ham 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 EF51BC433E0 for ; Thu, 14 Jan 2021 12:32:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B17523A53 for ; Thu, 14 Jan 2021 12:32:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B17523A53 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B49678D00DE; Thu, 14 Jan 2021 07:32:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AF8988D008E; Thu, 14 Jan 2021 07:32:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E7488D00DE; Thu, 14 Jan 2021 07:32:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id 829148D008E for ; Thu, 14 Jan 2021 07:32:53 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 48355181AEF39 for ; Thu, 14 Jan 2021 12:32:53 +0000 (UTC) X-FDA: 77704319826.16.coal47_5a06de827526 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 27C77100E6912 for ; Thu, 14 Jan 2021 12:32:53 +0000 (UTC) X-HE-Tag: coal47_5a06de827526 X-Filterd-Recvd-Size: 3697 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Thu, 14 Jan 2021 12:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610627572; 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=AUvS6QLhZFtiHHV/tUY8oq4VOM2EUrkQe6b8GdqyVoo=; b=PAJ/fML7guGLrvj7E+VvP9p4R7+G/WGmnYVU3TKE5s9VzVx9293PrTVWeyH7EkB8pmOXWu JdmABL8nI/w4BqOK4H4A5S+mZBXW694+Kz8xpBteUtt8TpzSraGzcfRQlklf0qmRiUbRru 9mXhLVn2/0N5d99xFEucH91+Qdl1MA8= 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-97-DVNIQXRjMUGXXVZIAgBKng-1; Thu, 14 Jan 2021 07:32:48 -0500 X-MC-Unique: DVNIQXRjMUGXXVZIAgBKng-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 00A901005D4C; Thu, 14 Jan 2021 12:32:47 +0000 (UTC) Received: from [10.36.115.75] (ovpn-115-75.ams2.redhat.com [10.36.115.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id A75685D6AD; Thu, 14 Jan 2021 12:32:45 +0000 (UTC) Subject: Re: [PATCH] mm/hugetlb: Use helper huge_page_order and pages_per_huge_page To: Miaohe Lin , akpm@linux-foundation.org, mike.kravetz@oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210114114435.40075-1-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <4cf8a293-7154-8cb7-3e39-3d138137e291@redhat.com> Date: Thu, 14 Jan 2021 13:32:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210114114435.40075-1-linmiaohe@huawei.com> 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.15 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 14.01.21 12:44, Miaohe Lin wrote: > Since commit a5516438959d ("hugetlb: modular state for hugetlb page size"), > we can use huge_page_order to access hstate->order and pages_per_huge_page > to fetch the pages per huge page. But gather_bootmem_prealloc() forgot to > use it. > > Signed-off-by: Miaohe Lin > --- > mm/hugetlb.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index fe2da9ad6233..c04d922757c7 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -2476,7 +2476,7 @@ static void __init gather_bootmem_prealloc(void) > struct hstate *h = m->hstate; > > WARN_ON(page_count(page) != 1); > - prep_compound_huge_page(page, h->order); > + prep_compound_huge_page(page, huge_page_order(h)); > WARN_ON(PageReserved(page)); > prep_new_huge_page(h, page, page_to_nid(page)); > put_page(page); /* free it into the hugepage allocator */ > @@ -2488,7 +2488,7 @@ static void __init gather_bootmem_prealloc(void) > * side-effects, like CommitLimit going negative. > */ > if (hstate_is_gigantic(h)) > - adjust_managed_page_count(page, 1 << h->order); > + adjust_managed_page_count(page, pages_per_huge_page(h)); > cond_resched(); > } > } > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb