Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp824691lqb; Fri, 24 May 2024 14:53:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWCCSRWM5jcbN20D4DsgvREdH62ViH6JKWa2qjPC2M3cxmGQzHS/pJA7b0wZ9f4GnOZmFY/9riqf1iwaEcQrRmH6ftSVhsEd26SNH2YQA== X-Google-Smtp-Source: AGHT+IH7jYnbck+j6zY+/eMsg3c2bscij6PVDJnH1NoxG6UXuNjPgqg/4wrYC7/zkU7FR6ahmFmR X-Received: by 2002:a17:906:39cb:b0:a59:a979:2b03 with SMTP id a640c23a62f3a-a626250ce27mr316098566b.23.1716587631515; Fri, 24 May 2024 14:53:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716587631; cv=pass; d=google.com; s=arc-20160816; b=EH+MSjms5D2dq0Gg7hRziHeDq9anaq8FqqJ5Y3YgZlyRZ7QL462Y0BR4ehvxC6lmrk C+Fq9XCF7eUxWU3dwg5CMud0JCcYVvyE8IZrf+2MEmZmYAtPeDzFsCpoMcZK+Pg/Jy8Q HfGukP71jnWYeHc2b6paZm5mx8/cvzjxjO/mAak/6dK1kobbUTlui01su3DVyGoYpT0E 4AoNBpkbOGgONXjwfFdYnAtblmoRVGnL5OfepzDPtUyrRMoc5d1r5BhZTlw+Eht1CaXL InG9l3W9O9XhXCDx6t5xY6gWUUwd4TXXB6Q90hTEoQCecBKqgFmZqaPzadG1FrKapMoZ gteA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=fT0mhbFhuyfEQ6ht8rgkYeHmF9I9tk49P2eL39tTz8s=; fh=U9HDw+13QAqYHhevvQoNs+C9ejuRAN20V1D1XLEiQzY=; b=rhwyWnTOtl5t0mdwS/jpvrOWaErovBSrLB1jCN/Mf+vERmqUWiKWkJpXs+zH31J++6 6eHKSEW4Eo3h/a9vpiNT2vV8Q/lBc9Q4/d77XObc4KZfMoXAVBUmouOVKcOty2oUOYCh 1qFeRCkSvctro1CRKAvhb6+buOqEQtH7J4Pj8NZWKM2fw5M84PrgJAY9ARmbtZJgW4Da hOc7gxdQHa30ZXHhmKjR1JKR1MBIjN3KqR/K2ra6SD5ttl/b+RemVm3gDjEIm43If2FE bjH3xWshnO15lS5AmUfBm3I+jQGnl5uGen7fRnBRi6n3BGMEawMfGuv8Ao1LHzhvHan/ gMYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=BljuSLIh; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-189158-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189158-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cdd37c1si115607766b.1029.2024.05.24.14.53.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 14:53:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189158-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=BljuSLIh; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-189158-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189158-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3F40D1F221F1 for ; Fri, 24 May 2024 21:53:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BC0712B176; Fri, 24 May 2024 21:53:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="BljuSLIh" Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C2648612E for ; Fri, 24 May 2024 21:53:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716587610; cv=none; b=j741K8klozwvAuAc3MDcUuRSiT5pEb1ZfgcUJSI8UtIxkgZUde3wTcA59IkaF9P3ozzwCZfOGmU5yTx50jk2F6BZnwj76j18jTVhkC+7KGSyVf9w7k60iAz/8sKzlpN0qGgt6sXCD8kCYrMsI8VbfU1RMHSHrCLtAsxuE+AI68w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716587610; c=relaxed/simple; bh=mT+QH+hU8g5l3Zv5v9XCenrx59MVtbIUnXCOz0uw8J4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oFjlvcY6KTjutFX0uI60j2Gh5DdR11K8/mCeThOvCVq2Ro3TGlrYDpe3RT8+g/USH1qObWKKTofRG2by3rZH1fWVJaOlscfY723adM3smlA1Z/1jVzDfRQTzkWEkWqjWUSPdaeG7UeEvGWXZdlHi3/+XAoP9qu4L9jk5gkhWwfE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=BljuSLIh; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44OIC2G4010959; Fri, 24 May 2024 21:53:16 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=fT0mhbFhuyfEQ6ht8rgkYeHmF9I9tk49P2eL39tTz8s=; b=BljuSLIhlHGj7+LZ9Fli7rwBFZcnSBIe7v8KKY5KV9Egm878l/J+VHH1xWXi8MoITsjp kT67s5ZBWYovpiWSkPQxGbIwGh+5yy25XDlcrS7IqgZ9tN0mFrep4btWoUP617Ak5UwF sTEf1cmEmBTiT8VL57c+SmsN5qxe07nReb5HNVL5rwTPrbgy0wl/Ttqd6Z8n06tl1pVH HdzgUAqITKS24dJjoA79lJp1QDcgdImTdegcU//MdKMPwvcgJP/0B0onuBIUPpJovgzX pz9xGdxlLjYOQDg+Can6zxaztk9PTsD2n/ASTnnqIZl4vJeJO5E5vl1qonSnInCZDOij 6w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6jx2n8wy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 24 May 2024 21:53:16 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44OLjG1A035956; Fri, 24 May 2024 21:53:15 GMT Received: from brm-x62-16.us.oracle.com (brm-x62-16.us.oracle.com [10.80.150.37]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3y6jscbsu0-3; Fri, 24 May 2024 21:53:15 +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 v4 2/5] mm/madvise: Add MF_ACTION_REQUIRED to madvise(MADV_HWPOISON) Date: Fri, 24 May 2024 15:53:03 -0600 Message-Id: <20240524215306.2705454-3-jane.chu@oracle.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240524215306.2705454-1-jane.chu@oracle.com> References: <20240524215306.2705454-1-jane.chu@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-24_08,2024-05-24_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405240157 X-Proofpoint-GUID: 7grlyNM4N9_MwCVNy18sOMTXeKd1BPaf X-Proofpoint-ORIG-GUID: 7grlyNM4N9_MwCVNy18sOMTXeKd1BPaf 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 get killed as much as in a real UE situation. Doing so align with what the madvise(2) man page says: " "This operation may result in the calling process receiving a SIGBUS and the page being unmapped." Signed-off-by: Jane Chu Reviewed-by: Oscar Salvador Acked-by: Miaohe Lin --- 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; } -- 2.39.3