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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 991FEC433DB for ; Thu, 14 Jan 2021 02:47:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 046612360D for ; Thu, 14 Jan 2021 02:47:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 046612360D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0BD7F8D00B3; Wed, 13 Jan 2021 21:47:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 070398D008E; Wed, 13 Jan 2021 21:47:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9E978D00B3; Wed, 13 Jan 2021 21:47:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id D10558D008E for ; Wed, 13 Jan 2021 21:47:43 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9E9E73633 for ; Thu, 14 Jan 2021 02:47:43 +0000 (UTC) X-FDA: 77702845206.22.cast34_490ad1b27523 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 81EBF18037399 for ; Thu, 14 Jan 2021 02:47:43 +0000 (UTC) X-HE-Tag: cast34_490ad1b27523 X-Filterd-Recvd-Size: 5532 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Thu, 14 Jan 2021 02:47:42 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id m6so2505885pfk.1 for ; Wed, 13 Jan 2021 18:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bb9vztNKh5yOtZxuyb9LtKscOOsr5r79L3TCOP8Fxpw=; b=Wk++KEvZgXFQglTG6qkX5vApZwPahrumxGHE8eNv2CrTeJFuPxhxtOXMtfsNf1zQX0 Wfrjth2PgAq46N8ehgJNMpslq7pfh80U7P7kKisKrHSeEZnm0FqsNg5UwJnkiXIGyzGc Gp1KcCZ4XiF0zPNuZoecIks4e2PHOLy1i2vnQ7j1hFbjVjbm4YbbFxtwC5eYrigiyWJQ 4qZPAThDKIPGpxb01tmXNxQrWrwOxHdZB88eNyuAgDFktUCZW82VXqxmihXZ3kpBcIt5 kt2HAslL91h9mlxwKEl06c0oooWMJZu/yEM8LDp94GxCtg4gfc7pb55RGnycJhyGqoz2 Cxcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bb9vztNKh5yOtZxuyb9LtKscOOsr5r79L3TCOP8Fxpw=; b=A6zyZf9TSxCctQNXLXy9EygAxXW8a6xPgR3+gxCZC7oU72/Id/HfaWNcp7DQGPKpWI pvR8gdHW7jztuUt1RgPujHHe/8EjXn9MLrhhvt/urU2dNN54w+0cdd/+9KGH7ydV0/u2 vcLEBC7bFjpQisuFtAgy5E0RC6uy1g7kpmA6A09vcRnDRgOjelDkIrC8Ebu2BuJHYwDt Xb+E2E4vbWpvpkyPFgsRnpi7uCxNJUmq6e9dOOhQeu8YC0HH+RGdagSeBOahsNpNRmz5 GIRcZBFxZDkQZZA/1X9mHi+AdMCbQD7YEqayh/uvjiHdRyZ59icrK8tPQ9T1FAQUe2kN Xeyw== X-Gm-Message-State: AOAM531lB5dG/WsYrFrFDzgyntqCF8AaLNSgEQFm2Ioho/7+7KghJJUC QW8O4mNHgHjv8Sxofih9Vo3kXSF+wOBLmRyATLg4Gw== X-Google-Smtp-Source: ABdhPJybZQMKqUQbok9qICM/zCjzBBjPXnnfJENEz8sj+4/RhLsx2i+9EOD9iTXswcQBmlv38NIlS/VowHGzLG5fPJ8= X-Received: by 2002:a63:50a:: with SMTP id 10mr5142821pgf.273.1610592461638; Wed, 13 Jan 2021 18:47:41 -0800 (PST) MIME-Version: 1.0 References: <20210106141931.73931-1-songmuchun@bytedance.com> <20210106141931.73931-13-songmuchun@bytedance.com> In-Reply-To: From: Muchun Song Date: Thu, 14 Jan 2021 10:47:04 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v12 12/13] mm/hugetlb: Gather discrete indexes of tail page To: Mike Kravetz Cc: Jonathan Corbet , Thomas Gleixner , mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , viro@zeniv.linux.org.uk, Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , Matthew Wilcox , Oscar Salvador , Michal Hocko , "Song Bao Hua (Barry Song)" , David Hildenbrand , =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel Content-Type: text/plain; charset="UTF-8" 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 Thu, Jan 14, 2021 at 8:18 AM Mike Kravetz wrote: > > On 1/6/21 6:19 AM, Muchun Song wrote: > > For HugeTLB page, there are more metadata to save in the struct page. > > But the head struct page cannot meet our needs, so we have to abuse > > other tail struct page to store the metadata. In order to avoid > > conflicts caused by subsequent use of more tail struct pages, we can > > gather these discrete indexes of tail struct page. In this case, it > > will be easier to add a new tail page index later. > > > > There are only (RESERVE_VMEMMAP_SIZE / sizeof(struct page)) struct > > page structs that can be used when CONFIG_HUGETLB_PAGE_FREE_VMEMMAP, > > so add a BUILD_BUG_ON to catch invalid usage of the tail struct page. > > > > Signed-off-by: Muchun Song > > Reviewed-by: Oscar Salvador > > --- > > include/linux/hugetlb.h | 14 ++++++++++++++ > > include/linux/hugetlb_cgroup.h | 15 +++++++++------ > > mm/hugetlb.c | 25 ++++++++++++------------- > > mm/hugetlb_vmemmap.c | 8 ++++++++ > > 4 files changed, 43 insertions(+), 19 deletions(-) > > My apologies! I did not get to this patch in previous versions of the > series. My "RFC create hugetlb flags to consolidate state" was done > before I even noticed your efforts here. > > At least we agree the metadata could be better organized. :) > > IMO, using page.private of the head page to consolidate flags will be > easier to manage. So, I would like to use that. Agree. Using page.private to manage the page flag is a good choice. When your RFC patch is applied, I will rebase it and rework this patch. > > The BUILD_BUG_ON in this patch makes sense. > -- > Mike Kravetz