From patchwork Mon Apr 12 22:43:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 12198983 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=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham 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 08FC8C433ED for ; Mon, 12 Apr 2021 22:43:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8E4AB61246 for ; Mon, 12 Apr 2021 22:43:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E4AB61246 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C2DED6B0036; Mon, 12 Apr 2021 18:43:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BDE886B006E; Mon, 12 Apr 2021 18:43:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A572B6B0070; Mon, 12 Apr 2021 18:43:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id 86CA56B0036 for ; Mon, 12 Apr 2021 18:43:29 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 30C591801367D for ; Mon, 12 Apr 2021 22:43:29 +0000 (UTC) X-FDA: 78025192938.24.D0185BD Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf28.hostedemail.com (Postfix) with ESMTP id E768C200025C for ; Mon, 12 Apr 2021 22:43:29 +0000 (UTC) Received: by mail-pl1-f173.google.com with SMTP id j7so7165603plx.2 for ; Mon, 12 Apr 2021 15:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LC3H1cpiJHCBM+DlZ2l4WxoB82Db8dlZgy3XW4iJx9k=; b=MruJg+xuFzaCytSuuv12vMblzQ7q5GzuCNFQGcXm+Nt1n0/BwllA6IzRBNEJfkPUFp AV6TMTGTvKWCJj+yl+J4zzuhWSgZ9GyY2jNqkKR6gRxOhlJFnTkl8g8axTdSR4j+edTX oE9mdIlsknxxUQT0/Z908lxQ05Dv0f/JULOMHTPTBvQQCQFE0TbcPNjDzooOgtEs4tl4 Ko0JzSNHOJCz50R47sGq+nEiYnuCliROrrWM5su1fPVKFtl1sHxaiR9kxxAs0uUbvcr1 xRQliwJO05PcRTOWdZXgMrGuK3Ejx2TEBUGySdj7T3FZ8mW+7fsfClLGtQVN1HakKk1k DiMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LC3H1cpiJHCBM+DlZ2l4WxoB82Db8dlZgy3XW4iJx9k=; b=kLNJ7gll9eZKI+UuTBqCVcOMgxWSPvN7c3QOtVEvQW2Vk0BpYbes8d4k8S5ktjOUyK tNnBVSbkY+KNCP4JC7rN2K0YxHW8Ian3KYZspK65iObP7YwKggNGC4Vihs+sIeWZZOej vbgLkw3Waehi6uF2kr6Zn0SWSxmtwZFCip/bFegrXght5V+ue/54CcU4gQZGj5wuqjuo CTg4hcjpP2FQf3vN/OzDtZqVZ+aJHkaQ5UwrMHB11uK4+Z4DwupwTZX3fcNy7UeNPJmu oBDceXtQlDdt468Ugc9wHixHZsnQOlJl1HB+q+3s+nT0tgNJ/lkMtcWWQndifi0dt5+s +u8A== X-Gm-Message-State: AOAM532ZPIGaK4CzSabHumHcMfEeq8vyMDFRmMYnhlR9srk30cW9JUyn NBcBKzOaAcF6T/k81tYWY4URvWl97sm5x8Y= X-Google-Smtp-Source: ABdhPJwN10UL2cdw3PwNpnbgdfVEgC35BRL0gAtn7CD1Gdwxrf1MoEjZe0CkpRgEUYHu3ff4Ofz0vw== X-Received: by 2002:a17:90b:1e50:: with SMTP id pi16mr1514048pjb.24.1618267407516; Mon, 12 Apr 2021 15:43:27 -0700 (PDT) Received: from localhost.localdomain (h175-177-040-153.catv02.itscom.jp. [175.177.40.153]) by smtp.gmail.com with ESMTPSA id l25sm13365373pgu.72.2021.04.12.15.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 15:43:27 -0700 (PDT) From: Naoya Horiguchi To: linux-mm@kvack.org, Tony Luck , Aili Yao Cc: Andrew Morton , Oscar Salvador , David Hildenbrand , Borislav Petkov , Andy Lutomirski , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: [PATCH v1 0/3] mm,hwpoison: fix sending SIGBUS for Action Required MCE Date: Tue, 13 Apr 2021 07:43:17 +0900 Message-Id: <20210412224320.1747638-1-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: E768C200025C X-Stat-Signature: 3cmzeutjp6jrcb8ghw9ngoytm6rxpy83 X-Rspamd-Server: rspam02 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=mail-pl1-f173.google.com; client-ip=209.85.214.173 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618267409-135575 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000089, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, I wrote this patchset to materialize what I think is the current allowable solution mentioned by the previous discussion [1]. I simply borrowed Tony's mutex patch and Aili's return code patch, then I queued another one to find error virtual address in the best effort manner. I know that this is not a perfect solution, but should work for some typical case. My simple testing showed this patchset seems to work as intended, but if you have the related testcases, could you please test and let me have some feedback? Thanks, Naoya Horiguchi [1]: https://lore.kernel.org/linux-mm/20210331192540.2141052f@alex-virtual-machine/ --- Summary: Aili Yao (1): mm,hwpoison: return -EHWPOISON when page already Naoya Horiguchi (1): mm,hwpoison: add kill_accessing_process() to find error virtual address Tony Luck (1): mm/memory-failure: Use a mutex to avoid memory_failure() races arch/x86/kernel/cpu/mce/core.c | 13 +++- include/linux/swapops.h | 5 ++ mm/memory-failure.c | 166 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 178 insertions(+), 6 deletions(-)