From mboxrd@z Thu Jan 1 00:00:00 1970 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 7B068ECAAA1 for ; Sun, 23 Oct 2022 15:52:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B57C0900003; Sun, 23 Oct 2022 11:52:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE0D4900002; Sun, 23 Oct 2022 11:52:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A8B8900003; Sun, 23 Oct 2022 11:52:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 881A8900002 for ; Sun, 23 Oct 2022 11:52:14 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 57386C06B0 for ; Sun, 23 Oct 2022 15:52:14 +0000 (UTC) X-FDA: 80052655788.22.D73EAE5 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by imf09.hostedemail.com (Postfix) with ESMTP id C9C09140012 for ; Sun, 23 Oct 2022 15:52:11 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0VSptVNr_1666540325; Received: from 30.13.157.28(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VSptVNr_1666540325) by smtp.aliyun-inc.com; Sun, 23 Oct 2022 23:52:06 +0800 Message-ID: <85b1b706-c3c2-6316-6dd5-ba1b4306d772@linux.alibaba.com> Date: Sun, 23 Oct 2022 23:52:04 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v3 0/2] Copy-on-write poison recovery Content-Language: en-US To: Tony Luck , Naoya Horiguchi , Andrew Morton Cc: Miaohe Lin , Matthew Wilcox , Dan Williams , Michael Ellerman , Nicholas Piggin , Christophe Leroy , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <20221019170835.155381-1-tony.luck@intel.com> <20221021200120.175753-1-tony.luck@intel.com> From: Shuai Xue In-Reply-To: <20221021200120.175753-1-tony.luck@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666540334; a=rsa-sha256; cv=none; b=PpOztHrHn2+VegYcYuE6fd2kW7632UikTfo4xvZ26OGcVxFTXJAnsFMLMuLwx1Ii6lpZB0 DzwaVgKJcTYIKKZnO0dBW5Z2TZpANfIVGDEbBOZQIXqy63+caMSnPoa+HT4oFszncARsJs /R7ACLKBDt/Gs2O9lD7W2qvEPXLjb64= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf09.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.43 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666540334; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CC/aigwVIKJJQoz43GDdY9L/VNUJL7APJcKHK5zoV0s=; b=7NTOEF4qj1xGSlCzg/w0NwPyfpHS/ZGw5VHR5Xnz4a8joXvETpmge7s5gYZpgBHQjBQ3gJ 54q3PC/L67I5UwlQedv4PWiGndreDN+CsoCNmVVFbTuZiLO78xh01kgP76dm5GH5bIY4Gz azAoI8JOTlf9z+s5fYfJsBUrOQAUHmg= X-Stat-Signature: p7tdcj5q475shak7o1wcpogznggbwroh X-Rspamd-Queue-Id: C9C09140012 Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf09.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.43 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1666540331-95117 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: 在 2022/10/22 AM4:01, Tony Luck 写道: > Part 1 deals with the process that triggered the copy on write > fault with a store to a shared read-only page. That process is > send a SIGBUS with the usual machine check decoration to specify > the virtual address of the lost page, together with the scope. > > Part 2 sets up to asynchronously take the page with the uncorrected > error offline to prevent additional machine check faults. H/t to > Miaohe Lin and Shuai Xue > for pointing me to the existing function to queue a call to > memory_failure(). > > On x86 there is some duplicate reporting (because the error is > also signalled by the memory controller as well as by the core > that triggered the machine check). Console logs look like this: > > [ 1647.723403] mce: [Hardware Error]: Machine check events logged > Machine check from kernel copy routine > > [ 1647.723414] MCE: Killing einj_mem_uc:3600 due to hardware memory corruption fault at 7f3309503400 > x86 fault handler sends SIGBUS to child process > > [ 1647.735183] Memory failure: 0x905b92d: recovery action for dirty LRU page: Recovered > Async call to memory_failure() from copy on write path The recovery action might also be handled asynchronously in CMCI uc_decode_notifier handler signaled by memory controller, right? I have a one more memory failure log than yours. [ 3187.485742] MCE: Killing einj_mem_uc:31746 due to hardware memory corruption fault at 7fc4bf7cf400 [ 3187.740620] Memory failure: 0x1a3b80: recovery action for dirty LRU page: Recovered uc_decode_notifier() processes memory controller report [ 3187.748272] Memory failure: 0x1a3b80: already hardware poisoned Workqueue: events memory_failure_work_func // queued by ghes_do_memory_failure [ 3187.754194] Memory failure: 0x1a3b80: already hardware poisoned Workqueue: events memory_failure_work_func // queued by __wp_page_copy_user [ 3188.615920] MCE: Killing einj_mem_uc:31745 due to hardware memory corruption fault at 7fc4bf7cf400 Best Regards, Shuai > > [ 1647.748397] Memory failure: 0x905b92d: already hardware poisoned > uc_decode_notifier() processes memory controller report > > [ 1647.761313] MCE: Killing einj_mem_uc:3599 due to hardware memory corruption fault at 7f3309503400 > Parent process tries to read poisoned page. Page has been unmapped, so > #PF handler sends SIGBUS > > > Tony Luck (2): > mm, hwpoison: Try to recover from copy-on write faults > mm, hwpoison: When copy-on-write hits poison, take page offline > > include/linux/highmem.h | 24 ++++++++++++++++++++++++ > include/linux/mm.h | 5 ++++- > mm/memory.c | 32 ++++++++++++++++++++++---------- > 3 files changed, 50 insertions(+), 11 deletions(-) >