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=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 4DCFBC433E0 for ; Fri, 15 Jan 2021 10:17:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13C78235F9 for ; Fri, 15 Jan 2021 10:17:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728006AbhAOKRT (ORCPT ); Fri, 15 Jan 2021 05:17:19 -0500 Received: from mx2.suse.de ([195.135.220.15]:36744 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725831AbhAOKRS (ORCPT ); Fri, 15 Jan 2021 05:17:18 -0500 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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