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: 17921 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp678654wru; Wed, 9 Nov 2022 18:19:13 -0800 (PST) X-Google-Smtp-Source: AMsMyM5UXqhVAZaut9ESouhMjHtvEuzrKo9lG31OMNZE49sbZQPx94D5ZLjFeDBq0Jqm4VZzTXNz X-Received: by 2002:a63:4c17:0:b0:43b:e31c:efd0 with SMTP id z23-20020a634c17000000b0043be31cefd0mr54471063pga.213.1668046753329; Wed, 09 Nov 2022 18:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668046753; cv=none; d=google.com; s=arc-20160816; b=AYrCF0XGM5qozN8YUOGWr+VCuUTqFDmYelCx47ObO4UJVmhjMlOJt4nu95yhmBWHuS 3vsbiuImIwclryXUSD12sAiqkD7VX0Y2uifCLQiLE6ylzADjcOHj24yMWlGINSBJFPlJ bRVlG0VO8zdeq8QLY3y5xHhg1ULDlGH9r9Oa6r7fDSrC79fX8uEhrNC3Vt5iDGUG/B6D UWa9GxO8sid0OZjSYp4eh6LEBpDpYiItZsh82skau70gRxlezhODcd2woaBpCBUEFUVa 9vlyswKzQWol7IJPt23juqrsmpJHC17lXDBmpWp9EFUUHjUzaHrn9xB372lJWQGHlDAv koCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=PQ5gUxhZkoh4ZqQ1bcivI/3wrTPkC+2Pwjz27W6nqVY=; b=x1mwowtY1Yf6c+OFKzj++BVn0SkB8DjyIGRzH/BCnipkbjUWKFjZnV6BmZMTB4dZ+n tLYZxvwlvZfo08pnZJ/M9jzy6+F04vIh7hakE3QzHpzqLpzn5poQuaqmzxhCpKklwTgl SNOiTJ4Xfc+njtrV+jAMLa6nvOVTiceUJpdHekuLJQ+sOlEM5jUa1XwN5dpN4W75yAsE QuLZCPHmvz92f2iTdKdjWdAd21LBYf0T+eOU6G7TXykFJ0WVpNmrhNZq0DSl+G/NeHi6 F83iuQ2JamPMewebjK0TyzevpgFl3Cz8uv5Xz7CXa5mWQsfIQh7UknNJKL6rBOR5bM9y Q8VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hkWyuWg5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a63f64f000000b0043cad841eb1si18459372pgj.827.2022.11.09.18.18.59; Wed, 09 Nov 2022 18:19:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hkWyuWg5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232258AbiKJCOE (ORCPT + 99 others); Wed, 9 Nov 2022 21:14:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231571AbiKJCOD (ORCPT ); Wed, 9 Nov 2022 21:14:03 -0500 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0486713DD2 for ; Wed, 9 Nov 2022 18:14:02 -0800 (PST) Received: by mail-ot1-x332.google.com with SMTP id 94-20020a9d0067000000b0066c8d13a33dso402158ota.12 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=qnqiPuT1xGUlGB8lbBJUm26eYM9ya0oCuMNVvFvCc0JwiU+78sLTbtf3q9UQRvMLvf ZTfp1wFOOclYcWu9PuRhMRiMoMRlJVeNjSZZj7YgD0eKxG+6fR49MltkeM8WxcfjXUQg nAmtQNScCK0EHWpn0XtsBxpMUEG1I0gyaNhPAeZ7hBBgGI9GqnOQ6zNKkK76n2tNItiC sOJKyvhDKd+CCK4cQR6344tcQv/LI8rX0j+TO2aJlmhNEDaLymhLC8jGmeBR1mw1vrNE t7hn+hI4BL9MZpMgILHMaZDP7/i9BBv+4Gyl9jpDg7RRXIUPxDQiVh8iKSRs8w5yhbrJ dEow== X-Gm-Message-State: ACrzQf1BfJVNGQkUYWwKhur43qhg2HjzEn844LCqufEu9kWgDOYPbvQo GSg6Fnn3SbqDaCvnYVmfGt8CnA== 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 X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749073792777594488?= X-GMAIL-MSGID: =?utf-8?q?1749073792777594488?= 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; }; };