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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 1636BC433DB for ; Fri, 15 Jan 2021 10:16:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6990E221FA for ; Fri, 15 Jan 2021 10:16:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6990E221FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB4AA8D0153; Fri, 15 Jan 2021 05:16:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D65CB8D0023; Fri, 15 Jan 2021 05:16:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7C188D0153; Fri, 15 Jan 2021 05:16:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id B0B318D0023 for ; Fri, 15 Jan 2021 05:16:39 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 78A12824556B for ; Fri, 15 Jan 2021 10:16:39 +0000 (UTC) X-FDA: 77707605318.28.lace55_5a164012752e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 5EE426C1A for ; Fri, 15 Jan 2021 10:16:39 +0000 (UTC) X-HE-Tag: lace55_5a164012752e X-Filterd-Recvd-Size: 2816 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 15 Jan 2021 10:16:38 +0000 (UTC) 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 97BD1B7C6; Fri, 15 Jan 2021 10:16:37 +0000 (UTC) Date: Fri, 15 Jan 2021 11:16:34 +0100 From: Oscar Salvador To: Mike Kravetz Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko , Naoya Horiguchi , Muchun Song , David Hildenbrand , Andrew Morton Subject: Re: [RFC PATCH 3/3] hugetlb: convert PageHugeTemporary() to HPageTempSurplus Message-ID: <20210115101629.GA5213@linux> References: <20210111210152.118394-1-mike.kravetz@oracle.com> <20210111210152.118394-4-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210111210152.118394-4-mike.kravetz@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Mon, Jan 11, 2021 at 01:01:52PM -0800, Mike Kravetz wrote: > Use new hugetlb specific flag HPageTempSurplus to replace the > PageHugeTemporary() interfaces. > > Signed-off-by: Mike Kravetz > --- > mm/hugetlb.c | 38 +++++++++----------------------------- > 1 file changed, 9 insertions(+), 29 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 34ce82f4823c..949e1f987319 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -58,6 +58,7 @@ static unsigned long hugetlb_cma_size __initdata; > enum htlb_page_flags { > HPAGE_RestoreReserve = 0, > HPAGE_Migratable, > + HPAGE_TempSurplus, > }; > > /* > @@ -99,6 +100,7 @@ void ClearHPage##flname(struct page *page) \ > > HPAGEFLAG(RestoreReserve) > EXT_HPAGEFLAG(Migratable) > +HPAGEFLAG(TempSurplus) Would HPAGE_Temporary/Temporary not be a better fit? The point about current PageHugeTemporary is that these pages are temporary as they do not belong to the pool and will vanish once the last reference gets drop. We do not really care that much about the surplus part? Besides, alloc_migrate_huge_page seems to not want to thread these pages as surplus. Also, I would add a comment either next to each flag or above the enum htlb_page_flags (probably the latter) with a brief explanation of each flag. Besides that, it looks fine to me. Here I do not see the same problem in stripping the PageHuge check in PageHugeTemporary, as I did in previous patch, because all callers of it make sure they operate on a hugetlb page. -- Oscar Salvador SUSE L3