From patchwork Tue Aug 24 02:09:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12453803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1FD5C4338F for ; Tue, 24 Aug 2021 02:09:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 77C5161373 for ; Tue, 24 Aug 2021 02:09:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 77C5161373 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 04EE16B006C; Mon, 23 Aug 2021 22:09:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F40DD6B0071; Mon, 23 Aug 2021 22:09:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2FF58D0001; Mon, 23 Aug 2021 22:09:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id C99136B006C for ; Mon, 23 Aug 2021 22:09:51 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 747C18249980 for ; Tue, 24 Aug 2021 02:09:51 +0000 (UTC) X-FDA: 78508343382.03.B134FDF Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by imf02.hostedemail.com (Postfix) with ESMTP id 2D1AE7001702 for ; Tue, 24 Aug 2021 02:09:51 +0000 (UTC) Received: by mail-pg1-f173.google.com with SMTP id t1so18382411pgv.3 for ; Mon, 23 Aug 2021 19:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o1KAwdPznmF5iwJT8z+BaZtEiLXVAoNkkWDqAyg+dT8=; b=J8573bnoH2qJxrhS/LlJl2n8wK1WZbxyHVdyIS9I34H2iBf3zzHMmKhLAMLE96j7Mk WCuymMsOCBANSDplp78CoW/lqFS3w6EtHQ5jg7bQ/jtxWAh6NXqXVbkGrscJeXV9i58d 6pBri+1ip8kKQV8FZONByt8I44akwk2oSMNF2phZUTOgYUwQBAGOzx3cKA3/JajI3QCz GAtF3zh1Puf6BPq2N7nGQecn0SG5YhiEVqCmULm4XDkvVQeocSlLwTPpUNJJDy4aKGwB /o0MJYMyWD1SKvFk4gAlIB/Enlog7ikbiT9ke8bvn5gaPe0YHMyQewnlJqs/pzUwoE/z HV7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o1KAwdPznmF5iwJT8z+BaZtEiLXVAoNkkWDqAyg+dT8=; b=ms8qcTxnhcbDWgoWFRuU06LhqdOZN+q0139kX2mZmbZNm0abSg6v48lNoeVE7qT5uw 3n3ntmiIt5FE1ug+Ng20gVqD2KXucLdEIa8SUXDy41kR/Iq9yq3Ex3fOtIKQcP18XI2X s/+7ssu5tbBfH/uw6tNPYpD69ZtjAonXAauokZAtB5emnjGs2nuYFFxqlVbA8Iyjausl F1Y/q9mK7IVRzTFVM2TRhrPJI9ZIY5/q46D2JHqwVd4LJVQ6JgXeaRadwZz2wiMNhh2C Tfo8Z3nRPynZCOTSKCZP7oH3bgBTXBSmO225T/KFaDIAI1W/hr1hKikP1PpTFM67rNTq WK6A== X-Gm-Message-State: AOAM530M3puJ5OivMegFjAVdOozNYR96NsbbbgmYcTDKXtzQvC1KtQ3s oUXHpg4EkmkAFw/Aq4p1QUk= X-Google-Smtp-Source: ABdhPJz4TdbnavEcEqBV+jQY4FxZZqeI2TiKXy0247PorymKfILh9LMZLfSAha9goPl5bq8U5Fp71g== X-Received: by 2002:a63:798f:: with SMTP id u137mr34487840pgc.321.1629770990052; Mon, 23 Aug 2021 19:09:50 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id h16sm16830958pfn.215.2021.08.23.19.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 19:09:48 -0700 (PDT) From: Yang Shi To: naoya.horiguchi@nec.com, osalvador@suse.de, tdmackey@twitter.com, david@redhat.com, willy@infradead.org, akpm@linux-foundation.org, corbet@lwn.net Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 1/3] mm: hwpoison: don't drop slab caches for offlining non-LRU page Date: Mon, 23 Aug 2021 19:09:44 -0700 Message-Id: <20210824020946.195257-1-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=J8573bno; spf=pass (imf02.hostedemail.com: domain of shy828301@gmail.com designates 209.85.215.173 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 2D1AE7001702 X-Stat-Signature: 1myxgiw8i8yhuzrzd1wrsjby7ibdkc4s X-HE-Tag: 1629770991-964185 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: In the current implementation of soft offline, if non-LRU page is met, all the slab caches will be dropped to free the page then offline. But if the page is not slab page all the effort is wasted in vain. Even though it is a slab page, it is not guaranteed the page could be freed at all. However the side effect and cost is quite high. It does not only drop the slab caches, but also may drop a significant amount of page caches which are associated with inode caches. It could make the most workingset gone in order to just offline a page. And the offline is not guaranteed to succeed at all, actually I really doubt the success rate for real life workload. Furthermore the worse consequence is the system may be locked up and unusable since the page cache release may incur huge amount of works queued for memcg release. Actually we ran into such unpleasant case in our production environment. Firstly, the workqueue of memory_failure_work_func is locked up as below: BUG: workqueue lockup - pool cpus=1 node=0 flags=0x0 nice=0 stuck for 53s! Showing busy workqueues and worker pools: workqueue events: flags=0x0   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=14/256 refcnt=15     in-flight: 409271:memory_failure_work_func     pending: kfree_rcu_work, kfree_rcu_monitor, kfree_rcu_work, rht_deferred_worker, rht_deferred_worker, rht_deferred_worker, rht_deferred_worker, kfree_rcu_work, kfree_rcu_work, kfree_rcu_work, kfree_rcu_work, drain_local_stock, kfree_rcu_work workqueue mm_percpu_wq: flags=0x8   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=1/256 refcnt=2     pending: vmstat_update workqueue cgroup_destroy: flags=0x0 pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=1/1 refcnt=12072 pending: css_release_work_fn There were over 12K css_release_work_fn queued, and this caused a few lockups due to the contention of worker pool lock with IRQ disabled, for example: NMI watchdog: Watchdog detected hard LOCKUP on cpu 1 Modules linked in: amd64_edac_mod edac_mce_amd crct10dif_pclmul crc32_pclmul ghash_clmulni_intel xt_DSCP iptable_mangle kvm_amd bpfilter vfat fat acpi_ipmi i2c_piix4 usb_storage ipmi_si k10temp i2c_core ipmi_devintf ipmi_msghandler acpi_cpufreq sch_fq_codel xfs libcrc32c crc32c_intel mlx5_core mlxfw nvme xhci_pci ptp nvme_core pps_core xhci_hcd CPU: 1 PID: 205500 Comm: kworker/1:0 Tainted: G L 5.10.32-t1.el7.twitter.x86_64 #1 Hardware name: TYAN F5AMT /z /S8026GM2NRE-CGN, BIOS V8.030 03/30/2021 Workqueue: events memory_failure_work_func RIP: 0010:queued_spin_lock_slowpath+0x41/0x1a0 Code: 41 f0 0f ba 2f 08 0f 92 c0 0f b6 c0 c1 e0 08 89 c2 8b 07 30 e4 09 d0 a9 00 01 ff ff 75 1b 85 c0 74 0e 8b 07 84 c0 74 08 f3 90 <8b> 07 84 c0 75 f8 b8 01 00 00 00 66 89 07 c3 f6 c4 01 75 04 c6 47 RSP: 0018:ffff9b2ac278f900 EFLAGS: 00000002 RAX: 0000000000480101 RBX: ffff8ce98ce71800 RCX: 0000000000000084 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8ce98ce6a140 RBP: 00000000000284c8 R08: ffffd7248dcb6808 R09: 0000000000000000 R10: 0000000000000003 R11: ffff9b2ac278f9b0 R12: 0000000000000001 R13: ffff8cb44dab9c00 R14: ffffffffbd1ce6a0 R15: ffff8cacaa37f068 FS: 0000000000000000(0000) GS:ffff8ce98ce40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fcf6e8cb000 CR3: 0000000a0c60a000 CR4: 0000000000350ee0 Call Trace: __queue_work+0xd6/0x3c0 queue_work_on+0x1c/0x30 uncharge_batch+0x10e/0x110 mem_cgroup_uncharge_list+0x6d/0x80 release_pages+0x37f/0x3f0 __pagevec_release+0x1c/0x50 __invalidate_mapping_pages+0x348/0x380 ? xfs_alloc_buftarg+0xa4/0x120 [xfs] inode_lru_isolate+0x10a/0x160 ? iput+0x1d0/0x1d0 __list_lru_walk_one+0x7b/0x170 ? iput+0x1d0/0x1d0 list_lru_walk_one+0x4a/0x60 prune_icache_sb+0x37/0x50 super_cache_scan+0x123/0x1a0 do_shrink_slab+0x10c/0x2c0 shrink_slab+0x1f1/0x290 drop_slab_node+0x4d/0x70 soft_offline_page+0x1ac/0x5b0 ? dev_mce_log+0xee/0x110 ? notifier_call_chain+0x39/0x90 memory_failure_work_func+0x6a/0x90 process_one_work+0x19e/0x340 ? process_one_work+0x340/0x340 worker_thread+0x30/0x360 ? process_one_work+0x340/0x340 kthread+0x116/0x130 The lockup made the machine is quite unusable. And it also made the most workingset gone, the reclaimabled slab caches were reduced from 12G to 300MB, the page caches were decreased from 17G to 4G. But the most disappointing thing is all the effort doesn't make the page offline, it just returns: soft_offline: 0x1469f2: unknown non LRU page type 5ffff0000000000 () It seems the aggressive behavior for non-LRU page didn't pay back, so it doesn't make too much sense to keep it considering the terrible side effect. Reported-by: David Mackey Acked-by: Naoya Horiguchi Acked-by: David Hildenbrand Cc: Oscar Salvador Signed-off-by: Yang Shi --- v3: * Collected acks v2: * Rebased on top of https://lore.kernel.org/linux-mm/CAHbLzkpAEZRTmnOnjVHYHGJ7ApjdC8eDh53DAnTHsG185QGOfQ@mail.gmail.com/T/#t (Naoya Horiguchi) * Added comment about possible future optimization when handling slab page (David Hildenbrand) * Added patch #3 to call dump_page (Matthew Wilcox) include/linux/mm.h | 2 +- mm/hwpoison-inject.c | 2 +- mm/memory-failure.c | 18 ++++++++---------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 7e43d1b01e0a..a3cc83d64564 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3203,7 +3203,7 @@ extern void memory_failure_queue_kick(int cpu); extern int unpoison_memory(unsigned long pfn); extern int sysctl_memory_failure_early_kill; extern int sysctl_memory_failure_recovery; -extern void shake_page(struct page *p, int access); +extern void shake_page(struct page *p); extern atomic_long_t num_poisoned_pages __read_mostly; extern int soft_offline_page(unsigned long pfn, int flags); diff --git a/mm/hwpoison-inject.c b/mm/hwpoison-inject.c index 1ae1ebc2b9b1..aff4d27ec235 100644 --- a/mm/hwpoison-inject.c +++ b/mm/hwpoison-inject.c @@ -30,7 +30,7 @@ static int hwpoison_inject(void *data, u64 val) if (!hwpoison_filter_enable) goto inject; - shake_page(hpage, 0); + shake_page(hpage); /* * This implies unable to support non-LRU pages. */ diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 665316c7ea40..7cfa134b1370 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -282,9 +282,9 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) /* * Unknown page type encountered. Try to check whether it can turn PageLRU by - * lru_add_drain_all, or a free page by reclaiming slabs when possible. + * lru_add_drain_all. */ -void shake_page(struct page *p, int access) +void shake_page(struct page *p) { if (PageHuge(p)) return; @@ -296,11 +296,9 @@ void shake_page(struct page *p, int access) } /* - * Only call drop_slab_node here (which would also shrink - * other caches) if access is not potentially fatal. + * TODO: Could shrink slab caches here if a lightweight range-based + * shrinker will be available. */ - if (access) - drop_slab_node(page_to_nid(p)); } EXPORT_SYMBOL_GPL(shake_page); @@ -1205,7 +1203,7 @@ static int get_any_page(struct page *p, unsigned long flags) * page, retry. */ if (pass++ < 3) { - shake_page(p, 1); + shake_page(p); goto try_again; } ret = -EIO; @@ -1222,7 +1220,7 @@ static int get_any_page(struct page *p, unsigned long flags) */ if (pass++ < 3) { put_page(p); - shake_page(p, 1); + shake_page(p); count_increased = false; goto try_again; } @@ -1369,7 +1367,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, * shake_page() again to ensure that it's flushed. */ if (mlocked) - shake_page(hpage, 0); + shake_page(hpage); /* * Now that the dirty bit has been propagated to the @@ -1723,7 +1721,7 @@ int memory_failure(unsigned long pfn, int flags) * The check (unnecessarily) ignores LRU pages being isolated and * walked by the page reclaim code, however that's not a big loss. */ - shake_page(p, 0); + shake_page(p); lock_page(p); From patchwork Tue Aug 24 02:09:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12453805 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53F9DC432BE for ; Tue, 24 Aug 2021 02:09:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0ED74613BD for ; Tue, 24 Aug 2021 02:09:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0ED74613BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8B3A26B0071; Mon, 23 Aug 2021 22:09:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 864BF6B0072; Mon, 23 Aug 2021 22:09:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 72B858D0001; Mon, 23 Aug 2021 22:09:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id 5989B6B0071 for ; Mon, 23 Aug 2021 22:09:54 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E86938249980 for ; Tue, 24 Aug 2021 02:09:53 +0000 (UTC) X-FDA: 78508343466.09.4036168 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by imf12.hostedemail.com (Postfix) with ESMTP id AFC0710000B8 for ; Tue, 24 Aug 2021 02:09:53 +0000 (UTC) Received: by mail-pf1-f178.google.com with SMTP id y11so16988724pfl.13 for ; Mon, 23 Aug 2021 19:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kZlG/ChLDc3AYgjy5sVCdo5NPSHi2j9z4lW6SbGIsUs=; b=ELOiKeJOKunMM67OBX89RJhJxeeZ6S6vvhu4v807klx48Hz/GxxMNa4wfwsPKDGeaV jjw5nn8TFbYMqf5gaN3OIV52OJv5vguS8je1TJVSbFmnHKn1PWlBxvvxvYkDMn1ag3nr 4eUr5bFmjThrfRhFbPhwL2ddgTxxHiFw0lTuqc4YcoPXhuC8HpEO9F9Wy006i+WMeX5J yqUfzSX5GDYEb+9jNRybHZcUjAxA8Phmf1JPeabaej6U9g24XZKafP1SgHLB8sK122rv /wCTTcpYqh7jUV9XM/rZmRBZFJwM7X1VgDvEsRaQKd/3z5lo0JbvdFLeBDMKUXhHzO3g j8PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kZlG/ChLDc3AYgjy5sVCdo5NPSHi2j9z4lW6SbGIsUs=; b=N8na2IKVrevMFRZ64oGkJk/Iq4aeBTi5ga8+h9t5QNJd4uZUV0q4w/nMRMRvCJhhi9 vlPtSl3lgV48fZLUmQQXY3CiSNgzZsPm6zTG0WMipW/4ctpdRpYLC3VCaGcZB4DmNcYX VL59ptSnaH+oF3O4AXtr+3OYc4sr2nOUeTWKO2UdYjtvyPedSI5uCkJ+T1kTsJfKrhMX PSF7PCKO4YpZj943WYYyrT41OnXSB1XWK63VVkIoNSCMMjtrdXYcRT5hst/8m57RxYfe OE57d6YgsHVAgXjfYsXH2T9R5dDWsH6hnytvWnLCzldamkRUbhwCBFNnkKQP8feUKn5c obZw== X-Gm-Message-State: AOAM532dZ4nec85N79UzdAMA9hG+8u89UlER6yXgAdNohGo+vCgF2gzD BDlOToo7kurv7eau6KbpePQ= X-Google-Smtp-Source: ABdhPJw/3t/sfo5GyAyM3hy9TRZA3TfWfwDJ+bxIbX/6ERhjW0bVLDtb+dgMJpe5jmZDauTBG569nA== X-Received: by 2002:a63:408:: with SMTP id 8mr34060362pge.78.1629770992309; Mon, 23 Aug 2021 19:09:52 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id h16sm16830958pfn.215.2021.08.23.19.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 19:09:51 -0700 (PDT) From: Yang Shi To: naoya.horiguchi@nec.com, osalvador@suse.de, tdmackey@twitter.com, david@redhat.com, willy@infradead.org, akpm@linux-foundation.org, corbet@lwn.net Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 2/3] doc: hwpoison: correct the support for hugepage Date: Mon, 23 Aug 2021 19:09:45 -0700 Message-Id: <20210824020946.195257-2-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210824020946.195257-1-shy828301@gmail.com> References: <20210824020946.195257-1-shy828301@gmail.com> MIME-Version: 1.0 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ELOiKeJO; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf12.hostedemail.com: domain of shy828301@gmail.com designates 209.85.210.178 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: AFC0710000B8 X-Stat-Signature: n8atqd4an39bnccefk1k35eb5xmtsn35 X-HE-Tag: 1629770993-43870 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: The hwpoison support for huge page, both hugetlb and THP, has been in kernel for a while, the statement in document is obsolete, correct it. Acked-by: Naoya Horiguchi Reviewed-by: David Hildenbrand Cc: Oscar Salvador Signed-off-by: Yang Shi --- v3: * collected reviewed tag from David Hildenbrand v2: * Collected ack from Naoya Horiguchi Documentation/vm/hwpoison.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/vm/hwpoison.rst b/Documentation/vm/hwpoison.rst index a5c884293dac..89b5f7a52077 100644 --- a/Documentation/vm/hwpoison.rst +++ b/Documentation/vm/hwpoison.rst @@ -180,7 +180,6 @@ Limitations =========== - Not all page types are supported and never will. Most kernel internal objects cannot be recovered, only LRU pages for now. -- Right now hugepage support is missing. --- Andi Kleen, Oct 2009 From patchwork Tue Aug 24 02:09:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12453807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90777C4338F for ; Tue, 24 Aug 2021 02:09:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1AF9C61361 for ; Tue, 24 Aug 2021 02:09:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1AF9C61361 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AAFD66B0072; Mon, 23 Aug 2021 22:09:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A615F6B0073; Mon, 23 Aug 2021 22:09:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9286A8D0001; Mon, 23 Aug 2021 22:09:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id 79CF76B0072 for ; Mon, 23 Aug 2021 22:09:56 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0A09C1EA10 for ; Tue, 24 Aug 2021 02:09:56 +0000 (UTC) X-FDA: 78508343592.30.9108D21 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf06.hostedemail.com (Postfix) with ESMTP id B9AC2801A89B for ; Tue, 24 Aug 2021 02:09:55 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id m17so4261193plc.6 for ; Mon, 23 Aug 2021 19:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=08aO+jCRMsaJzTjrGQzurk0ey1pwgskCgL+V9erG5PI=; b=HacAj8LOl7rXmKqFsrgFe+j6OYcCwSQZdP2HTYoXSmWLDyG9Aame1o/kUZm1FFOJKC zjn0prjj4mbXFpbVrfgUhbZmo8owsR3RCcCYliysA5DZqi3ShKOsxriOCjCMvmxpw+GU qHSoj3azCT9cmRDoiZclndv7vDxFCTptKkN6oAep3+XvlH8LArGjt3R9bFKzRuGnMMDh O7yiV97xpJlIj88kx/nP10V3LHJxZmgJDfRHdSNReVlUBCLrIRlBMmy2ezz9jdd751vS coM+Ic+EDMjcSnl8QJere9pKGU7Yx4qFKsFLXy0SMd66LuK6Gmpt5xPQg6HAJjC5nEwT Rh/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=08aO+jCRMsaJzTjrGQzurk0ey1pwgskCgL+V9erG5PI=; b=pSe7Ad303RrG30BqoCiXNmket17wLx0o8RrMicUIckTvvaOl+YwO7EacHYido9iMhY x4fDtGgoZ7fyCknF9RuTdZMtTnw3taDdX/wboeMK/cH9NXoyoZvsyH3t6CPniMQzHK6m dBpHg/EfJ/GRHGA9SBOMdij3YqUVrEHYrcxrWRgESkDgs1Pj7ZJ7vlsel8M8QM3d8Nih 25jKd3rVFdrOkek50wkKDN4W++ik+npaIdrQW0aOG5e+buboRzFqqspCost+9JKYz6OL JAleqFp58ky2Ht2ZtfopoKoV1vp9zOTKRf5aP1w3gcdP/VgZ+qrvYuY8HuJRb0tuAkwG PN7g== X-Gm-Message-State: AOAM532bOFLezzrdAua2dKt4pE1joSVFYuZEHaMUdi6uInZvJXe6iCB2 Q0QwKA1SF23209RuvMvbvLE= X-Google-Smtp-Source: ABdhPJyGNV5HuEEKZxUHIsJX1mAeS/d7mg3XfPJq06DFfWLjzyKS6QJXiQyVdDwyEyX7QAHYbiNw7A== X-Received: by 2002:a17:902:9b90:b029:12d:5ce1:4d99 with SMTP id y16-20020a1709029b90b029012d5ce14d99mr30701209plp.37.1629770994784; Mon, 23 Aug 2021 19:09:54 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id h16sm16830958pfn.215.2021.08.23.19.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 19:09:53 -0700 (PDT) From: Yang Shi To: naoya.horiguchi@nec.com, osalvador@suse.de, tdmackey@twitter.com, david@redhat.com, willy@infradead.org, akpm@linux-foundation.org, corbet@lwn.net Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 3/3] mm: hwpoison: dump page for unhandlable page Date: Mon, 23 Aug 2021 19:09:46 -0700 Message-Id: <20210824020946.195257-3-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210824020946.195257-1-shy828301@gmail.com> References: <20210824020946.195257-1-shy828301@gmail.com> MIME-Version: 1.0 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=HacAj8LO; spf=pass (imf06.hostedemail.com: domain of shy828301@gmail.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B9AC2801A89B X-Stat-Signature: qfassj7unota7xqdgaiteupao17ypf8e X-HE-Tag: 1629770995-156160 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: Currently just very simple message is shown for unhandlable page, e.g. non-LRU page, like: soft_offline: 0x1469f2: unknown non LRU page type 5ffff0000000000 () It is not very helpful for further debug, calling dump_page() could show more useful information. Calling dump_page() in get_any_page() in order to not duplicate the call in a couple of different places. It may be called with pcp disabled and holding memory hotplug lock, it should be not a big deal since hwpoison handler is not called very often. Suggested-by: Matthew Wilcox Cc: Naoya Horiguchi Cc: Oscar Salvador Signed-off-by: Yang Shi Acked-by: Naoya Horiguchi Reviewed-by: David Hildenbrand --- v3: * Remove redundant pr_info per Noaya Horiguchi mm/memory-failure.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 7cfa134b1370..5f8249e4d7dc 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1228,6 +1228,9 @@ static int get_any_page(struct page *p, unsigned long flags) ret = -EIO; } out: + if (ret == -EIO) + dump_page(p, "hwpoison: unhandlable page"); + return ret; } @@ -2205,9 +2208,6 @@ int soft_offline_page(unsigned long pfn, int flags) try_again = false; goto retry; } - } else if (ret == -EIO) { - pr_info("%s: %#lx: unknown page type: %lx (%pGp)\n", - __func__, pfn, page->flags, &page->flags); } return ret;