From patchwork Tue Oct 10 14:27:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 13415652 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 1FB19CD8C8B for ; Tue, 10 Oct 2023 14:29:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B5F888D00BB; Tue, 10 Oct 2023 10:29:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE84D8D0002; Tue, 10 Oct 2023 10:29:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98A548D00BB; Tue, 10 Oct 2023 10:29:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7A32E8D0002 for ; Tue, 10 Oct 2023 10:29:31 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 342121A0199 for ; Tue, 10 Oct 2023 14:29:31 +0000 (UTC) X-FDA: 81329784942.14.0E68D8E Received: from out-200.mta0.migadu.com (out-200.mta0.migadu.com [91.218.175.200]) by imf21.hostedemail.com (Postfix) with ESMTP id 870CF1C002E for ; Tue, 10 Oct 2023 14:28:48 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=YUXjCIGK; spf=pass (imf21.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 91.218.175.200 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696948128; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lBUz50yRXYSwkMpVqbF4xKRgGKpQYvwhtcgTljx7wmY=; b=st4UQvhA01KsCFjK2pX3YRK9WCagqIfLkKlFGWl5dAI/W711jQ8qoeOxPTYrCS2UeENpCe GyKYh2gBgLXTjk/KJwey3ylChTqqEW2wY9H6yv5PBJGYaGgwvVkHihd7aOPk22UnYAOdzn dZi53/eQzhSCqwvPUbpLUNueUjQaqzM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696948128; a=rsa-sha256; cv=none; b=sTVbEuQshtuuFcToULnTeV7cZRbULscQ6I0hBfoKYte9GIIyD1qZssbTLFXqs1jPlEKrDS syf5xQICyQCyqwNdBI6yXIJp2aIclwLMbQZ71/qomLz/0OoqWgEldX7qon5rMDn6VfBnt/ DLRFpbytdMZ/UbRxFvztMtqs+HcabIw= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=YUXjCIGK; spf=pass (imf21.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 91.218.175.200 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696948127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lBUz50yRXYSwkMpVqbF4xKRgGKpQYvwhtcgTljx7wmY=; b=YUXjCIGKTxNpExiRwy5wj5HYemZEfcJ9ufogB+8cHg/UjkS0SCbQYARvOV3YrvQJ8h+xbz Th5rey7xD3OZISdwToRtGiUKbk9WRMhfP9YBFG3zk/ZKVyPJvSt0FCzAdLhCmhLVFpVm/Q O+0tz8vCi9Sa5w73oy9N7qPq9/zVhQ8= From: Naoya Horiguchi To: linux-mm@kvack.org Cc: Andrew Morton , Matthew Wilcox , David Hildenbrand , "Kirill A. Shutemov" , Mike Kravetz , Miaohe Lin , Vlastimil Babka , Muchun Song , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: [PATCH v1 1/5] include/uapi/linux/kernel-page-flags.h: define KPF_FOLIO Date: Tue, 10 Oct 2023 23:27:57 +0900 Message-Id: <20231010142801.3780917-2-naoya.horiguchi@linux.dev> In-Reply-To: <20231010142801.3780917-1-naoya.horiguchi@linux.dev> References: <20231010142801.3780917-1-naoya.horiguchi@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 870CF1C002E X-Rspam-User: X-Stat-Signature: opji78a7hzmi6u3ha1ckfpe5eaezjh9o X-Rspamd-Server: rspam03 X-HE-Tag: 1696948128-123678 X-HE-Meta: U2FsdGVkX1+ffCN8z97UOMNGWGOE6wpkUkHVR0C9viaqCl/w2rb4h205daZk82wGE5+zFdIujHxzm6ADQ6L2n4woZoBBPpuAphX24xIsyEOtKjt+x+cT67JdjMzu94tFH12rywpdQAwqUyKtTKwyloPWhmcFXlWLU2R3kBOjHdABoiPhsBSKiZEtVIqrOTKeg/ptnQxGwg5WWtgL6WY3QEmuOBGmJLgCplv0xjzhqdCaJzXxb4uGT1uPBRCEtd6LXLhY9XcRL34hpGLXZ1I3MRN1G3nYAQQuRcsz7GOYj3AmKQcX1KUlkSBE2TIoxijDOHK6B+wkw5wNh3asbf6QhihFJ/kO+VsWLQBUkz7iWOd8c6atzy4tJTGbnTz5jPAQusSHaYXKs5emV1m5Puxs/f2ImKjqN3zIYidOBFRMCUpk+lmHMCi0Cq2nN6KEHKJju8O+TI1Ao28ymeD5TPshiXq7DNffdKLLfBVppX3vm2cT4lYZr1d9e1WnPJAI+Hozei6UfDk9IUqMUNu274cvP/poLsFtcB2E0AxKn26cFfJtpGY/vbuqEDrJY24Jginb/Yg641pRHz+WEX6qUrTtYhNLcoUs4ON0ZGE9znn5RL8ivCLBrsoNwNucjYZYDotPukSuUvl+R0NdkV3SvWgMTXHbDnkmdbfYMQU25suadsl53DIMrACnxCiRVvK7WkaexJU3OYa0nxmFSU6zfXrYbYsxVCi4aT9F9NOpoT53+gKHTOiN98bC1z2otByEEDsbm1pN/JfongmkTQCVfyuLcL7Inskx7gwg+GxoUeYKfQpMX7TyYupI8DA5AApDAytPuE5gm1IzAZxIJy7BJYbrjef6DWFE4wA0tZHnJ76Okwj0+JvRUeh0HnuJtRf7NQDGpTGaMQJFZN6Q8B531znMrqCFAASlMHO0JVTB/jJ85cdb8px5XIhY2yRg4pWEaIcODzA0jnPEm6FaOXXkKk2 2qZCdlaH SLvCD9mBybSpTSBqvFhFwvtSt9DOh3ym7dNSrws7Lbrxoe3yxOiJ2Cyjcos+07qdCUSXsYjDlvnIZvLIsl/hvtuSvpAx5Qtwt/VbHUU49jaoXxEolfFLsS+9kD5NCZI9jsh4NQ9IlT9VJ7XM= 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: From: Naoya Horiguchi Define a new KPF flag to represent folio in /proc/kpageflags and in-kernel user page-types.c. Note that in page-types.c I chose 'f' for the character representing folio, which conflicts with KPF_SOFTDIRTY, but we have no other choice because all reasonable choices ('f', 'F', 'o', 'O', 'l', 'L', 'i', and 'I') are already used. You need to pay attention to long flag names or the position of 'f' in short form. Signed-off-by: Naoya Horiguchi --- include/uapi/linux/kernel-page-flags.h | 1 + tools/mm/page-types.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/uapi/linux/kernel-page-flags.h b/include/uapi/linux/kernel-page-flags.h index 6f2f2720f3ac..9b43dadb7f49 100644 --- a/include/uapi/linux/kernel-page-flags.h +++ b/include/uapi/linux/kernel-page-flags.h @@ -36,5 +36,6 @@ #define KPF_ZERO_PAGE 24 #define KPF_IDLE 25 #define KPF_PGTABLE 26 +#define KPF_FOLIO 27 #endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */ diff --git a/tools/mm/page-types.c b/tools/mm/page-types.c index 8d5595b6c59f..b78448d19e88 100644 --- a/tools/mm/page-types.c +++ b/tools/mm/page-types.c @@ -126,6 +126,7 @@ static const char * const page_flag_names[] = { [KPF_PGTABLE] = "g:pgtable", [KPF_ZERO_PAGE] = "z:zero_page", [KPF_IDLE] = "i:idle_page", + [KPF_FOLIO] = "f:folio", [KPF_RESERVED] = "r:reserved", [KPF_MLOCKED] = "m:mlocked",