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 9E6C6C4332F for ; Fri, 21 Oct 2022 09:30:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 023EF8E0002; Fri, 21 Oct 2022 05:30:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F15D48E0001; Fri, 21 Oct 2022 05:30:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E05A38E0002; Fri, 21 Oct 2022 05:30:08 -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 CE25F8E0001 for ; Fri, 21 Oct 2022 05:30:08 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9A49F1C6D4B for ; Fri, 21 Oct 2022 09:30:08 +0000 (UTC) X-FDA: 80044435296.12.0F4D1D0 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by imf12.hostedemail.com (Postfix) with ESMTP id 501FA4002F for ; Fri, 21 Oct 2022 09:30:06 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R761e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VSizZuS_1666344600; Received: from 30.32.67.117(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VSizZuS_1666344600) by smtp.aliyun-inc.com; Fri, 21 Oct 2022 17:30:02 +0800 Message-ID: Date: Fri, 21 Oct 2022 17:29:58 +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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666344608; a=rsa-sha256; cv=none; b=jhQWcFLAtl4axgVjG38GmMeAuxHLHGa3F0l0LmYiq/UvSO8EBoD7iWOiu1G/NDAUQpfhFB xHaU20d9PNdQ4kX6cCxhXCiHvwaqgGcRW0kFwhKzVpp0CsQNrJaBhUCYpQJfTSf122RY6d +GzoLqTyagcMnxy29A0sgOl73ZKb+TE= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf12.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.133 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=1666344608; 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=PFXnF83Chm79qmLaZFQEa0vpUW5a6Uewk7xVtXxjcf0=; b=schWLXeqx4dkxesWK77wRevXC8J9mquXzZW0yngUg4FAbaJ5gM7drO6TOC+Zq49VXtQR3P /H2udiEC3CevDBq/WW05RG3fiUAWZ9xza7w2zsztCKALGw6NpaCvvcyPKD9grgXoOtg0ub YwMjX8riJsrbFz06367YrG66TrTZS7g= Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf12.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.133 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com X-Rspamd-Server: rspam04 X-Rspam-User: X-Stat-Signature: 36gw3q9gphofxfghd4biiewp8s6esudw X-Rspamd-Queue-Id: 501FA4002F X-HE-Tag: 1666344606-298150 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/21 PM12:41, Luck, Tony 写道: >>> When we do return to user mode the task is going to be busy servicing >>> a SIGBUS ... so shouldn't try to touch the poison page before the >>> memory_failure() called by the worker thread cleans things up. >> >> What about an RT process on a busy system? >> The worker threads are pretty low priority. > > Most tasks don't have a SIGBUS handler ... so they just die without possibility of accessing poison > > If this task DOES have a SIGBUS handler, and that for some bizarre reason just does a "return" > so the task jumps back to the instruction that cause the COW then there is a 63/64 > likelihood that it is touching a different cache line from the poisoned one. > > In the 1/64 case ... its probably a simple store (since there was a COW, we know it was trying to > modify the page) ... so won't generate another machine check (those only happen for reads). > > 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. > > -Tony 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? Best Regards, Shuai