From patchwork Wed Aug 21 17:39:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13771934 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 30581C531DC for ; Wed, 21 Aug 2024 17:39:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B02CF6B0167; Wed, 21 Aug 2024 13:39:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AAEF46B0168; Wed, 21 Aug 2024 13:39:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 927E86B0169; Wed, 21 Aug 2024 13:39:30 -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 731096B0167 for ; Wed, 21 Aug 2024 13:39:30 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2616E1210E8 for ; Wed, 21 Aug 2024 17:39:30 +0000 (UTC) X-FDA: 82476964500.04.3781765 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id 6CD7B1C0016 for ; Wed, 21 Aug 2024 17:39:28 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=dnEyN228; dmarc=none; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724261909; a=rsa-sha256; cv=none; b=Op8VSM1nArCTWOPliVc1SYJxLNmmHFKseRF2n+7nU1OF5O7T7eLcnn/IEVC3AJh9clmBIj 75bF8vG8kRFhMmbGxTjSFES4D9ZsKhbFi/gYFJ7zDWIS1DkFMeqMLICT53NpKh7Re2hRls JE3adhkuv8+NdkTMtSZbcRQ3iZO9C10= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=dnEyN228; dmarc=none; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724261909; 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=9J1dGJEjyIookDWkyWXpEPOywLE9l1WgoXewdQk9plQ=; b=ZB6pTh0RzpYuEIMckjmeOiWgUKviQ8ZYR7u1pBbSX2eRseCZtaa/g8Q918D4nvM7VCEGpo VxMUiv629GtGI7wOqTZ5dfkkjxbSA6qHgtZOfX/e6f1XFjUPz86z3wSVSfeHSBDh2sqMYq mdwlmyHEjFAfRsTypCoTaOvWGDzCQZ8= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=9J1dGJEjyIookDWkyWXpEPOywLE9l1WgoXewdQk9plQ=; b=dnEyN228r3HZhqbBP/e8fuzrXe HwKC5tCjx9+g4rCFe25bArQ21PYYdaOtpcBZl2OCaVwJEs3lmroahts1xBNABWaWCpxwz01i+FmbZ tF11jgUb6BT5u+QpnE6Rn9Z4dF60jPA7mc66CN9qVjFg02nmF4trpLYgc0rT/Ot2we+KNuGTcYE34 iNvRaQ4puiQfQbuheBQodgjnI/RS5jY3UzsakzQ2SaLuk/v3KVAsDO37zpac5zDj9+Xn4HJiXg+Qz 9eW7It83b9zlFY6xjKMNcCWBU1kOzHiuQXn/PpEjjJV2Cy2/CYV28mkaWnrsXUO5cxKBa4MchRq/W 2ul6pE0w==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgpIi-00000009WdI-0gWR; Wed, 21 Aug 2024 17:39:16 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , David Hildenbrand , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, Kent Overstreet Subject: [PATCH 1/4] printf: Remove %pGt support Date: Wed, 21 Aug 2024 18:39:09 +0100 Message-ID: <20240821173914.2270383-2-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821173914.2270383-1-willy@infradead.org> References: <20240821173914.2270383-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 6CD7B1C0016 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: bp4je46mb9mbghsp5i9g8rihtduueq9s X-HE-Tag: 1724261968-443834 X-HE-Meta: U2FsdGVkX1+TCxSrQKHHaVcLdSW0QdyAmaVFEmo92KYQaAka5zaXLGagqL9NnsOsCU9WJFRaEKWj9g+Sbd8bWXbemt9iMVeijsvkz1U05OguNxklJPAQvR/KLDAvyysPw07oPMY2vdNXQN8AO7flJGQKMJRt84HChRnIuAbkzXhdGvUW8rD86PeH4oJ4PVkO7aKy2EPhLorIU1hOUW+RWdR1VVbgPWgy3nZZnOA+ZfqyaFKJYpnIeL7IkoNo4mWTgkhGFBcHV2Cgkhr5vxpkkBs0RSFMaNwWNz3Nmt/JJcWmvo6SwfEmWjE0fVpMjP1LYOjetwo3DjzfjleW5QACCOraWoEyKOfck19C379zriLyzz4Wd95IC9M32rgPk0FEO9o8Pjmre8lNKIYAqDjB2/TQiJYTRRtisa/Zn2hX33bMzQLLmO0VX3vPWpMnf5nuukGo3EA+58dSd0LSgceDW71HpEdemGVlzkUu9DafcPrAPGALjiTs2CmlLAK2yuPkcaxhbeXGO1ewVcF3DiiLA7OdFdSsE13OItjKWQtLdvdrb/BzGEJJl/MPqN3HSokpKeKqhAbkDe+ijDwTsYNw8Vdyw/50ORFtUtbz278Xm7wb82av/95mmYWpaCRQhGc49gIxEa+IKPvKWabFOuCO3o7bhV8ZfScrLkGw3Vpig9u+xRES/P5wQoENZk671iO0d5prCxoNUFxcKhZC1SiEhajQTOgr+DQVaj2u5J62Kyz5+JgUgHPsgrUJEBb2ur01GoG1tCHUmmgKA/S0Bpmb3kMRo0XCXAZL3ybEpi/9ZAo9LsmBQNAs5LlVeYusxZUUoTQmAPlYHfrv+UkFSQZ6GeCyuX4qxU77WXHwEsSGRGU8R/WQjnjHwdcbQuBEyutAXynFN/H8ZZdTr++JHqjhE2qWZOelt92ZmVVySY1Y1XROZxZKd2dJZuiOhlFXp3vFuSqEEg76BOBvDanGiAg W63Qo3zy 5+gMLZH2LK8CXaOLFOB4hrc6CbE0BGpBcCfZsreIn3+Sbf/fVXl/nl/zbR06gHNr8DvgNDhALN82RYJr/gqDjrRWoZyt+PXiSdnpszo8qtnyVlnV+rIllked5DiDmR4C8ukllVAgPULADmsP2rrJSlEJvvRVgWOBYfgsJyOJZyiNf9D1JXBcjvVQcp7nL5sZHCMr8mG6TF0G6370mLyWg8oSwsCxMwTF3nU3HHLqsz+gi8tm+qJtPmeAtoKezVDLxjMt+hztGVof6g4r1Z7RepUdN27smiDm2uCWt 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: List-Subscribe: List-Unsubscribe: An upcoming patch will convert page type from being a bitfield to a single bit, so we will not be able to use %pG to print the page type any more. The printing of the symbolic name will be restored in that patch. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: David Hildenbrand --- Documentation/core-api/printk-formats.rst | 4 +--- include/trace/events/mmflags.h | 10 --------- lib/test_printf.c | 26 ----------------------- lib/vsprintf.c | 21 ------------------ mm/debug.c | 2 +- mm/internal.h | 1 - 6 files changed, 2 insertions(+), 62 deletions(-) diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst index 4451ef501936..14e093da3ccd 100644 --- a/Documentation/core-api/printk-formats.rst +++ b/Documentation/core-api/printk-formats.rst @@ -576,13 +576,12 @@ The field width is passed by value, the bitmap is passed by reference. Helper macros cpumask_pr_args() and nodemask_pr_args() are available to ease printing cpumask and nodemask. -Flags bitfields such as page flags, page_type, gfp_flags +Flags bitfields such as page flags and gfp_flags -------------------------------------------------------- :: %pGp 0x17ffffc0002036(referenced|uptodate|lru|active|private|node=0|zone=2|lastcpupid=0x1fffff) - %pGt 0xffffff7f(buddy) %pGg GFP_USER|GFP_DMA32|GFP_NOWARN %pGv read|exec|mayread|maywrite|mayexec|denywrite @@ -591,7 +590,6 @@ would construct the value. The type of flags is given by the third character. Currently supported are: - p - [p]age flags, expects value of type (``unsigned long *``) - - t - page [t]ype, expects value of type (``unsigned int *``) - v - [v]ma_flags, expects value of type (``unsigned long *``) - g - [g]fp_flags, expects value of type (``gfp_t *``) diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index b5c4da370a50..c151cc21d367 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -130,16 +130,6 @@ IF_HAVE_PG_ARCH_X(arch_3) __def_pageflag_names \ ) : "none" -#define DEF_PAGETYPE_NAME(_name) { PG_##_name, __stringify(_name) } - -#define __def_pagetype_names \ - DEF_PAGETYPE_NAME(slab), \ - DEF_PAGETYPE_NAME(hugetlb), \ - DEF_PAGETYPE_NAME(offline), \ - DEF_PAGETYPE_NAME(guard), \ - DEF_PAGETYPE_NAME(table), \ - DEF_PAGETYPE_NAME(buddy) - #if defined(CONFIG_X86) #define __VM_ARCH_SPECIFIC_1 {VM_PAT, "pat" } #elif defined(CONFIG_PPC) diff --git a/lib/test_printf.c b/lib/test_printf.c index 965cb6f28527..8448b6d02bd9 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -641,26 +641,12 @@ page_flags_test(int section, int node, int zone, int last_cpupid, test(cmp_buf, "%pGp", &flags); } -static void __init page_type_test(unsigned int page_type, const char *name, - char *cmp_buf) -{ - unsigned long size; - - size = scnprintf(cmp_buf, BUF_SIZE, "%#x(", page_type); - if (page_type_has_type(page_type)) - size += scnprintf(cmp_buf + size, BUF_SIZE - size, "%s", name); - - snprintf(cmp_buf + size, BUF_SIZE - size, ")"); - test(cmp_buf, "%pGt", &page_type); -} - static void __init flags(void) { unsigned long flags; char *cmp_buffer; gfp_t gfp; - unsigned int page_type; cmp_buffer = kmalloc(BUF_SIZE, GFP_KERNEL); if (!cmp_buffer) @@ -700,18 +686,6 @@ flags(void) gfp |= __GFP_HIGH; test(cmp_buffer, "%pGg", &gfp); - page_type = ~0; - page_type_test(page_type, "", cmp_buffer); - - page_type = 10; - page_type_test(page_type, "", cmp_buffer); - - page_type = ~PG_buddy; - page_type_test(page_type, "buddy", cmp_buffer); - - page_type = ~(PG_table | PG_buddy); - page_type_test(page_type, "table|buddy", cmp_buffer); - kfree(cmp_buffer); } diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 2d71b1115916..09f022ba1c05 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -2054,25 +2054,6 @@ char *format_page_flags(char *buf, char *end, unsigned long flags) return buf; } -static -char *format_page_type(char *buf, char *end, unsigned int page_type) -{ - buf = number(buf, end, page_type, default_flag_spec); - - if (buf < end) - *buf = '('; - buf++; - - if (page_type_has_type(page_type)) - buf = format_flags(buf, end, ~page_type, pagetype_names); - - if (buf < end) - *buf = ')'; - buf++; - - return buf; -} - static noinline_for_stack char *flags_string(char *buf, char *end, void *flags_ptr, struct printf_spec spec, const char *fmt) @@ -2086,8 +2067,6 @@ char *flags_string(char *buf, char *end, void *flags_ptr, switch (fmt[1]) { case 'p': return format_page_flags(buf, end, *(unsigned long *)flags_ptr); - case 't': - return format_page_type(buf, end, *(unsigned int *)flags_ptr); case 'v': flags = *(unsigned long *)flags_ptr; names = vmaflag_names; diff --git a/mm/debug.c b/mm/debug.c index 69e524c3e601..9f8e34537957 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -92,7 +92,7 @@ static void __dump_folio(struct folio *folio, struct page *page, pr_warn("%sflags: %pGp%s\n", type, &folio->flags, is_migrate_cma_folio(folio, pfn) ? " CMA" : ""); if (page_has_type(&folio->page)) - pr_warn("page_type: %pGt\n", &folio->page.page_type); + pr_warn("page_type: %x\n", folio->page.page_type); print_hex_dump(KERN_WARNING, "raw: ", DUMP_PREFIX_NONE, 32, sizeof(unsigned long), page, diff --git a/mm/internal.h b/mm/internal.h index cde62b16b71c..a70547d33e0e 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1153,7 +1153,6 @@ static inline void flush_tlb_batched_pending(struct mm_struct *mm) #endif /* CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH */ extern const struct trace_print_flags pageflag_names[]; -extern const struct trace_print_flags pagetype_names[]; extern const struct trace_print_flags vmaflag_names[]; extern const struct trace_print_flags gfpflag_names[];