From patchwork Sun Dec 18 10:18:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyeonggon Yoo <42.hyeyoo@gmail.com> X-Patchwork-Id: 13076022 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 B4672C4332F for ; Sun, 18 Dec 2022 10:19:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F0508E0002; Sun, 18 Dec 2022 05:19:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 47AA58E0001; Sun, 18 Dec 2022 05:19:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 341248E0002; Sun, 18 Dec 2022 05:19:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 21E1B8E0001 for ; Sun, 18 Dec 2022 05:19:28 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E66691403CB for ; Sun, 18 Dec 2022 10:19:27 +0000 (UTC) X-FDA: 80255029974.26.8ADCC75 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf21.hostedemail.com (Postfix) with ESMTP id 57AD41C0004 for ; Sun, 18 Dec 2022 10:19:26 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NzidgMsU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671358766; 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:references:dkim-signature; bh=ERe/r2sSrZoK/GY0S6LEuDdiHuaRQ2o4UfuW7lVdOJA=; b=RoE2TEcGx4FoG6JONPqyE9j8eMyfIazcAKG/X/Mdc9j3zNK3523X8avyGh1OrI8kdMeh6t WexUiZTzsJCw5VURVwW8jvsM654orb/wyk3VlZIejybpwn2KFtyL4fAWt0ZeGXrsUXvwBS +GQBmlp6sp5yjjAe8uStMMAJKInJqTA= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NzidgMsU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671358766; a=rsa-sha256; cv=none; b=QxQRXp+6Z+5F0GGJjgkv47ke0Yh8o7jSgfTpP00G0a78+zEhDvXjWSx5HCqKSpEt5/hJxA XLX1vTvphrGWMtNlfRprYwVPfHPQPOJscboI3Pa9tJ75jaaVUjXbWzEDVnNbRbZn2PI5G3 W8n1ZezYjbzPrOYyhrjG+9q1UdTZOA8= Received: by mail-pj1-f51.google.com with SMTP id k88-20020a17090a4ce100b00219d0b857bcso6392581pjh.1 for ; Sun, 18 Dec 2022 02:19:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ERe/r2sSrZoK/GY0S6LEuDdiHuaRQ2o4UfuW7lVdOJA=; b=NzidgMsUv/PXs06KQ1wiEISb3hVNDjxnjvZ03vdtNPZ+wQrwGZ+beCSj1jS5UCnrOm EcwJOQxR5C24LhdzxFXchQ3CjlIgeflvZ9Ffd5od6T7TJMiVhGo3QhVoLKYNIUcqKFrc SB9H7hMqHpwSqMCjPqlardUQjGuslebXpsCBHDuUQ0VFGHomt8PW1+87G9HhJVZBBRvI NJl9sZk1LqboH0x+TGGRD/fl6yVEbou1laIZ8ytEtOJKUVYtqtm2ntB5Ju2PMrpvPtCF w5O0ZWeTaady6ZWy4F7dZIS9qzLSAGmfkTDp4WQWVo9CsE0pOsYLcS3PtTly57hWQwcq zDhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ERe/r2sSrZoK/GY0S6LEuDdiHuaRQ2o4UfuW7lVdOJA=; b=4A4WbRY985S4E2zSnK6sAr7ZqZgHkuuti8OI6LcIhYp4q2XQXxvUUFetT9z3Lmy3Jf E6REyPx4w/tduYuWSJncZl90dLS1OTPlB0QXGAVIg5+ZofgIZN/4P/6VRrUsjUe3Pf7s 003W1YdnSr4enWxv6RFj3n7/4u27BEjEggnIhD84Ge8FhwcyhfKITJ3CHpsnk/+hLY0n dg9H44EZgcWLPQ3wLXH8GwdBZaPEEtpvirykJqKAY7vyo/EskS0452sCvbE39qNMe8/J LS6KYAkp+0ZxM96JW2gaPvjC2Mm8kVokIt2iwsu0pFwBoSG2LVXYJmNGXIiKLA7w3kZj HOQg== X-Gm-Message-State: AFqh2kq7hngdy2+XH3rSmKVXSulfZNdqnBPFg17qVnjz0BA0fbu3WNWv 0+IaDexr/JBlfSWO+rsokpU= X-Google-Smtp-Source: AMrXdXt3Qc6Z+OskCRLL2iIYYRcpfIiOSjKvwM/qlDjcbNGQ72fpb+5p9Oct7I9A1nW4i/QOOzW8xg== X-Received: by 2002:a17:902:e80c:b0:189:985c:849d with SMTP id u12-20020a170902e80c00b00189985c849dmr7076606plg.1.1671358765219; Sun, 18 Dec 2022 02:19:25 -0800 (PST) Received: from hyeyoo.. ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id ik11-20020a170902ab0b00b001897bfc9800sm4789791plb.53.2022.12.18.02.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 02:19:24 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, =?utf-8?b?SE9SSUdVQ0hJIE5BT1lBKA==?= =?utf-8?b?5aCA5Y+j44CA55u05LmfKQ==?= , Joe Perches , Petr Mladek , Andy Shevchenko , Matthew WilCox , David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC v3 0/4] move PG_slab flag to page_type Date: Sun, 18 Dec 2022 19:18:57 +0900 Message-Id: <20221218101901.373450-1-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: 57AD41C0004 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: xmsr6yrcx4ux9rjnnu91snxz7zrh7u5c X-HE-Tag: 1671358766-249872 X-HE-Meta: U2FsdGVkX1+XDW8IRqsoaFJKj1TM5jZAlUOc+QXsEwFwTF/nmQHWRkXynCqOa5935V8Se9ZTDoQJGlktjPUcbzQelnkD4B6sYWfKkWt7wxkIXG1jCczUKw/9y0eW2pYvEyilotILfvd2vEPD2NP+JJ2QWWxM8ZzdiNQwzMyd+QDR75q79Eozfmlfe7xIUdBDj5E8XeyLfKggDS2mWYqbAxkaful5PinyXxNvjobB3JRMHrTjW6MS6CHdhGmEPGB8WnfS1KmpZgu7IViCXqcBj/au9GDY48Wdx24fY5LYqiCEWNY/IKx2OL7e02MJoB2srm5ANS2oWesG9kTRsNE3gfyLKBN0kFQYAc5aG2oYHHaFlfZezEsOHbUIHUOghAd31kd9PJgUqPRHnf8JMfUIPK1IJkdLdXNSua4KBHrIqGpn2Av1P6ap3vNMuEst8OhofCw/juHvnVwvACeWiv2PAUTi2IwgVuXzUokQVoMxj6uc1EUP/vQYrbdfLNBB35hR4uK2e+VedaLJs9p1W80fNjtYmL6QtXxgVxhhnxUu79Kn0DjVa7yE5vYIsSYg/RduVevsG8aixnxrB42PBdjYzNrDjr0TrHZwlL00HjYZTZB0FmXcDSLP0Tqg3Sz/0T9eikXO0WRoXB8T1MYxseIUA5EYSXDBLlHZHFa58SPK4OQu5ittQKDgM+xmcfiryGvlDe4SKHNQB0qN4srb4IZ5J+Dkt/pze1EoID1dp97OL8M11T4ty066dgFtdMztlmkCG6xmgCKJ5IOCSaCLRQCxklg+gb0/+O64W6Kr868wxipqtAdXpJWaKdfxfyuiY4+O2jD1odQ64BmpEyB9ezKUGU7VHW40XksfaJZTV0L3emNmEn2jzgy/pEh2Opim75f920TbHfZRF6C9miXAODYdM3rjgPdy3efdr5/DOVDdTxDaQtFlB56hhRplRc3ToXZ/sP17/CjeQ6mdNc97umL Tdn6/lR4 GpWqZTHWRffdri9cVy56USlSikZKF21+N5vG6q0CF6sei8hgTWzWwbuIavjTDFXOURhL2NQFAcclxTV3HczVTN2aV1x6In0jLLShuoLQP4yeZBWxhd5zwtVhc0Qjs2AgwNTmvmcZbzU5NtAZP4v9y+44X29vt55A7iRIba1Qytr3FkfZqDdlB6CuMx6C789yUROREzt6CW7Bgn1TTvHGyFqeJTwGVeOCNO6GKLB0hEUN1Xrmdau0qQkU2GtVcx1FH6NQQf1MTT2syoRl/XTalS8kgYA== 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: RFC v2: https://lore.kernel.org/linux-mm/20221106140355.294845-1-42.hyeyoo@gmail.com/ This patch series moves PG_slab page flag to page_type, freeing one bit in page->flags and introduces %pGt format that prints human-readable page_type like %pGp for printing page flags. See changelog of patch 2 for more implementation details. Thanks everyone that gave valuable comments. v2 -> v3: - dropped show_page_types() in a thought that it is not interesting to track refcount of non-usermapped pages. - added patch 1 that cleans up MF_MSG_SLAB in hwpoison - split implementation and application of %pGt to separate patches. - instead of printing "no page_type for ..." in %pGt, just print '0x()' for a page that does not use page_type field. Hyeonggon Yoo (4): mm/hwpoison: remove MF_MSG_SLAB from action_page_types mm: move PG_slab flag to page_type mm, printk: introduce new format %pGt for page_type mm/debug: use %pGt to print page_type in dump_page() Documentation/core-api/printk-formats.rst | 3 +- fs/proc/page.c | 13 ++-- include/linux/mm_types.h | 11 ++-- include/linux/page-flags.h | 77 ++++++++++++++++------- include/trace/events/mmflags.h | 8 ++- kernel/crash_core.c | 3 +- lib/test_printf.c | 26 ++++++++ lib/vsprintf.c | 21 +++++++ mm/debug.c | 7 +++ mm/internal.h | 1 + mm/memory-failure.c | 10 --- mm/slab.c | 44 ++++++++----- mm/slab.h | 3 +- 13 files changed, 162 insertions(+), 65 deletions(-)