From patchwork Fri May 10 06:25:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jane Chu X-Patchwork-Id: 13660902 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F00AC25B75 for ; Fri, 10 May 2024 06:26:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C64C6B0087; Fri, 10 May 2024 02:26:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 276AD6B0088; Fri, 10 May 2024 02:26:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13E2C6B0089; Fri, 10 May 2024 02:26:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id ECF816B0087 for ; Fri, 10 May 2024 02:26:25 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8F8B4121783 for ; Fri, 10 May 2024 06:26:25 +0000 (UTC) X-FDA: 82101501930.07.CF4A30E Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf12.hostedemail.com (Postfix) with ESMTP id B8E8240005 for ; Fri, 10 May 2024 06:26:23 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="Ifn5HH/1"; spf=pass (imf12.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com; dmarc=pass (policy=quarantine) header.from=oracle.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715322383; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uBRlM7MJKT+rrKvwlBySf0eucmcAfjmJ5dD+RRq8pvY=; b=tU6qwCrofbgozbDYldfrBUp8dOIzGvdp2FLzzKEsA4NSTlQ/rkJRxs55gi2SyE4l/426bi XPMQ9ejNqXxNlRIPzIdBxu69zTRgAoSsocUqVVwLmh2xMnz5/jV71/GramvMiGwSuWKG+f r24Q1eOw4UXKLkKhNheYcFGD+Yju/ko= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="Ifn5HH/1"; spf=pass (imf12.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com; dmarc=pass (policy=quarantine) header.from=oracle.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715322383; a=rsa-sha256; cv=none; b=2kn0VC//FdkG8SQHJO3vFFbBFZwnw5C7nH4pb9E5mk2hqFlmmFKBrBZpKDr28CdCTCW5RQ Gy8L1kZe+N7BoOIIRo8O6TCGlD2g5Xg4Tu8MZlt45RLPZKXN8UcmRdS/eI1U4uSHgbBQyT bzVvq8rVVl7hcAOPqnhBra79ivZlNfc= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44A5t5Pv016630; Fri, 10 May 2024 06:26:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2023-11-20; bh=uBRlM7MJKT+rrKvwlBySf0eucmcAfjmJ5dD+RRq8pvY=; b=Ifn5HH/16jXv/KuOyh0nU7ZLOCsuKELF+k0X9V9hWXtSrm2ohy/Omb5WgHC2u7/8UTkj /aNgAVKlFaQnD8OwSgRkHmdFUS4nJK80kxrKf6wCNUul/ixRVKtOLdrUe3/IJzZ3BtL0 5qzayJ0RJ5IqrjOofx2TK3QfCGSyDP7h02vAoHydjq+jQ7gx9trzJT8vylYQ5KXFZMqa HC/DFgxYodABvbZYlNn3KCgWZtaOCKWAtHFH6iBc1Mo5IOTFR5hr+WMEWpkdJa/Uubur wFy3XgAIUHOJC6HxTL2g8eZWqUdWZC6uwcMUtObkRcL9SWrZnqwBSFRVXusEUexd2Fi4 FA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y1a0j88g4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 May 2024 06:26:17 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44A5vUjI020104; Fri, 10 May 2024 06:26:16 GMT Received: from brm-x62-16.us.oracle.com (brm-x62-16.us.oracle.com [10.80.150.37]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3xysfpghcd-3; Fri, 10 May 2024 06:26:16 +0000 From: Jane Chu To: linmiaohe@huawei.com, nao.horiguchi@gmail.com, akpm@linux-foundation.org, osalvador@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] mm/madvise: Add MF_ACTION_REQUIRED to madvise(MADV_HWPOISON) Date: Fri, 10 May 2024 00:25:59 -0600 Message-Id: <20240510062602.901510-3-jane.chu@oracle.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240510062602.901510-1-jane.chu@oracle.com> References: <20240510062602.901510-1-jane.chu@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-10_04,2024-05-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405100044 X-Proofpoint-ORIG-GUID: RkkUKBZtDn54AUwSlFAoI0xSgUT30iF6 X-Proofpoint-GUID: RkkUKBZtDn54AUwSlFAoI0xSgUT30iF6 X-Stat-Signature: s4fs4jterpsouur89z1trxekxsmhtant X-Rspam-User: X-Rspamd-Queue-Id: B8E8240005 X-Rspamd-Server: rspam05 X-HE-Tag: 1715322383-719127 X-HE-Meta: U2FsdGVkX1+96/WqfAb7OxhQRQRqeeDMWzEh76/nNxXiJmmwpKVoY8rfWioh432e+Dsh95U5P89zHXbaC5L612BqisGNsHeqxY0cQ+LUneIjOXMzcIdE4K0E2PiA9QHj1ixOKsP9FcztbapAisKmMu2y8gsqur5z2vWO8J6HC07BGwWCDf+hrWn9c+qrunhcyytFN6/CEaKYkm6D7vBaZyJtZO/jVKXhWhQ7OsyacwoCBpG4eAoe6x3UAnCSc6N8k+SgFrcmg4Bp/OK7+dmTVxa/5TbexEWmp4Ky/AmFCW4khhQZgpyNXXhlU6kw0W+cI0VsJydKkpCBZfBi4efMwWIn63NygAGYPwoYglH62eTwzv5fMaWMwd6V1MA8MN6KtnRZwVprDxQwe0/be0kdzyHTFd3kHSLpYAa15mCk47PmenYczFqSzchAgDgtpmUJfwnqW78LPl8hqJIsBpudwqlEtGH9p50v7ndaZSIfePPJ7TrsGTCa3gi9rPDDIHtBdZh4J9jRCeDFjO8abHIcuFfYXILX0ERl4w1a8FolDGZOBsgDw8tttJES9vZ3Up6MvDJ3wBgmOETzcZi2usBeX/NUFG6xky9wWxEtznRzM4PkQJR25+VnlT1KWnSvOsH/9I03hQ4NcT8e8IfDW1IKokeNq4HvoQMzu6w4YMmslV/WCaB1ag3OsUrCZl17CSxppKxA5juvUp1p9K3AikxDk0B1UUFxUWiDTwQ9eQKUN99C5CuXu6CJyENnLMhFdHTqjMdPdgiOqvwMJ7Q1itEaG1pGSDVSFWSX8bTgoxz9HF1PfnCf2a3ZbbqyMzYFTM8XcMX+YsNWAgoxB8mwInnLD4DLTeu7LScfyiC7HWwjyZI6gFItzWfr3CnZJ68ZMwlajaCQHvTCdqsOs6i0tw9hzkoLrJJYi4oTmool/NsPVg9X8dft5CGvklrUFy3GoWmS66a1QS30z1GQALl5L3Y eKjgaXRG 96So8ms2W74Ssipq4UEY4lCyS2PcjLbD6QaTTZRcql//QqJrh8HGGtlgqg4qbeyy7h951H5jBFeDGbY925yz1gIbRq/PqCUkoVVrjX65BMIZI33ZXxpDItQRf0Uai1lVkZlr3HHS3UYoH1/83aC9cT6QPuQ4zzqb0fcAyihhKzh7j4yOFX0LfAukKzqV5u1LW4ZcCjiqSlhkvPmwGYJIm5AzdAX3Hmda1yZXB4Bu3UfsZUYn5ytz5vvqGr4TmdzfdUAeT2Q6rTadpDEQqljW1vfTSxpYBtQqfS63wGYTUjb8j+9awUV8UF29p+a2rEk7/OFSYdTln8oH2yrY= 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: List-Subscribe: List-Unsubscribe: The soft hwpoison injector via madvise(MADV_HWPOISON) operates in a synchrous way in a sense, the injector is also a process under test, and should it have the poisoned page mapped in its address space, it should legitimately get killed as much as in a real UE situation. Signed-off-by: Jane Chu Reviewed-by: Oscar Salvador --- mm/madvise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/madvise.c b/mm/madvise.c index c8ba3f3eb54d..d8a01d7b2860 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -1147,7 +1147,7 @@ static int madvise_inject_error(int behavior, } else { pr_info("Injecting memory failure for pfn %#lx at process virtual address %#lx\n", pfn, start); - ret = memory_failure(pfn, MF_COUNT_INCREASED | MF_SW_SIMULATED); + ret = memory_failure(pfn, MF_ACTION_REQUIRED | MF_COUNT_INCREASED | MF_SW_SIMULATED); if (ret == -EOPNOTSUPP) ret = 0; }