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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 D33C4C433ED for ; Tue, 20 Apr 2021 15:49:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 45AFB61354 for ; Tue, 20 Apr 2021 15:49:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45AFB61354 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9BE0C6B006C; Tue, 20 Apr 2021 11:49:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 994246B006E; Tue, 20 Apr 2021 11:49:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85C966B0070; Tue, 20 Apr 2021 11:49:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id 6C0946B006C for ; Tue, 20 Apr 2021 11:49:16 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2DD9E8249980 for ; Tue, 20 Apr 2021 15:49:16 +0000 (UTC) X-FDA: 78053179512.20.312F6A7 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf24.hostedemail.com (Postfix) with ESMTP id 1CD72A0003B4 for ; Tue, 20 Apr 2021 15:49:06 +0000 (UTC) IronPort-SDR: 8R+gRqZcykF4lmGVfmE15C2IQwXeniby/eqmn1efZODknNkPIt8KhrIW5i+R2Otlil/fKdtmuN VS5gFP89W1Vw== X-IronPort-AV: E=McAfee;i="6200,9189,9960"; a="193407029" X-IronPort-AV: E=Sophos;i="5.82,237,1613462400"; d="scan'208";a="193407029" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2021 08:47:33 -0700 IronPort-SDR: 3yWPQ97nJMs3J79JWj/qOc42O12pgrF77tfk72lUoKm5vBC6hK/t87dDAu9apgNncbsONx1W5G ez1juHxoRvYA== X-IronPort-AV: E=Sophos;i="5.82,237,1613462400"; d="scan'208";a="463164595" Received: from agluck-desk2.sc.intel.com (HELO agluck-desk2.amr.corp.intel.com) ([10.3.52.146]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2021 08:47:32 -0700 Date: Tue, 20 Apr 2021 08:47:30 -0700 From: "Luck, Tony" To: Jue Wang Cc: nao.horiguchi@gmail.com, akpm@linux-foundation.org, bp@alien8.de, david@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, luto@kernel.org, naoya.horiguchi@nec.com, osalvador@suse.de, yaoaili@kingsoft.com Subject: Re: [PATCH v1 3/3] mm,hwpoison: add kill_accessing_process() to find error virtual address Message-ID: <20210420154730.GA577592@agluck-desk2.amr.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: rb5qeiuy6e51wuz5i59drmjj9u4sorgc X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1CD72A0003B4 Received-SPF: none (intel.com>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=mga04.intel.com; client-ip=192.55.52.120 X-HE-DKIM-Result: none/none X-HE-Tag: 1618933746-756784 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: On Mon, Apr 19, 2021 at 07:03:01PM -0700, Jue Wang wrote: > On Tue, 13 Apr 2021 07:43:20 +0900, Naoya Horiguchi wrote: > > > This patch suggests to do page table walk to find the error virtual > > address. If we find multiple virtual addresses in walking, we now can't > > determine which one is correct, so we fall back to sending SIGBUS in > > kill_me_maybe() without error info as we do now. This corner case needs > > to be solved in the future. > > Instead of walking the page tables, I wonder what about the following idea: > > When failing to get vaddr, memory_failure just ensures the mapping is removed > and an hwpoisoned swap pte is put in place; or the original page is flagged with > PG_HWPOISONED and kept in the radix tree (e.g., for SHMEM THP). To remove the mapping, you need to know the virtual address :-) Well, I did try a patch that removed *all* user mappings (switched CR3 to swapper_pgdir) and returned to user. Then have the resulting page fault report the address. But that didn't work very well. > NOTE: no SIGBUS is sent to user space. > > Then do_machine_check just returns to user space to resume execution, the > re-execution will result in a #PF and should land to the exact page fault > handling code that generates a SIGBUS with the precise vaddr info: That's how SRAO (and other races) are supposed to work. -Tony