From patchwork Fri Jun 28 20:59: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: 13716602 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 84D94C30658 for ; Fri, 28 Jun 2024 21:00:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E1B86B008C; Fri, 28 Jun 2024 17:00:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 669666B0092; Fri, 28 Jun 2024 17:00:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E3266B0095; Fri, 28 Jun 2024 17:00:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2A2876B008C for ; Fri, 28 Jun 2024 17:00:06 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D5F2FA076D for ; Fri, 28 Jun 2024 21:00:05 +0000 (UTC) X-FDA: 82281514770.07.192EA3D Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf13.hostedemail.com (Postfix) with ESMTP id 102F020004 for ; Fri, 28 Jun 2024 21:00:03 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=AxpUwWaG; spf=pass (imf13.hostedemail.com: domain of 3UiR_ZggKCNE65xD5LxA3BB381.zB985AHK-997Ixz7.BE3@flex--jiaqiyan.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3UiR_ZggKCNE65xD5LxA3BB381.zB985AHK-997Ixz7.BE3@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=1719608389; 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=r0CbibTHvg/Mc5IP1SBIsRIj2TjPoTYgF7QMmo8HErQ=; b=RlyDg/4tP+0TVQTQrC3ihkU9IDAIRk/YMgMk5FMcEBH5H9OboWNIBhqSFM54FalRGuwRJS mQ2FM4NDgG0hm6cP/+KtjCbVL4V5/ABJAug7iFEQoGnPCHcDWfqP7Fu5VXtUPDvXx2IizD nzX0ROL1IsEXgNPNRlVoCblja+K/+Q8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=AxpUwWaG; spf=pass (imf13.hostedemail.com: domain of 3UiR_ZggKCNE65xD5LxA3BB381.zB985AHK-997Ixz7.BE3@flex--jiaqiyan.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=3UiR_ZggKCNE65xD5LxA3BB381.zB985AHK-997Ixz7.BE3@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719608389; a=rsa-sha256; cv=none; b=8hne9ONPxuXVbOYaaRokLBqO2qH8bss9nwUBIxSD+Es0989TUzYqrBPkxNEyHIWp5NC+bm qgfTNvC0thsmPGgReDjMUySCPQWDExMBJGx9W+r0JFmqkWfwuuSwj20oeHqfqb0ULrtM/k QuaNsGXziYNeGE1E/+TQidJV4rPTrcQ= Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1faa4e6e43eso7236745ad.1 for ; Fri, 28 Jun 2024 14:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719608403; x=1720213203; 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=r0CbibTHvg/Mc5IP1SBIsRIj2TjPoTYgF7QMmo8HErQ=; b=AxpUwWaGmPOrzzQ9r2hWOZSGL20DhflGYL9qUT2SLYCU8x/MwZLKO0CIJtr9S6cVTu H/5v0DaesLPoL88mK8auMfhTLqRY0EcY0zI7h09wzDAFaFNJKXz/JJpPl8SnukisM+jx RGqnn8VJjuXzeztISH1GqG3jaq3AF69Swb0TWe407W5voDwfCBvY8YLRUCEUh+vl7zww 2wZ5rX78Ubxh7mO8xPp97+EgrZbx3XCaE0T43Qu05nK9XvTiUcOleVxNQMc4BEluVkLF HLzwTj4plKBpqB61hnp1CH9H145JHYEKhxFhnLpU9mcpsrhIWV9G/zo2XZxB6bSI+muY bWPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608403; x=1720213203; 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=r0CbibTHvg/Mc5IP1SBIsRIj2TjPoTYgF7QMmo8HErQ=; b=YFOaTGVRghK3yOW6AmfA1DaSRLLMwcvS5bA8zLr3KHMejYrfN866xavbjpciecj71C +O9CGHPLdPJmFoLcOAX2Vgh2u2JHJCINTCaLFEaovR1y16pbsqnHh4hz8g7d22uHcM2f 5RE+WB6cnhHSh8Xm5FfD5bBARJ5ogtp8j+0AX+WoheFMC5tLjdoxDO+q3pa95clVYCXe BIIUg9c4yNWUIBgJkeXfFrzm2xa9v7QLuIZ3MOLEBMVxM6B2MghUtR2d1s/qGpOSnUvK o9ZCdB11AN20LuumCiUCzbbt6s6+7CJyaCzAYg4Z+8ItBpZkkzUXfnz9B+q3kIsY8N0F eR1w== X-Forwarded-Encrypted: i=1; AJvYcCXIJLnbQcLEdjGjqoca62z1ao+yQZXFpb+YC97hmTRuFB326ReohDtYbjS3hax51aj47UdmKcBYZ5fLM9QLnH+ZSQU= X-Gm-Message-State: AOJu0YzJUVj6qVVAJEBaKoAk9ObpimemS5Whf4B+OqccZgPlG64OP3qo sV9yLOmoWFJQ2StvubS1AiWANepNQL20N0gU6xk2ZSDwOsb6B4E+JHr3AduDARM8FwbvPBuwuzn mxV4MVcWCCA== X-Google-Smtp-Source: AGHT+IHvSyTDpXGxBgupVIRFAkBG3VdCY5GUBbjJLmgeOIsfaxOiwkfDkgH572hLnULmbZAu+zNkcopy7a37Yw== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:902:facf:b0:1f7:1640:cef0 with SMTP id d9443c01a7336-1fa1d668ce5mr424595ad.12.1719608402621; Fri, 28 Jun 2024 14:00:02 -0700 (PDT) Date: Fri, 28 Jun 2024 20:59:55 +0000 In-Reply-To: <20240628205958.2845610-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240628205958.2845610-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.803.g4e1b14247a-goog Message-ID: <20240628205958.2845610-2-jiaqiyan@google.com> Subject: [PATCH v7 1/4] mm/memory-failure: refactor log format in soft offline code From: Jiaqi Yan To: nao.horiguchi@gmail.com, linmiaohe@huawei.com Cc: jane.chu@oracle.com, ioworker0@gmail.com, muchun.song@linux.dev, akpm@linux-foundation.org, shuah@kernel.org, rdunlap@infradead.org, corbet@lwn.net, osalvador@suse.de, rientjes@google.com, duenwen@google.com, fvdl@google.com, ak@linux.intel.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, Jiaqi Yan X-Stat-Signature: jqxqg1nemofopctx9d49xxa4j5pejrt6 X-Rspam-User: X-Rspamd-Queue-Id: 102F020004 X-Rspamd-Server: rspam02 X-HE-Tag: 1719608403-808163 X-HE-Meta: U2FsdGVkX19S8c/1ki0O6m02bSX03fTGtp0FSk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Y9Iy2XiaIwJ7G9PgpqA3CN+NAK5DOt74kqrH2cSQgVowGp4PltV92648xztDOnCQVxxv/zV616BkmbYnMgXv+jjB/KaByBfX11EiZkTRmpzpcVA+N3sLjjTBgvUvV/dF1G3xtkJoCk19iy4MHT5xcRD3QOGDN+LdAJaF52tkeVOZ03Q0ddyyjsYVUfRb7xA2Nf2pX35cFVRGVtZCgxcsXsRPLPAPYEXQhLURraaLTZxWCy4j6p/KJj80Cef6KvA1ByqTAJk/YV1TnwOYhmALtFY27lvZPXREoAnao7xexqFUQ8hqLM9bGKKLOhb4v/f7IxvQCfdkcq99B1m9feTktcfoNwzAFt/gd05J6ZACnFEng31rzKnc+VJl09Fd1NtKhy0RIIIyZED48ypg7K5hoqO/w6OWB9vRcKu++M/0hj6s2e5lzVvUGPhhAlK0mrbx2u8F2b2fKD3q5aqo+EsIs2yY9i7WA9r2y3AArm6nyqJMzldM6AtIP9NjTMyCAsiLcA== 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. Acked-by: Miaohe Lin Signed-off-by: Jiaqi Yan Reviewed-by: Lance Yang --- 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 2cf7acc286de..685ab9a77966 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2640,6 +2640,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; @@ -2695,7 +2698,7 @@ static int soft_offline_in_use_page(struct page *page) if (!huge && folio_test_large(folio)) { if (try_to_split_thp_page(page, true)) { - pr_info("soft offline: %#lx: thp split failed\n", pfn); + pr_info("%#lx: thp split failed\n", pfn); return -EBUSY; } folio = page_folio(page); @@ -2707,7 +2710,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; } @@ -2720,7 +2723,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; } @@ -2737,13 +2740,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; } @@ -2795,7 +2798,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;