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: 150825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp243848vqb; Tue, 10 Oct 2023 07:29:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHBC2TtQQ+mbl5X9t31bLwtNjf0OaFzwEOGVlpWcrQB1M/a8we/Q2E+07YSMgDIYUNhvo5 X-Received: by 2002:a17:902:e5c7:b0:1c6:ec8:4c67 with SMTP id u7-20020a170902e5c700b001c60ec84c67mr18139008plf.18.1696948176111; Tue, 10 Oct 2023 07:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696948176; cv=none; d=google.com; s=arc-20160816; b=MnPcYDa12+SjnWDrZJrn+ZWHTutcaCzwxPXmfFSne8L++FuzlY/K7ZgIAHrOLEKWqb hUBOGbxkgOhZ438mMkilKt/Sxs81kLfjP+FoUKbpZp0GH3x3XHSsInnj5VQkvgskHmeT AqEE2CvCwgnbyTQKVmsGdUmNVEkMECYI5yJTfdYYbj3nhfBAkN2n2f12wfZw4eO77I6D 33y69N1dZWJU9uOsRwAora6isXGTLeeF87FnFgIH9IY9+uT0ytIO/P3PBAJTxhxgK8Yv u6sOQd9lZTNrBEBr9fEa85la+nWVDZzx95xZb/9pq+nt934io3b12IzS3D57kPiYXKvU COIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lBUz50yRXYSwkMpVqbF4xKRgGKpQYvwhtcgTljx7wmY=; fh=vd113QmVxKSP0xyTVgYADqM2Ffy1JHXPefyn38Zlb+8=; b=hjr/EK80+v1MWCBY/u9eWU8pGxG2EWRHBrWlqrMhfQ+PbaYbAqoTv0ynrQy+oyKhFB 8jeh5OWXMw4H+5jCo8oyd0fzuJcd69+rpk2sacCNQByWV25v7JN2RA7TNYTz+j9k87qt 7yqxUXyvhAfe/m1PdXpq22XOr0iVl3zNzUJp2N6Vli04js//AxXYAaKJxFuLMWRuMO1h zRmNcKbnog3t0f740woQ7mZ7EyF9/OPX9o7cQIh0CFkajIR3oMXEfRd/r+THVtXziSym AZs5CkXKGv7gl3nFFcPCBCN354jr/J7ym0BUSMevK2LsCXPtMtp0+r1x31DqTVjG/7kO tVhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YUXjCIGK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id kh8-20020a170903064800b001c42d60b9e6si1451622plb.112.2023.10.10.07.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 07:29:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YUXjCIGK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E7B5181C8091; Tue, 10 Oct 2023 07:29:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233162AbjJJO3O (ORCPT + 20 others); Tue, 10 Oct 2023 10:29:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233348AbjJJO2x (ORCPT ); Tue, 10 Oct 2023 10:28:53 -0400 Received: from out-200.mta0.migadu.com (out-200.mta0.migadu.com [IPv6:2001:41d0:1004:224b::c8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AD56103 for ; Tue, 10 Oct 2023 07:28:51 -0700 (PDT) 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-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 07:29:31 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779379130993518638 X-GMAIL-MSGID: 1779379130993518638 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",