From patchwork Thu Nov 10 02:13:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13038249 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 82E2AC4332F for ; Thu, 10 Nov 2022 02:14:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E174B6B0074; Wed, 9 Nov 2022 21:14:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DC7616B0075; Wed, 9 Nov 2022 21:14:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8EC76B0078; Wed, 9 Nov 2022 21:14:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B8D4C6B0074 for ; Wed, 9 Nov 2022 21:14:02 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7F9081A06A1 for ; Thu, 10 Nov 2022 02:14:02 +0000 (UTC) X-FDA: 80115912324.17.6F33A03 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by imf26.hostedemail.com (Postfix) with ESMTP id 23C17140005 for ; Thu, 10 Nov 2022 02:14:01 +0000 (UTC) Received: by mail-ot1-f46.google.com with SMTP id d26-20020a05683018fa00b0066ab705617aso399129otf.13 for ; Wed, 09 Nov 2022 18:14:01 -0800 (PST) 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=PQ5gUxhZkoh4ZqQ1bcivI/3wrTPkC+2Pwjz27W6nqVY=; b=hkWyuWg5OmCw+m8n+jU/hEL2SZEyvZZsF5o109BrS1bEC/oc1yxlIjRs8KNwa1Yt7L KaI3Pns5MBH582GuIyu7ww++uOE1lZCVg6+DB7jA7Z2Hu8TvKX6OXLP1BCWXxMziU3Kx PMpZtCvWfFdYvompuhsL+52Z/S7QXwAOKElAMH6wZWzsn9bBEGFlwV2ayA+ps6s9toZa 5E+9Fgqz8JgGH7RgDG0jGp3K5fWiHZyAOA98zdE2TOm1yj3SnirsFAF2KcAle/Xz6935 dKolrUkd+gRIuxCz0WTf2LmnM/J0Y2m5TdksjF8OhR33Of62sXNIuxOzRBMjUDdr/HEX D26w== 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=PQ5gUxhZkoh4ZqQ1bcivI/3wrTPkC+2Pwjz27W6nqVY=; b=7XBeEMnhdJHZxRI75AsVhxiah2AAE0UKiiwrdp16Fn4Aw2c6sxXPtnt+SIqYQ0BBM8 gJgzR2UuDJM3Kx0GwZViaq8NZQyOTzQLpEgYjasZF0vhwptDlMMKjKnWmcO7gkJgJ97U UbamKB05rTapeAm9g2zY0o9hp17/oZqj2L2izl94TXQLFFkRZm8gtmqjMnyoAdabnsnk 0N4K+3L4l30nFkqlVPOz44LLzYMf8zU0Kcds0Qu8GxUGa/aT/1TH/dXQcJVT3cWnxDdc dhihLg99Mv36Bbpuz2VsyzJkaTD3vUiMsS9Hzaaxv28Rk12BOYssny5UrSxzVL1g85z2 tiRQ== X-Gm-Message-State: ACrzQf3ZLfs4oCU48fti3AFYXL/gwRW5PNdfmNk9b0sAsdHelv/U66MP hCnEPUFDgrq9jSLlmPnV2taciA== X-Google-Smtp-Source: AMsMyM4dcGqo0An9JN9vCjwoOpNHZTTIU7z3U6tVi3khgS8u3goRM6xFEtxLIwnDfEf20Yl+wAOCFw== X-Received: by 2002:a05:6830:6084:b0:65c:3942:e3bf with SMTP id by4-20020a056830608400b0065c3942e3bfmr18619123otb.49.1668046441175; Wed, 09 Nov 2022 18:14:01 -0800 (PST) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id y5-20020a544d85000000b003509cc4ad4esm5258842oix.39.2022.11.09.18.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 18:14:00 -0800 (PST) Date: Wed, 9 Nov 2022 18:13:50 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Sidhartha Kumar , "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: [PATCH 1/3 fix] mm,hugetlb: use folio fields in second tail page: fix In-Reply-To: <7f60bcac-a2e5-9c4b-8a8f-e972a93e116@google.com> Message-ID: <9e2cb6b-5b58-d3f2-b5ee-5f8a14e8f10@google.com> References: <5f52de70-975-e94f-f141-543765736181@google.com> <3818cc9a-9999-d064-d778-9c94c5911e6@google.com> <5bd8a365-e2c5-a721-1257-81ec4ae0c626@oracle.com> <3934b34-ae2f-2119-9a68-33e51e909795@google.com> <7f60bcac-a2e5-9c4b-8a8f-e972a93e116@google.com> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668046442; 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=PQ5gUxhZkoh4ZqQ1bcivI/3wrTPkC+2Pwjz27W6nqVY=; b=2ouXWoXtlGdbdInmQIRGCxYbJznlRHkqCbEobY/Bym70Te13+H4IKAm+2vRzlHw5dA0bYj EYMZg0bRpF42KtbaRoxb65fBndgapgxneolkbbCw3n7QCmCgy5LJ6T8jXfzH81mCFFRLWj Ay/mzLX7gXMhworwOwMMpO0oqML1WHo= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=hkWyuWg5; spf=pass (imf26.hostedemail.com: domain of hughd@google.com designates 209.85.210.46 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668046442; a=rsa-sha256; cv=none; b=qE1C2jdsPK3OtaJlJuMad/4/gIqgqZkW6OAfpbf97rWm55OKUaCkk/N4c+zHseFBB+osLQ naY0J1SIvZzIjn489rNafymhcWxaNxeHcHS69ZiFBpqcy01TrLUdXnZ5UcgwwT/f/g1d5k SwwZel2Lix95alMLrLtq7Q6rMmF1OZk= X-Rspamd-Queue-Id: 23C17140005 X-Rspam-User: X-Rspamd-Server: rspam08 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=hkWyuWg5; spf=pass (imf26.hostedemail.com: domain of hughd@google.com designates 209.85.210.46 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: iir1fe874rykybd6tozquzyogipo94fm X-HE-Tag: 1668046441-439687 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: Per review comment from Sidhartha: prefix folio's page_1 and page_2 with double underscore, to underscore that they are fillers for alignment rather than directly usable members of the union (whereas the first "struct page page" is important for folio<->page conversions). Per review comment from Kirill: give folio's _flags_2 and _head_2 a line of documentation each, though both of them "Do not use" (I think _flags_1 should be enough for now, and shouldn't recommend spilling to _flags_2). Signed-off-by: Hugh Dickins --- include/linux/mm_types.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 5d28bbd19e3f..1b8db9b4a7e6 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -275,6 +275,8 @@ struct page { * @_subpages_mapcount: Do not use directly, call folio_mapcount(). * @_pincount: Do not use directly, call folio_maybe_dma_pinned(). * @_folio_nr_pages: Do not use directly, call folio_nr_pages(). + * @_flags_2: For alignment. Do not use. + * @_head_2: Points to the folio. Do not use. * @_hugetlb_subpool: Do not use directly, use accessor in hugetlb.h. * @_hugetlb_cgroup: Do not use directly, use accessor in hugetlb_cgroup.h. * @_hugetlb_cgroup_rsvd: Do not use directly, use accessor in hugetlb_cgroup.h. @@ -330,7 +332,7 @@ struct folio { unsigned int _folio_nr_pages; #endif }; - struct page page_1; + struct page __page_1; }; union { struct { @@ -341,7 +343,7 @@ struct folio { void *_hugetlb_cgroup_rsvd; void *_hugetlb_hwpoison; }; - struct page page_2; + struct page __page_2; }; };