From patchwork Mon Aug 14 18:44:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13353177 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 E9FAEEB64DD for ; Mon, 14 Aug 2023 18:44:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 395FE900002; Mon, 14 Aug 2023 14:44:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F82F8E0001; Mon, 14 Aug 2023 14:44:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1712F900002; Mon, 14 Aug 2023 14:44:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0380D8E0001 for ; Mon, 14 Aug 2023 14:44:20 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8A47E40B7B for ; Mon, 14 Aug 2023 18:44:18 +0000 (UTC) X-FDA: 81123585396.23.2651896 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 3D086C0013 for ; Mon, 14 Aug 2023 18:44:16 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=C1+JK2sI; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692038656; 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:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=9iTUOPVpR05s9Fej91hxE4Ic4aCodt95xn8Dfhz/TxE=; b=fb83I7Ar5FNz143B4MhjlgZ74/w2wLf/lTqv0pBRxNx9jlOhe35yKwpZvHnC3eywzS2T4P T/QQzp3n1gCZJdz0BeuMKjWo+B+2A61Z+gvm9qRuQTK6wnc+HpFKYj3IcoRV9ix9IhKUq/ yU31U/8VommHCX9wYa7SucaENYrRVX4= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=C1+JK2sI; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692038656; a=rsa-sha256; cv=none; b=JKqBIAoKl9HZysv1RwxPEitCN4HMyS1GjTwXFipsek4aZ0HDiNkdrmhnpdPEOL+zADBS5K DzFVl3SPCdFDSNtqPmDEicjIO/+CAAvp3V0ZdBPL2/urDptEArH4eFtMPNP/lCg/n3BCfH 6LB3yhLdQSFNcgmBN4baGG/AXf63ZoI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692038655; h=from:from: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:content-transfer-encoding; bh=9iTUOPVpR05s9Fej91hxE4Ic4aCodt95xn8Dfhz/TxE=; b=C1+JK2sIG8nkzFG5Rs1rFmWWGQngZJf49eApEMU7XDEYJk5uwxZ86UG78N9P6gqTI6zq/1 b/beDClYdxS8NxyRZD2WvdrcTo6YYI3oL19mItthjgc8v8QcL3AnnNo0ZtA6upXR+R+HLe I21PrYt83LC0WsR9yA6oNu5271Qffk4= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-412-YbmMU4z3PR-OLRcDbk3IjQ-1; Mon, 14 Aug 2023 14:44:14 -0400 X-MC-Unique: YbmMU4z3PR-OLRcDbk3IjQ-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-64726969c8bso2205966d6.0 for ; Mon, 14 Aug 2023 11:44:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692038654; x=1692643454; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9iTUOPVpR05s9Fej91hxE4Ic4aCodt95xn8Dfhz/TxE=; b=GCvxwJ/8y/pg57d51uCB1/1NxHeKFglxq1MpzT4zpYTz2Sw683r4jhk5unuH+9+4Jl KRIBwNy1EeGvIk4mAiMiOyWlF4RD3nmeMG5hFovozmxJIQwdRr4kPDR3M5DVuw9nWDm5 JspSunxOJeZZAvV0ZCngevyG36ktKo4QasngQfDUQxlvrM4caQBnkGTXCZ1fKUtI8csG zQzBnd+0O+fxnHiF3niAjNmQk4yPRWlymQiOHTpLB8wao35LVaxeW5A9YwK+UMEaqf6c fxWIKj7ojxwQdmKNpsNnAqpyfXOFY5p8Ldt7j8z4PL+cJXoDGZvH/4yxbD1DiyI1Yelo JDPw== X-Gm-Message-State: AOJu0YxgkBZz1VkTZ22KhtghDbmtUabDFyc5Rno/66uErV4LuB8s4Bo3 CmqycZO5rO+sjpzZNrVh1OgaXagQPaOfjgF1beLRmJLYNEMQTBANOTJ7f9WCXIjLcTF1l0wTePj gJ9jcbQgWOyK7jKKsYn0DsJE7s4vCnoDh2W0SMm25nidFHAjl9Db1heb7gk/OcmhoOFSW X-Received: by 2002:ad4:5dca:0:b0:63f:64ba:a30a with SMTP id m10-20020ad45dca000000b0063f64baa30amr14356438qvh.2.1692038653992; Mon, 14 Aug 2023 11:44:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFeyh3eKc10g/0yp7GWzkw4JVDBRlb4+1uOV9vMR3RZXB0gmBEIT7v0wwyIa7N/SxFKb6puAQ== X-Received: by 2002:ad4:5dca:0:b0:63f:64ba:a30a with SMTP id m10-20020ad45dca000000b0063f64baa30amr14356406qvh.2.1692038653559; Mon, 14 Aug 2023 11:44:13 -0700 (PDT) Received: from x1n.redhat.com (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id a7-20020a0cb347000000b00630c0ed6339sm3566561qvf.64.2023.08.14.11.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:44:13 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Mike Kravetz , David Hildenbrand , Matthew Wilcox , Andrew Morton , peterx@redhat.com, Yu Zhao , Ryan Roberts , Yang Shi , Hugh Dickins , "Kirill A . Shutemov" Subject: [PATCH RFC v2 0/3] mm: Properly document tail pages for a folio Date: Mon, 14 Aug 2023 14:44:08 -0400 Message-ID: <20230814184411.330496-1-peterx@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Queue-Id: 3D086C0013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 5f6pchipxs6mmybmzx74aume4jidhktz X-HE-Tag: 1692038656-91288 X-HE-Meta: U2FsdGVkX18IOhq5Bt6H39C7PZac199hbP1CBu40+kO3y2Ni7Pa88XInl6Cb+j5AczVrF0DbP4soIIYmmAcOwKH4udu06C3cjEuvbVrrzN2A0tjBkZFZWxDf1iMQfDSAKsDMUhcQX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2W4i4TaN892ntd2occz10scfpHz9Cvo1XVKtvQOVbyqEeLWYcZTfLpwuW5A5UBhpkXbUJxnWecO8q1/6/VkrZTLDXmWZGksmMsgnxSKGkQM8j3Mxw5Ph5GySJjVZCt6FzgOM6WZgR4LJeHbcO7ckB/MNhddqoeEQIa7bUDHOm63nzcUz/oJ6ER1Sr1vfkzX3Py5v8iqnnytYMVV+LZjE7df8sgu5njB6HwshNSUX7VeA 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: rfcv1: https://lore.kernel.org/r/20230810204944.53471-1-peterx@redhat.com This is rfcv2 of the patch, where I split two small changes out from the last patch. Please refer to each patch for details. The goal of the series is to document clearly on how the fields in struct folio is reused over tail pages, and make it clear on what can still be reused as free. Smoke tested on x86_64 only, kernel-doc should have no change. Comments welcomed. Thanks. Peter Xu (3): mm: Add TAIL_MAPPING_REUSED_MAX mm: Reorg and declare free spaces in struct folio tails mm: Proper document tail pages fields for folio include/linux/mm_types.h | 60 ++++++++++++++++++++++++++++++++++++---- mm/huge_memory.c | 6 ++-- 2 files changed, 58 insertions(+), 8 deletions(-)