Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1560238pxb; Mon, 12 Apr 2021 00:36:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDlu6CuB9h1lmZCGM6UDPrVm0HKZ658ThDDzE/stCvuDgoilGQ52qF06NDosGZVbxMQJVV X-Received: by 2002:a17:906:6b05:: with SMTP id q5mr7764973ejr.460.1618212973420; Mon, 12 Apr 2021 00:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618212973; cv=none; d=google.com; s=arc-20160816; b=Fd8G53hrQwWGpl0kVCXyrZTXh2XYQ8yfgvcBQcJqBTIs+DFDKIPzKrzLMxWjVx1sr1 7Fp3W9oOFhYc7uB9zbYyDEyf2Vhdz+DGGLOJsz0Bt3vU2H9cWQweJYfniv+AJoelsgHp try+ecfxVYnyN25+u5UvLutznm0je+3JkXg4wTPfzB30Dm4TqSpxQfxNzWfRz8fP0Hpm Zxd6541XsYAcscnvgciYpWAD1MaHTEvIxI9wLMhGn4GuaoLAlHv1l2tscl0yd4CvGypK ZYP5v7qwzZOKQordvnJghN8EMPnImmlKO21oNfTGPkleGXE0DRlX50sDVDQjVZ9Fhi3t eDJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=l+Nxd6ZwH3Uih2b1KhCP5mc7jD2KH2FMAp5iHOEHIyQ=; b=jXkQEWk34vVUeKUKoe4jsY2pFu1Jw8oKzzPJTOWhriMGjTwXWWhozA4Qzg6Ri7r7uH 84RM3XyzsRfF1Qb9FCB3im6UrUgy1fKPwmb2pYAwZB9WzLf+x3ivM1nXy+BNSC1NmV7e 5QJk8/U6XNTyuVWNmFLc23EfWj1oc8jkoCRM67ltkM2u03PJthi0DeB0rXUneFzy5pUH TyvD0WRj6CsfGixEGSCg1NBuHw3R+9jt0Z5ezVF1OzJcB68pdZ1fi2PuZGzHlRjHcDLL DU/Uk/e5hYJ4BjFN80n2Q1QWZk+LvYvEt90v3non95vNW17BcBilJGPn3pMgIRrg8gUb Ppmg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si7077118edo.522.2021.04.12.00.35.50; Mon, 12 Apr 2021 00:36:13 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbhDLHey (ORCPT + 99 others); Mon, 12 Apr 2021 03:34:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:41590 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236904AbhDLHeA (ORCPT ); Mon, 12 Apr 2021 03:34:00 -0400 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 74A46AEB9; Mon, 12 Apr 2021 07:33:12 +0000 (UTC) Date: Mon, 12 Apr 2021 09:33:07 +0200 From: Oscar Salvador To: Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Roman Gushchin , Michal Hocko , Shakeel Butt , David Hildenbrand , Muchun Song , David Rientjes , Miaohe Lin , Peter Zijlstra , Matthew Wilcox , HORIGUCHI NAOYA , "Aneesh Kumar K . V" , Waiman Long , Peter Xu , Mina Almasry , Hillf Danton , Joonsoo Kim , Barry Song , Will Deacon Subject: Re: [PATCH v5 4/8] hugetlb: create remove_hugetlb_page() to separate functionality Message-ID: <20210412073307.GB27818@linux> References: <20210409205254.242291-1-mike.kravetz@oracle.com> <20210409205254.242291-5-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210409205254.242291-5-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 Fri, Apr 09, 2021 at 01:52:50PM -0700, Mike Kravetz wrote: > The new remove_hugetlb_page() routine is designed to remove a hugetlb > page from hugetlbfs processing. It will remove the page from the active > or free list, update global counters and set the compound page > destructor to NULL so that PageHuge() will return false for the 'page'. > After this call, the 'page' can be treated as a normal compound page or > a collection of base size pages. > > update_and_free_page no longer decrements h->nr_huge_pages{_node} as > this is performed in remove_hugetlb_page. The only functionality > performed by update_and_free_page is to free the base pages to the lower > level allocators. > > update_and_free_page is typically called after remove_hugetlb_page. > > remove_hugetlb_page is to be called with the hugetlb_lock held. > > Creating this routine and separating functionality is in preparation for > restructuring code to reduce lock hold times. This commit should not > introduce any changes to functionality. > > Signed-off-by: Mike Kravetz > Acked-by: Michal Hocko > Reviewed-by: Miaohe Lin > Reviewed-by: Muchun Song Reviewed-by: Oscar Salvador A "nit" below: > static void update_and_free_page(struct hstate *h, struct page *page) > { > int i; > @@ -1334,8 +1369,6 @@ static void update_and_free_page(struct hstate *h, struct page *page) After this, update_and_free_page()'s job is to reset subpage's flags and free the page. Maybe we want to rename that function at some point, or maybe not as "update" might already imply that. Just speaking out loud. -- Oscar Salvador SUSE L3