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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B9C3C433FE for ; Fri, 4 Nov 2022 04:29:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BFF5E6B0071; Fri, 4 Nov 2022 00:29:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B882A6B0073; Fri, 4 Nov 2022 00:29:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A28816B0074; Fri, 4 Nov 2022 00:29:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8F9F56B0071 for ; Fri, 4 Nov 2022 00:29:16 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 512C180947 for ; Fri, 4 Nov 2022 04:29:16 +0000 (UTC) X-FDA: 80094480312.11.A9A2DA4 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by imf20.hostedemail.com (Postfix) with ESMTP id F031B1C0002 for ; Fri, 4 Nov 2022 04:29:15 +0000 (UTC) Received: by mail-qt1-f175.google.com with SMTP id hh9so2449163qtb.13 for ; Thu, 03 Nov 2022 21:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=SlEnOokG95a7hit2Jmz1aY6CvReOspMCPooMM7TFzXg=; b=WB19rvlcTSV5KUKnW2r9Zt8xqv8c2IH1d7ldyetlrVmKhJhg7VIY4ALPD0LE5W4Bux GyAB7I56sGNTKQML188wYmwjbpA7WJc9H9hOm3UgDsUiISaWblixhCTEEhWqknXNWLY/ T0lVXjS7Ta3xDDckYVHwIf/MVYUsKFIkl9UH+DqQJusyUW4P2viNZnJvwqFKbX3pi+Q5 rYXtY38ln1lcQs/jiLKA3TPg3FEFhZvFyipibqg62YPgFyS6x04wK4PRx2bNBCHsc9pd 25e11/ZWiimlOwDGQHJhgocRO8rhE8hDmY2i1AYQEZGMq2qwpoaKZWwxQAmzRg8IPOgY nCag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SlEnOokG95a7hit2Jmz1aY6CvReOspMCPooMM7TFzXg=; b=Yi6M92KEE2PVjkfaftQyT/uI4wwf9mG3SRRbRycnldCVja+J6x+j9NWInxLVlY4pk4 Ru6sgr9mM3jCFT50tUXecN+7A9MTHjXP5yvmmTyjXVBtqCkrnb44M/cbOUIoBBmItG1Y UXFfCv9s+aWpssz1hEpX2hhPGloDMwJg6tGyFrM/vGaJUQWjUYmF8QkR63qVK3mBB1Ui p+8hHXjHWVSdeU42JJk4evI2mh69/hIPSyLpPHC8YTBkQv5g3HTEsv1Z3jD4NtTtG+s/ E5z7y/YaoIf4fMntlLbwULXjqXUZbaxwGrS/vqNBH0IgD8GNL7UrhUekR2kRlD/2zj52 eDzQ== X-Gm-Message-State: ACrzQf3wymQyOd0iI6BrNu6PenNZBAgsAX33Aud4P7uAeA8RQph252O1 HgU5doa+ArYlXQMl7wBed1nb+Q== X-Google-Smtp-Source: AMsMyM7rqrXArPIOq2iMKGEGNaiOVs0iEkDFJtqhDvQrRkFoS6fHmwFYi1xYd6/CZ2v1fcQuoRDhJw== X-Received: by 2002:a05:622a:245:b0:3a5:5312:c18e with SMTP id c5-20020a05622a024500b003a55312c18emr5445396qtx.545.1667536155142; Thu, 03 Nov 2022 21:29:15 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id br17-20020a05622a1e1100b0039467aadeb8sm1767184qtb.13.2022.11.03.21.29.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 21:29:14 -0700 (PDT) Date: Thu, 3 Nov 2022 21:29:02 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Sidhartha Kumar cc: Hugh Dickins , Andrew Morton , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Vlastimil Babka , Peter Xu , Yang Shi , John Hubbard , Mike Kravetz , Muchun Song , Miaohe Lin , Naoya Horiguchi , Mina Almasry , James Houghton , Zach O'Keefe , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/3] mm,hugetlb: use folio fields in second tail page In-Reply-To: <5bd8a365-e2c5-a721-1257-81ec4ae0c626@oracle.com> Message-ID: <3934b34-ae2f-2119-9a68-33e51e909795@google.com> References: <5f52de70-975-e94f-f141-543765736181@google.com> <3818cc9a-9999-d064-d778-9c94c5911e6@google.com> <5bd8a365-e2c5-a721-1257-81ec4ae0c626@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667536156; a=rsa-sha256; cv=none; b=h7w2FPeMYEZDs1i+8zNANvPPjGU+Cm9X4TEwavmZJugXp4G28bVqijw5g0h0srdC2WrXKY bwLog8Lh74eJl+K2tUBtVQHKTwlCqYFe1CGTGGPWCsCChLBQvr5MvWX48bTSY4Gqa4j3xt MN/O8sXG+miDIidl/8c/spxtbvpZbgg= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=WB19rvlc; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of hughd@google.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667536156; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SlEnOokG95a7hit2Jmz1aY6CvReOspMCPooMM7TFzXg=; b=6yfbw5A5yCPjBrE0SkS3ng37RAXGr3DMQOcIhTua82f0pKC5CVXdw9ZWn60qbSMAxSZB0c KopZIwz/pNSiaTByy73gPFzCNJ/v6gmbyz9Kb1hF4sT+bvwDosokXI3cgrYqDMh21OtXAP so1BCF1IBL0PyM9TwCQhEidEv1FdJzE= X-Rspamd-Server: rspam02 X-Rspam-User: Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=WB19rvlc; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of hughd@google.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=hughd@google.com X-Stat-Signature: de7y7xrtn4r4ihbfxjgmqjwt1ukp1nnr X-Rspamd-Queue-Id: F031B1C0002 X-HE-Tag: 1667536155-542891 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, 3 Nov 2022, Sidhartha Kumar wrote: > On 11/2/22 6:48 PM, Hugh Dickins wrote: ... > > Undo "mm: add private field of first tail to struct page and struct > > folio"'s recent addition of private_1 to the folio tail: instead add > > hugetlb_subpool, hugetlb_cgroup, hugetlb_cgroup_rsvd, hugetlb_hwpoison > > to a second tail page of the folio: THP has long been using several > > fields of that tail, so make better use of it for hugetlb too. > > This is not how a generic folio should be declared in future, > > but it is an effective transitional way to make use of it. ... > > @@ -260,13 +267,16 @@ struct page { > > * to find how many references there are to this folio. > > * @memcg_data: Memory Control Group data. > > * @_flags_1: For large folios, additional page flags. > > - * @__head: Points to the folio. Do not use. > > + * @_head_1: Points to the folio. Do not use. > > Changes to my original patch set look good, this seems to be a cleaner > implementation. Thanks a lot, Sidhartha, I'm glad to hear that it works for you too. I expect that it will be done differently in the future: maybe generalizing the additional fields to further "private"s as you did, letting different subsystems accessorize them differently; or removing them completely from struct folio, letting subsystems declare their own struct folio containers. I don't know how that will end up, but this for now seems good and clear. > > Should the usage of page_1 and page_2 also be documented here? You must have something interesting in mind to document about them, but I cannot guess what! They are for field alignment, not for use. (page_2 to help when/if someone needs to add another pageful.) Do you mean that I should copy the /* private: the union with struct page is transitional */ comment from above the original "struct page page;" line I copied? Or give all three of them a few underscores to imply not for use? Thanks, Hugh