From patchwork Fri May 21 03:01:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 12271789 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 EB397C433B4 for ; Fri, 21 May 2021 03:02:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A2A266108D for ; Fri, 21 May 2021 03:02:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2A266108D 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 122D18D001B; Thu, 20 May 2021 23:02:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F9FB8D0001; Thu, 20 May 2021 23:02:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB5BC8D001B; Thu, 20 May 2021 23:02:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id B69D48D0001 for ; Thu, 20 May 2021 23:02:05 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 55D38180B260F for ; Fri, 21 May 2021 03:02:05 +0000 (UTC) X-FDA: 78163739010.35.CEB2396 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf15.hostedemail.com (Postfix) with ESMTP id 6C07CA0001CB for ; Fri, 21 May 2021 03:02:03 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id cu11-20020a17090afa8bb029015d5d5d2175so6556117pjb.3 for ; Thu, 20 May 2021 20:02:04 -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=wDCqTxRCvKvq40fcsT0cEmcZyjzoY19iElps9bxazFU=; b=qFRo/g1wdeTiNOvWl41zLpPnlJGxEd0bOEtofJ9l9r2rpdrjAO/1NWvIbEaPe1dvrV JG0j85+OqBTOCMxtXwHbctWye+1eDlVBsO11Fx7qykYNzRw/RhGNbHX/dHTBql4A88HF ZEtKi+zi1zOg6XGTXBODzZQZ3NH/6NDwYVwkI2beEmcv0N5UsgKZKJS78DkuTCMMAqgo e3mozQJAnVnrC7bAKWVx/wPrGJmUmY071uz/XJzd0MikbPW2BHSsl+SoqilG1ci7LSzI Q7dkhAzCfyX7IERiLFnodX8CEzHW0mx+1Ze7GvRyBQ7OKFZnl8lFuBscL/V0FmvkfUzV 7SGQ== 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=wDCqTxRCvKvq40fcsT0cEmcZyjzoY19iElps9bxazFU=; b=DRAxlepOBAV/iu71sBqPz9lq8r+EN1J5/lE2X6K/ma7J5dfW8vJnpKWqWkInOh4zwh UMdgwShxgEAq7PhmWbuLr7SSlSRClxEpeqtnLBV0GNpMQzWeEU7pMaIyLOsS3DQc+WK1 aT1SI/ZQOrc+KizIseVesT3KVIeer6tDQlDKuidyiF2FfHpqcT+RJxi3uzDjV/r0BEUJ GUdQFsqy1ePHTWtlQS5Kccl/ishb4dlxYNRg7Zsuu9GAObwuJCvyver50rlbupxwH6fD puE3crWlucAV+FVqOTYlRY8tVfZ0C2EoW5tU0ZqqE2qoNeWRjs7+FHqb8JZnZXqEdt57 TCkA== X-Gm-Message-State: AOAM531uprAmdduH3iaRCla6WySXv3wfBIz4bU2Vc3Qa44BwPd2RgZq5 JXAHFpBWjwaxG4WyQbLklQ+DHawn2K8V1GM= X-Google-Smtp-Source: ABdhPJxMvDDX75j1xA1E1unnWCRQaaxFQgeb+gKhDQ0f5nHjCfIUuFopGJxc2W4PIz9c7VUOT1lsuQ== X-Received: by 2002:a17:902:b68c:b029:eb:6c82:60da with SMTP id c12-20020a170902b68cb02900eb6c8260damr9534824pls.25.1621566123765; Thu, 20 May 2021 20:02:03 -0700 (PDT) Received: from localhost.localdomain (h175-177-040-153.catv02.itscom.jp. [175.177.40.153]) by smtp.gmail.com with ESMTPSA id 191sm2959677pfx.121.2021.05.20.20.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 20:02:03 -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 , Jue Wang , linux-kernel@vger.kernel.org Subject: [PATCH v5 0/3] mm,hwpoison: fix sending SIGBUS for Action Required MCE Date: Fri, 21 May 2021 12:01:53 +0900 Message-Id: <20210521030156.2612074-1-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="qFRo/g1w"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of naohoriguchi@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=naohoriguchi@gmail.com X-Stat-Signature: ftk16891ztte6ij9c5hgxys78j4c3pmn X-Rspamd-Queue-Id: 6C07CA0001CB X-Rspamd-Server: rspam02 X-HE-Tag: 1621566123-714801 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000497, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: I updated the series again with the following changes based on the discussion over v4: - separated v4's 2/2 into two as done in the former version, - switched to "first found" approach in getting error virtual address, which could report wrong error address to applications but that's rare and not critical, - rebased onto v5.13-rc2. v1: https://lore.kernel.org/linux-mm/20210412224320.1747638-1-nao.horiguchi@gmail.com/T v2 (only 3/3 is posted): https://lore.kernel.org/linux-mm/20210419023658.GA1962954@u2004/ v3: https://lore.kernel.org/linux-mm/20210421005728.1994268-1-nao.horiguchi@gmail.com/T v4: https://lore.kernel.org/linux-mm/20210427062953.2080293-1-nao.horiguchi@gmail.com/T Thanks, Naoya Horiguchi --- quote from cover letter of v1 --- 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. [1]: https://lore.kernel.org/linux-mm/20210331192540.2141052f@alex-virtual-machine/ --- Summary: Aili Yao (1): mm,hwpoison: Return -EHWPOISON to denote that the page has already been poisoned Naoya Horiguchi (1): mm,hwpoison: Send SIGBUS with error virutal 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 | 188 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 190 insertions(+), 16 deletions(-)