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 5BAEFFA373E for ; Sun, 23 Oct 2022 15:04:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9CCEB900003; Sun, 23 Oct 2022 11:04:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 97D62900002; Sun, 23 Oct 2022 11:04:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86D21900003; Sun, 23 Oct 2022 11:04:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7ADC6900002 for ; Sun, 23 Oct 2022 11:04:33 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 48CB280987 for ; Sun, 23 Oct 2022 15:04:33 +0000 (UTC) X-FDA: 80052535626.22.26C294F Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by imf29.hostedemail.com (Postfix) with ESMTP id 47C3B120019 for ; Sun, 23 Oct 2022 15:04:30 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VSptLky_1666537463; Received: from 30.13.157.28(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VSptLky_1666537463) by smtp.aliyun-inc.com; Sun, 23 Oct 2022 23:04:25 +0800 Message-ID: <13658301-6af4-9dcf-0158-d24745d49f4f@linux.alibaba.com> Date: Sun, 23 Oct 2022 23:04:22 +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 v2] mm, hwpoison: Try to recover from copy-on write faults Content-Language: en-US To: "Luck, Tony" , David Laight Cc: Naoya Horiguchi , Andrew Morton , Miaohe Lin , Matthew Wilcox , "Williams, Dan J" , 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> <893b681b-726e-94e3-441e-4d68c767778a@linux.alibaba.com> <359bae4e-6ce3-cc7e-33d0-252064157bc6@linux.alibaba.com> <1643d19d795b4a8084228eab66a7db9f@AcuMS.aculab.com> From: Shuai Xue In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.43 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666537473; a=rsa-sha256; cv=none; b=ZLvIYFJ5WBOluMD/lyKcG7tGbbe6+PmSgwefZCEssrZCdSCWBCt9H1HeRMMqeby+QTsFkg Ts1NjBxKnbk2nGsIF1o46BNo4WSA7wvgZAtZDkZnrU6xcIAgm6SHTsNXUNI36d0GyyyuIt fKUfTnojxjxKmOoOXByCpf9ULiYLq9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666537473; 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=aNOJ3g9uIwYlOizfz4J3CN+SRQNEQ6tKmttO8COfLs0=; b=vYJ3MwjnQFnwYKlBBEAdiB4ktaP37wLwsldl4obUEwJV2ymbKctVgLi6dicNaaV4JQGGoD 2EvhN0c4jylB6dqywJ9FBZEaQ4YI3sej2NdY7h0bnsdxMo2I0d31jihLNw5tuyOWKI/1oS VwoTjc5fRbhSKxsiaVL+SsLceH6cgVU= Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.43 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Stat-Signature: pioiikmgrrcujmtib1qqufx86mmx56u5 X-Rspamd-Queue-Id: 47C3B120019 X-HE-Tag: 1666537470-494459 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 AM12:30, Luck, Tony 写道: >>> But maybe it is some RMW instruction ... then, if all the above options didn't happen ... we >>> could get another machine check from the same address. But then we just follow the usual >>> recovery path. > > >> Let assume the instruction that cause the COW is in the 63/64 case, aka, >> it is writing a different cache line from the poisoned one. But the new_page >> allocated in COW is dropped right? So might page fault again? > > It can, but this should be no surprise to a user that has a signal handler for > a h/w event (SIGBUS, SIGSEGV, SIGILL) that does nothing to address the > problem, but simply returns to re-execute the same instruction that caused > the original trap. > > There may be badly written signal handlers that do this. But they just cause > pain for themselves. Linux can keep taking the traps and fixing things up and > sending a new signal over and over. > > In this case that loop may involve taking the machine check again, so some > extra pain for the kernel, but recoverable machine checks on Intel/x86 switched > from broadcast to delivery to just the logical CPU that tried to consume the poison > a few generations back. So only a bit more painful than a repeated page fault. > > -Tony > > I see, thanks for your patient explanation :) Best Regards, Shuai