From patchwork Thu Jun 20 18:48:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13706247 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 9A3AAC2BB85 for ; Thu, 20 Jun 2024 18:49:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC8408D00D2; Thu, 20 Jun 2024 14:49:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D4CAC8D00A7; Thu, 20 Jun 2024 14:49:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB5B08D00D2; Thu, 20 Jun 2024 14:49:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 752FE8D00A7 for ; Thu, 20 Jun 2024 14:49:04 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1F65012043D for ; Thu, 20 Jun 2024 18:49:04 +0000 (UTC) X-FDA: 82252154208.02.1717D62 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by imf28.hostedemail.com (Postfix) with ESMTP id 46995C0017 for ; Thu, 20 Jun 2024 18:49:02 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=kMh5Vu2G; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of 3nXl0ZggKCJwFE6MEU6JCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jiaqiyan.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3nXl0ZggKCJwFE6MEU6JCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jiaqiyan.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718909334; a=rsa-sha256; cv=none; b=fyEGkjQ9PU1CsXvxBZlz+QpKeG8Q9dV3OYws3Cz2BEQmDKxVkxWw8SkYQuZsayBr7we3vQ xwt8FF8qO8FvjDXG3eO57JcEceVTZ8Xka3Rhc75AmDZPEVYXjRq16rvyf7n805I2LkT46g 5CGPEUNsOBXwHy1vPrtFBF8kqbwSLUo= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=kMh5Vu2G; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of 3nXl0ZggKCJwFE6MEU6JCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jiaqiyan.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3nXl0ZggKCJwFE6MEU6JCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jiaqiyan.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718909334; 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:in-reply-to:references:references:dkim-signature; bh=1wu1wVc+3ogmDWb1QmIkKTSRvM9RrOiJDS3aYm0qmOo=; b=lfwd2Vbph6kMUPQ0XrZn3QnEGakjQYLriHXCtq+qFXimWpa/MfvrKzVK7dbdgEG+gQLnLJ JTvyaHlxPsnbrnEp+bGQu2U+q3VfoYdCebDqypABOIA58Hm6Z7u2S/Vn/BDryZfcy2q0Ro acOr1CN0bPvMxsoCdm6YHTeatPgiyRI= Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-1f66f2e4cc7so18089515ad.3 for ; Thu, 20 Jun 2024 11:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718909341; x=1719514141; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=1wu1wVc+3ogmDWb1QmIkKTSRvM9RrOiJDS3aYm0qmOo=; b=kMh5Vu2GvSMtQRzVISpzkZkUJ+hFFiBk4ycyQZjWuq6PJaDcnJUav+769pye/vECKI MKFxXqk9YHLANKwiLkWFOpGqpucHEOTcLEy9okq7/stPhl5G8wN+Ye+a9vISfVZPjjXZ o6esNf7vlroG3ZyV5JO3zP+a+9pkta5jdvTkOiRcFY76yS3BtnGZQD2qle9SsqlaiAsG 948pl9XZ724wqkCXNxJacp1yrY6qwuXj3zic21wW445dr26Ros5NF2ayl+d+m2yrQG0g CGQjpNULQYMZo6OSeladIj8OyVDBWqXNeq2ucMmI3dH7iAbHAQ8zkmWRjf+IhMbgVZ5P 6h5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718909341; x=1719514141; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1wu1wVc+3ogmDWb1QmIkKTSRvM9RrOiJDS3aYm0qmOo=; b=X1jE2Ofui4z3TtiC98HAjNfs+uNFswnCfvO/CkCuQReNd2vugwBZPee6I/1q4wXgaE UHSgTqZocL15tXLPORpHVa9hIeaZHJ+hhpcj9nhOWQHKyrjaf6NCD7mPsiGM1SEigx8t Dl0OJtgXEZ4Wzg9gZWvUqxrqokPWGiVyAMwJLdUNHCptTAOj7o1AgZZ4ewuAuDJRjHen 7SZn12M5UmxVyyAo3AbNaniIpWJXLQrVerEABfOpibF+NHaGHlTWlVGv7x9UK8q6q38J DHi5qVd2gNhyKp4oOM35MIt47TCn5Ij8wazsllaxLEb4ruFT3qSQEAoj61xpbZhcCt+T QSWw== X-Forwarded-Encrypted: i=1; AJvYcCU+I2wzpKSmwxV0BvGybahhwyl7xYmgHI5HTjjM24Cqp3WdszI0TaEU7KS+FPJaJsjx+w2R0Enej7x5wPFZ/KIYteQ= X-Gm-Message-State: AOJu0YwsMTFp378kXG2124pxZnC4Sdqosw409msV6e/Jf3D7hSx+GmHQ 9UzpDS8VTEwJIwa+tVHS6+7TrHgbUMJuRK04FxVlZ8NPDI6meEXjOv22LT3b6kR5hrQ/Hot6iz6 08YZNiTlFhQ== X-Google-Smtp-Source: AGHT+IEjuzQzaeOO0XPvpr1aZfzic9vLyfJJ9ryfPTpvci6d1NFaBB/sikXz1OAKxDRDMP415k8OVyAsWAiWxg== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:903:110d:b0:1f6:77fc:c576 with SMTP id d9443c01a7336-1f9aa39e4a8mr4906245ad.1.1718909341152; Thu, 20 Jun 2024 11:49:01 -0700 (PDT) Date: Thu, 20 Jun 2024 18:48:53 +0000 In-Reply-To: <20240620184856.600717-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240620184856.600717-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240620184856.600717-2-jiaqiyan@google.com> Subject: [PATCH v4 1/4] mm/memory-failure: refactor log format in soft offline code From: Jiaqi Yan To: nao.horiguchi@gmail.com, linmiaohe@huawei.com, jane.chu@oracle.com, osalvador@suse.de Cc: muchun.song@linux.dev, akpm@linux-foundation.org, shuah@kernel.org, corbet@lwn.net, rientjes@google.com, duenwen@google.com, fvdl@google.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, Jiaqi Yan X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 46995C0017 X-Stat-Signature: csqnwsmkd6mo4uqxzxpe7xubw1cycce4 X-Rspam-User: X-HE-Tag: 1718909342-473059 X-HE-Meta: U2FsdGVkX19kAH8qFaW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TuyjZjwrXdfk5Q2G54VpN686qlJz2GAJzJbQeMLzWF2ohxLRB40x8mbI9DIwDSWkK74OXyj2igFCN84RZsimvJg3sGHycShkKBkokx579chzn7WVit8CgrwdgkjboWjPyzs6dNpmKj9fGGuH9r1AL+33RZApDlYXeQ0COG/LmrB5yUezgZ56ucON3iin0N9gN85+SWKGhZxphEQOFSLUwV4KyLvem3jkMTyCM5SK4kZUaWQ+Jb6vbdt5Tvv+deWxvJofs0KMmuLdvzHKVNu2yN2Lz7bhse5gQu1kvMfOG9VUjG57C2pkMOO0fUcBNUFAU394TXcYeUkx2UeidbhChwLjRCocb22c16gDmH5Gw2KxLXn08AdLJRVwRzWBMjh9lU6edlTYWFlyvaADAnzkSIO9Q4OGa+edCUZR5IDWkr+6uQxLJFumhglML78HN7BTRlp82XwBQaarU4SEiMQS6gmYlXx7RM6i0VZzlfh0ruLU 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: Logs from soft_offline_page and soft_offline_in_use_page have different formats than majority of the memory failure code: "Memory failure: 0x${pfn}: ${lower_case_message}" Convert them to the following format: "Soft offline: 0x${pfn}: ${lower_case_message}" No functional change in this commit. Signed-off-by: Jiaqi Yan Acked-by: Miaohe Lin --- mm/memory-failure.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index d3c830e817e3..2a097af7da0e 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2631,6 +2631,9 @@ int unpoison_memory(unsigned long pfn) } EXPORT_SYMBOL(unpoison_memory); +#undef pr_fmt +#define pr_fmt(fmt) "Soft offline: " fmt + static bool mf_isolate_folio(struct folio *folio, struct list_head *pagelist) { bool isolated = false; @@ -2686,7 +2689,7 @@ static int soft_offline_in_use_page(struct page *page) if (!huge && folio_test_large(folio)) { if (try_to_split_thp_page(page)) { - pr_info("soft offline: %#lx: thp split failed\n", pfn); + pr_info("%#lx: thp split failed\n", pfn); return -EBUSY; } folio = page_folio(page); @@ -2698,7 +2701,7 @@ static int soft_offline_in_use_page(struct page *page) if (PageHWPoison(page)) { folio_unlock(folio); folio_put(folio); - pr_info("soft offline: %#lx page already poisoned\n", pfn); + pr_info("%#lx page already poisoned\n", pfn); return 0; } @@ -2711,7 +2714,7 @@ static int soft_offline_in_use_page(struct page *page) folio_unlock(folio); if (ret) { - pr_info("soft_offline: %#lx: invalidated\n", pfn); + pr_info("%#lx: invalidated\n", pfn); page_handle_poison(page, false, true); return 0; } @@ -2728,13 +2731,13 @@ static int soft_offline_in_use_page(struct page *page) if (!list_empty(&pagelist)) putback_movable_pages(&pagelist); - pr_info("soft offline: %#lx: %s migration failed %ld, type %pGp\n", + pr_info("%#lx: %s migration failed %ld, type %pGp\n", pfn, msg_page[huge], ret, &page->flags); if (ret > 0) ret = -EBUSY; } } else { - pr_info("soft offline: %#lx: %s isolation failed, page count %d, type %pGp\n", + pr_info("%#lx: %s isolation failed, page count %d, type %pGp\n", pfn, msg_page[huge], page_count(page), &page->flags); ret = -EBUSY; } @@ -2786,7 +2789,7 @@ int soft_offline_page(unsigned long pfn, int flags) mutex_lock(&mf_mutex); if (PageHWPoison(page)) { - pr_info("%s: %#lx page already poisoned\n", __func__, pfn); + pr_info("%#lx: page already poisoned\n", pfn); put_ref_page(pfn, flags); mutex_unlock(&mf_mutex); return 0;