From patchwork Mon Jun 24 16:33:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13709846 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 A4462C3064D for ; Mon, 24 Jun 2024 16:33:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B2F86B00CF; Mon, 24 Jun 2024 12:33:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 313736B00F5; Mon, 24 Jun 2024 12:33:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18DFD6B010F; Mon, 24 Jun 2024 12:33:57 -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 E1CB86B00CF for ; Mon, 24 Jun 2024 12:33:56 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 977A2811F7 for ; Mon, 24 Jun 2024 16:33:56 +0000 (UTC) X-FDA: 82266328872.02.41EF457 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) by imf07.hostedemail.com (Postfix) with ESMTP id A284640016 for ; Mon, 24 Jun 2024 16:33:54 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=fOugiJZT; spf=pass (imf07.hostedemail.com: domain of 38Z95ZggKCFI32uA2Iu708805y.w86527EH-664Fuw4.8B0@flex--jiaqiyan.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=38Z95ZggKCFI32uA2Iu708805y.w86527EH-664Fuw4.8B0@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=1719246821; 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=dSw8NmaTJHed6EDD+0u0W7yMVS5g1hNwrD11QKJoteRCYH9uk9wJ6ALmIrBYNkgjanBxwS KODZuonEUPAPBwV2RubN4hLIKUGBivUqnu+sAZ71+k1N6Jf4VqfFKgQVDv+GW83J3Ligks p8ZIypwU2Ftphm69Oj5rwu1BcJN3Tpc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719246821; a=rsa-sha256; cv=none; b=AwC3ArCPZ5CEim0WELSNj+E4kItPB3SzPCxGoBl+X4WfOnTcKIt355WVqkITV6EJSDdUIc aERsbEfAGUUaTDWEHV/UNpz57XNA3VWBKYS6UXQFPmyxRFvqqpUHaGeToXNRVM+lbxlRvA C6BHN6wRwjHSo21PGoVVwxqmydDe0AQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=fOugiJZT; spf=pass (imf07.hostedemail.com: domain of 38Z95ZggKCFI32uA2Iu708805y.w86527EH-664Fuw4.8B0@flex--jiaqiyan.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=38Z95ZggKCFI32uA2Iu708805y.w86527EH-664Fuw4.8B0@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-706694428e3so1567956b3a.1 for ; Mon, 24 Jun 2024 09:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719246833; x=1719851633; 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=fOugiJZT9lRuvKMzrdBfCLOiUJV3lxtAUnJtFEjzhwSv/auc2AhTvN/dkMlVymOfoK 0l0iwhCM7P4o4yPVvcmDDXKGJgmViq/bD2k6nEFIiFRky3Ul5/W+O+uPBW8px1j6upIr PrkHrNfIm2e7RFieArflgGNmZjbqAYPsJvNHzVm1mHirnGruvxYn7Du3qncRoDjKkCiz lug6PCn5Rs/RxdXxgPHDzSgOaIxpxTt0MiCAnnQqWQ5Qd+ntjOhrFBiAn50Pj3RmXTfZ 0ryq2NkX2PiCfkBHdLjAvLy0MPmDdQAQRMSaUtp1cRZgtcgKy7OH5LDbdCbzVRhcNFx5 nzzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246833; x=1719851633; 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=WZydRV48V6lUYZAHCPWxPt7lleZa8oenIoG6Vxx1xMZUfRLtCf41KflmNDr6n1PLkO oO7/v2BxNzTBrkQOQJ4GOBUeTABxyRZN613p0aDVDoJMG5HAa2eShAWqL/wN4Qal/sTv U9SARWwUSIp9nwkBqiKt0N6LMGevgaotgSbH8rEcIpMM8vkQ6m2zlDu4RnwO+tdDJ92A kn0hkUb5gtRFvFI4jRPvV41YaoXlZ8ymy7u48dz8XWy8MqlwYs1xVlSBeVtyvYlqHywW 3x6Zbg0xxF1dJZd2FmMBEjN4CUb7lSbExSEw6YL0fYhDJaZRpTxAZIyd3KasJlkdGnK+ T8eA== X-Forwarded-Encrypted: i=1; AJvYcCW1Agt2og2tsRlmpHGORN5gNBy3msg+U+yH+bc8+nt1DhEpHuh8te4/zrNI/37vOe6Mg8q/Z/djQ4GmWBTeQUCFZ/Q= X-Gm-Message-State: AOJu0Yy6gjU35u5V8Dn1ZEALhmMi81g/WMhT9bo/4O1obqo1DuxpwI3K Krg/cbaXCnejM67IAT7hjis4wKbD7SetZtyL513RFQm5GSm+s2SCNlT6t7QAx2SXQxWt0llBXzB I2E6ThudnUw== X-Google-Smtp-Source: AGHT+IF1GRQbf9f53JYi+zCzPqxL0zi378t5Qx/Cho038U/27Y5JAiHIF9pEqP5D5pV+1pUBlBOa/tOCbhRcIQ== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:90b:3c4:b0:2c7:471d:172b with SMTP id 98e67ed59e1d1-2c848a4d8c7mr123984a91.2.1719246833134; Mon, 24 Jun 2024 09:33:53 -0700 (PDT) Date: Mon, 24 Jun 2024 16:33:45 +0000 In-Reply-To: <20240624163348.1751454-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240624163348.1751454-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240624163348.1751454-2-jiaqiyan@google.com> Subject: [PATCH v5 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, ioworker0@gmail.com Cc: muchun.song@linux.dev, akpm@linux-foundation.org, shuah@kernel.org, corbet@lwn.net, osalvador@suse.de, 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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: A284640016 X-Stat-Signature: p4599p4or8kcejc61ycj3b1kybcjornn X-HE-Tag: 1719246834-971655 X-HE-Meta: U2FsdGVkX1+uNcHTFifmIfBIqg/VBMogPxety+ac1yTh1VY/QAwIw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2jxggtXnqcxozCNG+IzUkqz2pWgs4F/sbM9gHvjwAqxDtPodCCm6YvqBnxUjolEJJgV8ZTp+Cv8+LWllufzVVOOeYjrowWKYUanHciF1PK9GwSMIprlT/yF3IC4IwTpfipwxqGG80LUrkfCLHTCG3FOakIDjQqARb4P4wwYLj5rseh5O02JPp3+u1t/PsYL6tFXlVpjOGgVcEnm5T8DL0GWBHmWE3i8iRfRqIyjTxRL+K4E4vUsLFP9Ifj/PvAgPH+ckK2prbS99hDowQw2l8NZdnpP/D2HUfh+QTqtdVaEQjzd634VC3HeieoruTkgRvgu85gdWowpIjHuYKDfVjdRRgXB5eTZISe+XRstjb5v/0Exg8vSBpEHomlBSXRD8XrhaNTDGL6jtM6xYQoNyXgSLY0lpWUSFfQF4etp2j0DsaF08ODruJIgMvE+LPIjvGU/PaSgQMcx 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 --- 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;