Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1763253pxb; Fri, 5 Feb 2021 00:20:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0sMqFbU4iFXkmiUP2KrgPFJVtNWCB5yMLYtfgrjS8VoE1PRDyaVMBB+y6t0jdLKommqLr X-Received: by 2002:a17:906:2755:: with SMTP id a21mr3041992ejd.374.1612513252720; Fri, 05 Feb 2021 00:20:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612513252; cv=none; d=google.com; s=arc-20160816; b=GKY9pf/jZput7ZL2NOzipQuRj7w3mssBzWnueg5lIsi0G1aVloBrkYNk7QD+yoHRtT 0my8TPTyJ23d7W5rIOfSId2+RsA591/pFA9MYvp1h+0B2BUhnGGlnJFRv5up9DwPOzBW nIlEDn/gKqSU8OD3T8OxD+BVno3riQ/AKr4aQ16I35qME/HN/LEgtDdP0NWPvllSX2IF kMyd03vMetxJAzOsxGv/SlwNcwX7dAhIJbOyZ0o/agWC6K+5zmfH+olNDdEqgCkSJaIM UgJPB8b+MA5fTYXZLr5xyHIjEByBBzSiOoz5et44e0I0sT0cGVZdOIX6zLg3gYag4X6z upeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=t4IDZRK/m8IaLtY1N+dlfiekFNzwDKCGyPsbAx0sv8Q=; b=zDNYIf5+Y/lc3XGEsziPbB3z0Aj7U8cURT7CFWZfUx9e1D/oalIuu3RLLoJ9ye+QK8 BnkD/oOqCCQmqliTCWdukrZpsuxfPGQYjitqSfIljz+9MWPwVfQwHQuSXQZM+zzCnyi0 a3CbCLuFOSDwfTO4lgzLn7Dd9nr7ax610W6MLwsiwBHQ5B8N/xdS6mxDBF3KbTHIPRRJ 4lOFFZjTHMVWve4TcjAFJPZXw2v/uUlBIYV41gPLaks9yTptqTJFqcdNUk0z9OlMkOi3 c8BADDrbpMb1DFFEkAssyNEoL/YFC6o5DgzpPY3MIVZpUaPpiuoYw4Nxp9IV1/Ej61S2 tilA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R2oh12Kg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si5142116ejt.167.2021.02.05.00.20.27; Fri, 05 Feb 2021 00:20:52 -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=@redhat.com header.s=mimecast20190719 header.b=R2oh12Kg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231668AbhBEIRM (ORCPT + 99 others); Fri, 5 Feb 2021 03:17:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22284 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbhBEIRH (ORCPT ); Fri, 5 Feb 2021 03:17:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612512940; 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=R2oh12KgLubIeSmLYDpz732BXhtf9YnTv5Why0ytreNN9avtZvqcvsuzSa6igADrQnoCIV p9lJl1sQKRPVlk4bczQ2ekOWA2nT63z3l0ka6DIwZHs2cnd75FlFHlQU1Tw/9sALONKg50 4VM7TJ0psRUFjAjJsFLuIjjxGzkKRXo= 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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