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.9 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 B7965C433DB for ; Fri, 5 Feb 2021 08:15:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 338DE64F99 for ; Fri, 5 Feb 2021 08:15:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 338DE64F99 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 8214E6B006C; Fri, 5 Feb 2021 03:15:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D0EA6B006E; Fri, 5 Feb 2021 03:15:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E88A6B0070; Fri, 5 Feb 2021 03:15:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 581856B006C for ; Fri, 5 Feb 2021 03:15:40 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 21117181AEF10 for ; Fri, 5 Feb 2021 08:15:40 +0000 (UTC) X-FDA: 77783505240.11.force88_360f25e275e3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 00579180F8B80 for ; Fri, 5 Feb 2021 08:15:39 +0000 (UTC) X-HE-Tag: force88_360f25e275e3 X-Filterd-Recvd-Size: 3770 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Feb 2021 08:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612512939; 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=t4IDZRK/m8IaLtY1N+dlfiekFNzwDKCGyPsbAx0sv8Q=; b=LE/SXZ5RPlNFzvHXtzfXa+7Kg3+VfNsWeEbUnvWJ/g1BR1cd8UysjYAHpbdtYI5tR3ZMft 3k/+ws684gFYF04V3bRAq+Mhf4XUXdqOMUBl7w/7+elE7IK7oZryyxerzzi/5mqXVo/FA7 F2aYuvCevYwGFiULsHcR89zaRqJ6Q5Y= 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-361-AHE4xkEQPfeQO88hUCP7Rw-1; Fri, 05 Feb 2021 03:15:37 -0500 X-MC-Unique: AHE4xkEQPfeQO88hUCP7Rw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D434F804022; Fri, 5 Feb 2021 08:15:35 +0000 (UTC) Received: from [10.36.113.156] (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id BECC91A26A; Fri, 5 Feb 2021 08:15:34 +0000 (UTC) Subject: Re: [PATCH v2] mm/hugetlb: remove redundant check in preparing and destroying gigantic page To: yanfei.xu@windriver.com, mike.kravetz@oracle.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210202112002.73170-1-yanfei.xu@windriver.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <2f54a29c-9d81-e8bd-2d37-779cb2be6b21@redhat.com> Date: Fri, 5 Feb 2021 09:15:33 +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: <20210202112002.73170-1-yanfei.xu@windriver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 02.02.21 12:20, yanfei.xu@windriver.com wrote: > From: Yanfei Xu > > Gigantic page is a compound page and its order is more than 1. > Thus it must be available for hpage_pincount. Let's remove the > redundant check for gigantic page. > > Signed-off-by: Yanfei Xu > --- > mm/hugetlb.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index a3e4fa2c5e94..dac5db569ccb 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -1219,8 +1219,7 @@ static void destroy_compound_gigantic_page(struct page *page, > struct page *p = page + 1; > > atomic_set(compound_mapcount_ptr(page), 0); > - if (hpage_pincount_available(page)) > - atomic_set(compound_pincount_ptr(page), 0); > + atomic_set(compound_pincount_ptr(page), 0); > > for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) { > clear_compound_head(p); > @@ -1501,9 +1500,7 @@ static void prep_compound_gigantic_page(struct page *page, unsigned int order) > set_compound_head(p, page); > } > atomic_set(compound_mapcount_ptr(page), -1); > - > - if (hpage_pincount_available(page)) > - atomic_set(compound_pincount_ptr(page), 0); > + atomic_set(compound_pincount_ptr(page), 0); > } > > /* > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb