Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2354004rwi; Fri, 21 Oct 2022 02:55:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5mKGE0Nne4ByvDUbBJ/mZU01yf8VqijuHJSChh0x3bIrokFfiGEKqhzYt3aoaGPgczwhBj X-Received: by 2002:aa7:c60a:0:b0:458:d707:117 with SMTP id h10-20020aa7c60a000000b00458d7070117mr16616941edq.258.1666346135921; Fri, 21 Oct 2022 02:55:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666346135; cv=none; d=google.com; s=arc-20160816; b=ai3QYFSnrLN7N/StvwOnZl7sTdrVM4FOSHPzQQd3Vg9OKsBhWfdA250lzWNvwgYhBv v/DH37eTt9fyvdAaj48V6BnIs6qLXdsM36KOzpVpZzIy8LuOLnPZyuSHqqnTu1AXfbnq DboMiS/Uz9ECdYB5Vuj/9w5l18as40qzeM6RF0YdUizg/gBlj98+WNKy5BNz+A5eSwkp tiduyoSEmiJcqYoCzSM7T94rQragkR0zHgy5gRDMs+sOumzQ05PF6eOw709f+xGtoNY+ J7WQBGM888EdH+hS+zLt92RtT05M9Yi9FJ6TMKb5K42FV1B2Qgi/+c0fsXK8a+FJA6+c EdRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=PFXnF83Chm79qmLaZFQEa0vpUW5a6Uewk7xVtXxjcf0=; b=OT4JzT/419Bt70M713TygMHwkiWpaN3/Ap9/74S+PV1/gNYEa3Z89vqhWtytOwFVHn hPVbgdk9tpkCk4jtXRQYijUMO0cw5WLlXtIJYIYd2RDPqZlbygezcJKkkb1n26k2Qw5R bqNHrafc8cnt4qxTv5FWj/Z7eZCMp1iue9CHeVau9z/D0nr2X/Xw9hQSj7G1+jeJVS3R fSI2WwMk21BLH/PV4jbK2r92e3XBwWp3OgwfuhBNHEPJ4YiQxwsXW3JLCUHaD950au7V xDhUYjWpwFI815C5rGZWOBWezIKh4R32cjgtzeUbMcq+FAwxReLy6sdsJFbIrI3yetox ZVBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz1-20020a1709072ce100b007919165b065si13711192ejc.294.2022.10.21.02.55.10; Fri, 21 Oct 2022 02:55:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229796AbiJUJaM (ORCPT + 99 others); Fri, 21 Oct 2022 05:30:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbiJUJaI (ORCPT ); Fri, 21 Oct 2022 05:30:08 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D48C8B1BA6 for ; Fri, 21 Oct 2022 02:30:06 -0700 (PDT) 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 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 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