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 58BC1C433ED for ; Tue, 20 Apr 2021 15:49:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CC5A613B0 for ; Tue, 20 Apr 2021 15:49:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233017AbhDTPtu (ORCPT ); Tue, 20 Apr 2021 11:49:50 -0400 Received: from mga01.intel.com ([192.55.52.88]:34178 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232504AbhDTPts (ORCPT ); Tue, 20 Apr 2021 11:49:48 -0400 IronPort-SDR: bU48S0RrUvJcDLVtv9EVqhiBxKf/8bcetaNgPxzam3Hb+ROEZ7BxVScNRc6luhw4C8eZemtutz OZ7eUYd5lBrw== X-IronPort-AV: E=McAfee;i="6200,9189,9960"; a="216140635" X-IronPort-AV: E=Sophos;i="5.82,237,1613462400"; d="scan'208";a="216140635" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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