From patchwork Wed Jun 19 06:33:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13703443 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 954FFC27C53 for ; Wed, 19 Jun 2024 06:34:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 938F96B03BE; Wed, 19 Jun 2024 02:34:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E8A76B03BF; Wed, 19 Jun 2024 02:34:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B08B6B03C0; Wed, 19 Jun 2024 02:34:03 -0400 (EDT) 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 5E33F6B03BE for ; Wed, 19 Jun 2024 02:34:03 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BF1CB12041E for ; Wed, 19 Jun 2024 06:34:02 +0000 (UTC) X-FDA: 82246673124.20.9A6560D Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf01.hostedemail.com (Postfix) with ESMTP id 0DB9F40004 for ; Wed, 19 Jun 2024 06:34:00 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=iQd43sR2; spf=pass (imf01.hostedemail.com: domain of 313tyZggKCNI76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=313tyZggKCNI76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718778836; 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:in-reply-to: references:dkim-signature; bh=Thr9Il/urEoF/gNwdLNFoNiyviU1lTVZg/L0ou2KXqU=; b=KrxeS8YBRztufCTogA2BWMqnLiVsGxvK8ERpqFk87fqSvRQRDWInCqyhGOud/m9H6PrJBi 9Qid4XZn9yo4RXXJwWcCqGATyvrcQL15PMTqywn6ZdHylCGKqk+oPETnjcnpKxqV/EtQo1 D0rKWvt6Xb2CHNjbIfx1c7AXN3Jlmkg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=iQd43sR2; spf=pass (imf01.hostedemail.com: domain of 313tyZggKCNI76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=313tyZggKCNI76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718778836; a=rsa-sha256; cv=none; b=IQ7H4CDSdbcfTQVuxy2P0tXik6/YgM+36qsRuT/cOfkxCS7kBS9TZ7a5sDX7iWgAlIO6Cg gYAXx1Mdmcu09f2yhL5nMCoS+GZtMb3BqZSzjZcl7o73Eyffax8TCQhdnG9sznmvan2PSm 9o5t1mmLowUcMl0zeTpXn2mxFL5gK88= Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1f9b6b2fb8aso1186775ad.1 for ; Tue, 18 Jun 2024 23:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718778840; x=1719383640; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Thr9Il/urEoF/gNwdLNFoNiyviU1lTVZg/L0ou2KXqU=; b=iQd43sR2KH4WbU06MuHQiMO8Z/gnCxMUXbEOy1LEPYLJC+mCN8ENnlThPSnSDwakuT YtszShoL092TELiwksHOcbtQuOyrnLsA6AUXjv4/Kf7bTAtqP9oQnMsQJSzR33O4I084 wKVlokk7qlEliTIdLylGJaOZfpeqf1eJIM9RS/XHt3hmlXiIpcpDwbOcVG3lTBjcMJ4L GB2hIPBJ45GYe/gXU6NvP7yveA1xvMG12pscglZtohgEYS3g4jlFjmMQ/pp/DVV3xxrR qF5dGnEMhcdxG/+FsDIMD5CfxXa2oqFXoOn3PcE0x0IeWX2PMYj0uOdBpTOyMojkQ5Cc SaIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718778840; x=1719383640; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Thr9Il/urEoF/gNwdLNFoNiyviU1lTVZg/L0ou2KXqU=; b=E2iWzmZ9l/XHjv5bPOsP8mODQL16bmzKMWfqc8Vgofl8ampWtfSnapJm9zDj3nuVqh E7R914rPRAa/EpkZZcGeIa/9ArNK+7zU7Oa1ovwRf5tOBqvi0MoChUSqxRs2QSxxvTIv qjhhVjCp7Ycn6yrGvKoR//rSOa2P++PD5IVDckDHOx8R6iigkb0NYdomlVPCZVygV3N/ B9XUy0G6X/PEQqaHLnxftRBwrAwdK1aoVy2ugg/+7XbawNQu8vULcgi90911ypDY3dhm 50ctbs7BA4nWGDs7IjUaPVfmNfvKuJ8mOalF/8Db3JFOxpd1CZmn8mbw72urjcxB3lIe 1K8w== X-Forwarded-Encrypted: i=1; AJvYcCXJwDOByOUfrPLq0ZhU9kgRWzRUBnvlDsWrDMSwq+yTVz15AexpHdtrozrLW3xStq4VAZFOzdjaI2liu3zCX6dr1sQ= X-Gm-Message-State: AOJu0Yx1ww9pc2JXvdiw6eM53rd9y8FPmDBxvw7gVPbI7x0SkrFAGOVk HLKdnv6dij8GnFVbdK2x9eNd2W4OZowJCcu5vOwGzhbtQpg1mXpYvI8+GF2s5HKstUlG4AD9mj5 bfbuaUpCl8Q== X-Google-Smtp-Source: AGHT+IEQhJSlWTDa6UF6GZIqW3v8Da6EZ9Gsk7ClnKo/GbrOZJNBj2iixMaQGxXGEk6iF/o65c3ROmv3Xr3BCg== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:902:daca:b0:1f7:c0c:9f79 with SMTP id d9443c01a7336-1f9aa3ab729mr58045ad.3.1718778839345; Tue, 18 Jun 2024 23:33:59 -0700 (PDT) Date: Wed, 19 Jun 2024 06:33:55 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.627.g7a2c4fd464-goog Message-ID: <20240619063355.171313-1-jiaqiyan@google.com> Subject: [PATCH v1] mm/memory-failure: refactor log format in unpoison_memory From: Jiaqi Yan To: nao.horiguchi@gmail.com, linmiaohe@huawei.com Cc: jane.chu@oracle.com, ioworker0@gmail.com, akpm@linux-foundation.org, osalvador@suse.de, linux-mm@kvack.org, Jiaqi Yan X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 0DB9F40004 X-Stat-Signature: xjwxjzf8kc4e1ezwkfswwbxe97e9z91i X-Rspam-User: X-HE-Tag: 1718778840-583244 X-HE-Meta: U2FsdGVkX1++pC7GFm0I9W8UP3fPEnp8DMSWxlEKWfGT/pk6znXynebxBGh1TF5U7/VwwVYW6EOMAKAdnNgfWMg8SffqUOaGyzJ//1spedq5Bk/7o2R/FutJBD3MUEndsXZnTaQrSoRTckS1e6NriGyNJxnrWawjYFpaJvPreJME45EHJWDfCVczJv/nCuj/HUZG2e8qBAzQt/J9X/U6k57lml6e8TEJ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f/G3MVlqIgyCBHypOpmQsBeddRXANrFUzBVRryHxCJrrTF32qDveHNSkORou1K7GMlTHhqNz50Rr9RGtfy4U2AfiXJILLVknFCqfq+G9S+TyWyrH2AqFdWe7M2vc9T6kxV6J0MFRtpKhT7SHPX2H05V0si9WLCAISGoN6YaMNyTWyYzrLnztlD2CPxpXxhbyL+2/Px/bOHGqfrGjvQQEieo4nGJrHEk0O4AvU4HKkXcU9OKr56Y3tQNkAwC3vXQ3g1WSGI5gnuDndW+wVRCn6HVE1ioAJg184seaHdzNbMr1AV0x7zO3VI3yoy2bQ3YJmlMI6wdg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000023, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Logs from memory_failure and other memory-failure.c code follow the format: "Memory failure: 0x{pfn}: ${lower_case_message}" Convert the logs in unpoison_memory to follow similar format: "Unpoison: 0x${pfn}: ${lower_case_message}" For example (from local test): [ 1331.938397] Unpoison: 0x144bc8: page was already unpoisoned No functional change in this commit. Signed-off-by: Jiaqi Yan Acked-by: Miaohe Lin --- mm/memory-failure.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index d3c830e817e3..3a3ba8ad1745 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2502,7 +2502,7 @@ static int __init memory_failure_init(void) core_initcall(memory_failure_init); #undef pr_fmt -#define pr_fmt(fmt) "" fmt +#define pr_fmt(fmt) "Unpoison: " fmt #define unpoison_pr_info(fmt, pfn, rs) \ ({ \ if (__ratelimit(rs)) \ @@ -2540,27 +2540,27 @@ int unpoison_memory(unsigned long pfn) mutex_lock(&mf_mutex); if (hw_memory_failure) { - unpoison_pr_info("Unpoison: Disabled after HW memory failure %#lx\n", + unpoison_pr_info("%#lx: disabled after HW memory failure\n", pfn, &unpoison_rs); ret = -EOPNOTSUPP; goto unlock_mutex; } if (is_huge_zero_folio(folio)) { - unpoison_pr_info("Unpoison: huge zero page is not supported %#lx\n", + unpoison_pr_info("%#lx: huge zero page is not supported\n", pfn, &unpoison_rs); ret = -EOPNOTSUPP; goto unlock_mutex; } if (!PageHWPoison(p)) { - unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n", + unpoison_pr_info("%#lx: page was already unpoisoned\n", pfn, &unpoison_rs); goto unlock_mutex; } if (folio_ref_count(folio) > 1) { - unpoison_pr_info("Unpoison: Someone grabs the hwpoison page %#lx\n", + unpoison_pr_info("%#lx: someone grabs the hwpoison page\n", pfn, &unpoison_rs); goto unlock_mutex; } @@ -2574,13 +2574,13 @@ int unpoison_memory(unsigned long pfn) * in folio_mapped() has to be done after folio_test_slab() is checked. */ if (folio_mapped(folio)) { - unpoison_pr_info("Unpoison: Someone maps the hwpoison page %#lx\n", + unpoison_pr_info("%#lx: someone maps the hwpoison page\n", pfn, &unpoison_rs); goto unlock_mutex; } if (folio_mapping(folio)) { - unpoison_pr_info("Unpoison: the hwpoison page has non-NULL mapping %#lx\n", + unpoison_pr_info("%#lx: the hwpoison page has non-NULL mapping\n", pfn, &unpoison_rs); goto unlock_mutex; } @@ -2599,7 +2599,7 @@ int unpoison_memory(unsigned long pfn) ret = put_page_back_buddy(p) ? 0 : -EBUSY; } else { ret = ghp; - unpoison_pr_info("Unpoison: failed to grab page %#lx\n", + unpoison_pr_info("%#lx: failed to grab page\n", pfn, &unpoison_rs); } } else { @@ -2624,7 +2624,7 @@ int unpoison_memory(unsigned long pfn) if (!ret) { if (!huge) num_poisoned_pages_sub(pfn, 1); - unpoison_pr_info("Unpoison: Software-unpoisoned page %#lx\n", + unpoison_pr_info("%#lx: software-unpoisoned page\n", page_to_pfn(p), &unpoison_rs); } return ret;