From patchwork Fri May 24 21:53:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jane Chu X-Patchwork-Id: 13673756 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 F1611C25B74 for ; Fri, 24 May 2024 21:53:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 602C36B0083; Fri, 24 May 2024 17:53:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AF5C6B0085; Fri, 24 May 2024 17:53:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49DC56B0088; Fri, 24 May 2024 17:53:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2A38E6B0083 for ; Fri, 24 May 2024 17:53:25 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id AFB0E1205D3 for ; Fri, 24 May 2024 21:53:23 +0000 (UTC) X-FDA: 82154641086.19.8358AD0 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf18.hostedemail.com (Postfix) with ESMTP id DD9F51C001D for ; Fri, 24 May 2024 21:53:20 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=TdcJBpGr; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf18.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716587601; 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=aVvMSdU9di+/pg8Z/YTSNT+1WpNBkHB9jxFSgsTIf2I=; b=HkYbQ6lkAeem/TNSF0KICsJMDBXZW382F+3Xt/eYfzFWYoTBbmLkZ8/vkChBz2qGuAQf9n jzB1hdN0JVOmjC5TqRxBsPYeTol4FR2xPu9d5i2fEBiwOn5yh+m2ndqMPU54j+WmkAqOP5 d1eEui/8VCY03yxL40FkzDN1/spPHCQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716587601; a=rsa-sha256; cv=none; b=AMrW6JSL+UEvt3OVJo9VhOo0mJCbnQhWUo7/2eRpUmNVT+LnxeoPrrghab+WTZf8nzsYHY bMn/pNOO9P8kqnhJHGNPSptrcHux4UWncSOQVhRbBNZNwvbjn3iS+Rinl0QoHPS3eE2tNL ln5PyRXAwcu1ouk83TQ5aGlswkXQnZs= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=TdcJBpGr; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf18.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44OFxjhF015807; Fri, 24 May 2024 21:53:14 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=aVvMSdU9di+/pg8Z/YTSNT+1WpNBkHB9jxFSgsTIf2I=; b=TdcJBpGrNn3qNkMVnilcUOPTUhxoR9n7n423lwhS5dNLcFnxh/pfSDcXomK4xUAAhiVX wP16N+QrVrskqaU3hspLv/12qFhlJuv6yPMsvpV+ttDjIBK9ICbqduZY7Gy5v2rvAIzq z/XnRrIIEl6fT588jno8RVTyxteuGWRg5RfLxAuRuluE9pf+8pFjHnkqNzNOEtwY9/T/ 8xKDCf0hmOW7HMqnejHg1y2haNxqOWSatRApVgawilJbqXdcH/x+Mscnb+u+A9qnEd78 YP+x++oJOdx5JMQ25xDlKuygN9UcKzsbGEOQHHvkBG+VyRvAhkZPvaxI0+z3pWo5nqjQ BA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6k8ddd00-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 24 May 2024 21:53:14 +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 44OLjG18035956; Fri, 24 May 2024 21:53:13 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-2; Fri, 24 May 2024 21:53:13 +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 1/5] mm/memory-failure: try to send SIGBUS even if unmap failed Date: Fri, 24 May 2024 15:53:02 -0600 Message-Id: <20240524215306.2705454-2-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> 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.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: FZtvSnJWRGZRRG_af1fn4jAKDaVUcprt X-Proofpoint-ORIG-GUID: FZtvSnJWRGZRRG_af1fn4jAKDaVUcprt X-Stat-Signature: 8ijioiep89k3rn143mn51d738tpgt6id X-Rspamd-Queue-Id: DD9F51C001D X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1716587600-382202 X-HE-Meta: U2FsdGVkX19gyrnHmEOONBSeQTEwlludLmxPV3aixcB8VK+kOQaOzbFvz2O2gqmCHMnzUmOs8qR/GL2uV8yMyD/wx2E9yO52xno64Muo+n2hPFFYxe7rMPOU+l5dV2CSPAzD7rmcEX+7ZrMesrqZmmCoFEuX+f3qqjkkZSCn6Ukzk6UoPUBHVRJQcflxaa2zZD8SNNMOmadKuL2JTu2vr7I7C+qJtrQVblQIuVzPm9I38aNMIGsZUFNuaHFRSoiYvfqUzlSaGfcp+waMn8Zie2uS9IVoR3k6/4zNmUoquy9+fDLrBqt9nRwu0d8vgjeI6rB+aettXxv4p5ffjCXSj8XjnhLhPRYQT4YccrluCi5oeMEb878zkqUXa/A4QTDom6MzJm3B5BxKjiihmZcd0wvrdzZE3wXQAqc7cerfn4wyU3De5epLhpHSk/9Ex6zFuDA4LKVwmnSL1riyeHlX/WZfb2Yf6JtM8GI1HKu38Hf9e9poq0q8iolqCvYmRxnAySUop7SfRSG2ylnv2WobxzX3dau7HoYefd6fih6Iw/36c8V2VD5wRKo+nQiBTQvqJ54ezAPpCJesm2dZj2oPz/F8zAXp9G+AuRQkFw7ZRr+QaC9xLHkqkdYIl9+Ga/hVwJRqurTQL466Zrc4Rdx6dU36hcHpvn7LwvXiAjgmcRcqroOplcDA5gPGaSXSpcuvAO3ncRYKIa1qN1x4sLjIuZ8o2/mYgPvROhht47FcsIfWnXKR3idCSUMr7sRmk1RF2SwuqUOt35ZlAc7WcZFYHKG+oH+l4DdrVQ0u64jJv1PoC3f+vX1p2+4mjFTh5Df7r+xkeen2NVMNqlTJQG6kODOJd/vsMfSE/nSSVNSp6HK1DOAToFD+QDALrQeZry9jY2D83rSUNY05xBaestlZsE2YuWK0gDSp1ZgavCM0nSreqeNa9v1Ejeqlmfr6dvK42PQE15xxypk2OKl+9f3 Hu6q6tKD K0va3 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: For years when it comes down to kill a process due to hwpoison, a SIGBUS is delivered only if unmap has been successful. Otherwise, a SIGKILL is delivered. And the reason for that is to prevent the involved process from accessing the hwpoisoned page again. Since then a lot has changed, a hwpoisoned page is marked and upon being re-accessed, the memory-failure handler invokes kill_accessing_process() to kill the process immediately. So let's take out the '!unmap_success' factor and try to deliver SIGBUS if possible. Signed-off-by: Jane Chu Reviewed-by: Oscar Salvador Acked-by: Miaohe Lin --- mm/memory-failure.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 16ada4fb02b7..739311e121af 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -514,22 +514,15 @@ void add_to_kill_ksm(struct task_struct *tsk, struct page *p, * * Only do anything when FORCEKILL is set, otherwise just free the * list (this is used for clean pages which do not need killing) - * Also when FAIL is set do a force kill because something went - * wrong earlier. */ -static void kill_procs(struct list_head *to_kill, int forcekill, bool fail, +static void kill_procs(struct list_head *to_kill, int forcekill, unsigned long pfn, int flags) { struct to_kill *tk, *next; list_for_each_entry_safe(tk, next, to_kill, nd) { if (forcekill) { - /* - * In case something went wrong with munmapping - * make sure the process doesn't catch the - * signal and then access the memory. Just kill it. - */ - if (fail || tk->addr == -EFAULT) { + if (tk->addr == -EFAULT) { pr_err("%#lx: forcibly killing %s:%d because of failure to unmap corrupted page\n", pfn, tk->tsk->comm, tk->tsk->pid); do_send_sig_info(SIGKILL, SEND_SIG_PRIV, @@ -1660,7 +1653,7 @@ static bool hwpoison_user_mappings(struct folio *folio, struct page *p, */ forcekill = folio_test_dirty(folio) || (flags & MF_MUST_KILL) || !unmap_success; - kill_procs(&tokill, forcekill, !unmap_success, pfn, flags); + kill_procs(&tokill, forcekill, pfn, flags); return unmap_success; } @@ -1724,7 +1717,7 @@ static void unmap_and_kill(struct list_head *to_kill, unsigned long pfn, unmap_mapping_range(mapping, start, size, 0); } - kill_procs(to_kill, flags & MF_MUST_KILL, false, pfn, flags); + kill_procs(to_kill, flags & MF_MUST_KILL, pfn, flags); } /* From patchwork Fri May 24 21:53:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jane Chu X-Patchwork-Id: 13673757 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 0859FC25B79 for ; Fri, 24 May 2024 21:53:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 760BA6B0085; Fri, 24 May 2024 17:53:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E9C46B0088; Fri, 24 May 2024 17:53:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 589596B008A; Fri, 24 May 2024 17:53:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 35C146B0085 for ; Fri, 24 May 2024 17:53:26 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DC59D8079E for ; Fri, 24 May 2024 21:53:25 +0000 (UTC) X-FDA: 82154641170.19.54293CE Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf19.hostedemail.com (Postfix) with ESMTP id E4ABE1A000F for ; Fri, 24 May 2024 21:53:22 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=BljuSLIh; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716587603; 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=fT0mhbFhuyfEQ6ht8rgkYeHmF9I9tk49P2eL39tTz8s=; b=AQmK2FkySITUsDOmEejKOrYe6tec5RwxKpKgDQTPqueeJKxDexTvjm7b8a7i6Zc9KbSJgk tF4vz4gOvHW32XFbkbD+q/e/QpgomxMas6V2L8S7Hdyj1oZdFxh6DQeSAPO7HJeN5u5n9j g66lH2h6iQOUrctFcD0rQfoVAgaysa8= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=BljuSLIh; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716587603; a=rsa-sha256; cv=none; b=eaOwGbC+eFv5Z2fSq+4oXXRX+g7OwDfAJsrS6AT2Jgpx+E3LaviF4UQPoUx1WRkafUABHj iO/wHSl6xBIulzdqxbOE7ZE6K5h3BRtMPqxrCftbILs3jZV+EsuFX93Kf0gm70pohDHBh/ Yde96bv6nGrT8g+scI5rWIrxT6pJkdI= 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> 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.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 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: E4ABE1A000F X-Stat-Signature: nmomtt67mq4xgkzbgcu1xx8f4ur9oosw X-HE-Tag: 1716587602-811809 X-HE-Meta: U2FsdGVkX19iPIne6F0waBIkZGzRYjeJdnZlBJdGIDcFSmBMyV0fCvwIMESRGBRXNqUjD+iEiNmTSHlU9YZhQ0341jzgXsHYuLA1t97PWYzePZ6jAid8Mm/vkoZUfkBbUvlytWEEmeuMTORi4Jj5h7mRrcfA2i1r4DvN7sHU5+Fk3SjKZzOTZh33gXBeo5skMB67h9LPBAD4+pl36DZjNeiP+3x1xZJXCJ/vPfiXEA0nLvYXQAz3ob3QLwAePNyNNF17UyhCDbiRVdNkPt6JBqeFL/7TFRZ4J3GlE7KlpO8bq9CJ4ujrGe0sSX8iEVwr6kIObAN4g1u5Bo2JZUXcVFFkYdbO6+ThnY4ERyG/BPAy8Yc4LQ5sEHrIGqowHPeIM4spBVvUFE0cxObYziesr1sZVjBgRHG+sWTa2RnAuD28zhZvA+34eNp+vNj7UOaVHQ4S6JnghaprMSOPFcuU1oMQsRx17WrrkuPeOziA6UqVLYNVehqLwObw3U6jzSa6s1H8KfW6lqu8phnHMwmmPa8NoiFYIEeZRP6SZkjJVrcWrP9kRSTXCse1wBLsh0YnOa7FFgK2B2wogL+qFl6cJhAJCMyUVBU/4AfCElU/IXFvsEn92RZeG9R7HXF2vB0+YIKWHjUhdAM9AUoqkBfDA3UB99xYxwARMUBwCtjo9AZi+UmRK8LHKsLsXyddX0OTez7hsGPrzFayVRww2l05eRs6QZzyf1sZbBapL8IH/YbGiO+n64GooqDdRotAz2B3qUv90+zqXXD3wfPL5kPcIiomxhFfWNg9OuykBJuRQ7n27lY1QS7qX0KhMcXro+8m/dtrwnfGDxyFV1tklvuU7W0KuGH1tjpK2Yf6Av5pzx/G2f2sUWEOVJ2OXHRwtGaUBF43Y9M4dpIenvC+0Y1H8EGOY9q5elEutfMqugrjsZzk5HhxqcWqz07ICYzd7bAP6eR4rTmhpR4tI9UTcIw rt3+HLgH 9pLQPHkuoQPi5BQncjHURrWudVdnigVCWaesKPYcsg72ID/jD8znQQRKv3/slSwfXgVwfQMIA4cUANNPq6/V1YHPBjYPfkh6dj0WQuHI0h2cxNTyzIsrzJnJXmzhFMvo5XJBp9TfgjEH/23JWbmI085aY/XLVGjt/hyRy7op86q0C/iQmxLKmLflI7jpZ39P9cthEytTb1RIFuVpX3L8Bd+sJlcmA1seNpw4u5noXNMY7huktNOnkORR3PyoVMTBOz2JLgj8cbPNCPabpEo1gkOy9RsqUVVxDyrjnIsY6Q6inIed9lXD0kQHojVv9A6eoMcIuQ6nsqH00UGLV76T0/sthrclLoZOeLgmr 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 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; } From patchwork Fri May 24 21:53:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jane Chu X-Patchwork-Id: 13673758 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 8405FC25B74 for ; Fri, 24 May 2024 21:53:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B9616B008C; Fri, 24 May 2024 17:53:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 169DB6B0092; Fri, 24 May 2024 17:53:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0585F6B0093; Fri, 24 May 2024 17:53:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DC4AA6B008C for ; Fri, 24 May 2024 17:53:50 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6FC6514036B for ; Fri, 24 May 2024 21:53:50 +0000 (UTC) X-FDA: 82154642220.07.DA4C3A4 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf26.hostedemail.com (Postfix) with ESMTP id 9389F140008 for ; Fri, 24 May 2024 21:53:48 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=f0IW7CgH; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf26.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716587628; 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=7HYN1EpHhN8K7/QWXfhCO5Xkdz0SMhL/TG8r2CsGXTY=; b=hJRb14J+qbZXe8flnFWwsHPT1KVjJjKZ2Xmm9nDiLx//Uatk1Obyop5Kj3C3MGALGdtx4h lkRqfPSpuDPJLe46gie5gcxuXfZiPvrTr9BrORkpWdyb/mBzpbcknb1AOEIb/OHG68fIej AEa2+CXa7doexbTKeg3vpEIWo4Ev5To= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=f0IW7CgH; dmarc=pass (policy=quarantine) header.from=oracle.com; spf=pass (imf26.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716587628; a=rsa-sha256; cv=none; b=qQBFnIOXBXz/YlBM555N9aWzcz3476BGVwR73m3RecCnldKzrpC2IE7v5dTgZ77QdH8mLZ usim6MQMZuzRXSTYfXOwPauSpuBmXZtXFRBYkFFGx6Ui+GkWdQXHUZTsBSgt0qj/L92lJ2 oNBvZXgRqOpYpkCqoHIshI64qVrSg2k= 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 44OFx1PV020088; Fri, 24 May 2024 21:53:44 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=7HYN1EpHhN8K7/QWXfhCO5Xkdz0SMhL/TG8r2CsGXTY=; b=f0IW7CgHhxEM/jkAAr9fsWvW80EjOTg3U1E+Aunb7J/MnOxa8mzWmn5h8o+z36Ougs1R j7mySjed4aSn7Gj2WGdbKGKSDbyeUBeIJPMJ1ixkjbIe8AMwpxH1cQEhQ3bdjQk285MI uMCFag5BEhdMzWUituxLxLmpPr7qXrV9fkXyHeB+Foy19xBnGYm4LsWk9yYW0ljxREXl Y4I54CbIY1NB2m7nngKDmzJWwmnDIOwrrm1CSQTb1aV5ZGkysrq2rit8nPt3+aIpAWlj AKFIg9WwBL26PdNS9zBStJOBfx6FuwC7d08Zspm4khQP5eFIJbH1BGH8975OJFIIXm2l QQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6mce5h56-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 24 May 2024 21:53:43 +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 44OLjG1C035956; Fri, 24 May 2024 21:53:42 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-4; Fri, 24 May 2024 21:53:42 +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 3/5] mm/memory-failure: improve memory failure action_result messages Date: Fri, 24 May 2024 15:53:04 -0600 Message-Id: <20240524215306.2705454-4-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> 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.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=940 adultscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405240158 X-Proofpoint-ORIG-GUID: _mdySqjhmz_UPwiin9TJeXbOJ1k2kgS6 X-Proofpoint-GUID: _mdySqjhmz_UPwiin9TJeXbOJ1k2kgS6 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9389F140008 X-Stat-Signature: ng64z7kj1bdtko67waeysehy9u1moxuk X-HE-Tag: 1716587628-578504 X-HE-Meta: U2FsdGVkX19K8Wsd8sWxyJ5lkfcaK0w1+0kGvcJJePsreJ6PgC1pyY99d5JrWROH6sruG38wjJtPicWEm3LqCFHhdQMyqujQCx82oRIWNEZcIip4qbCLd2+2+HDKUPZBJ5R365GRN/nBFuGU9wIMDoz/drSLZzzLu3vkEERuTROZwl6NCe22oPbQHreFQil19YRw/UisP4+3uF4OKJjEPsSnNNUcT64HfCElaeow5633I8SJ2xP6jS4AxQ2/lpB5NXOsA2VMKuy4HCBa1HHoo1Hspi+968o2vL2k5R88zYr/QITYXu4G0ffomIsdPqlFucFSE+F2jhCYDPvcx6SSRzAxLVFYcSG4SIC2jFVZBx+x9Uff3RdjqAGSFOV7kU+0IBKPyk8D89ClRQFZabCE/d1Q5WU0yWhemWnn1hSy/AE9vKZiumRMaf5oNkrT2xLoEwq37YxCoYY+9cpshmKv4pUEt6Ps4/+c6Fd35mO5ILwFSwuZuZJ1/8R+bTcn3zaMNB3ooZ4qYMBkBTKUuXQqfMdvWfJ9MlCMgGh/fjMSGmGRie1HFJP1dQpFDS5Eu/UVlzUUd6DHm50DwKrWIMeXFmT/JisHk2BlVbpel3LA7VgHZ2hz3ranGM1vyH5ImRg8EJ5f/rN7u3XflrDJ69DqIFjuyGN5YPevwWetx6QtqGwv1qouimrJylvglkouSjpcg2kLrf+dCIfZ9qKJdifpGNb0U/4riMB5NcxFX7fH5U+PjEeadaBVmK4TXVVl25lA9gvsMNg9EEFyDT5PX7qskrAIrtVXCATveUhcTK2sM5D5a6x0VuoRFYys0VS0ixnx134AUrxbitOXhmGC6IQ7yEy6MaG+oHNiVptrsqK6CjkJcX0ofhrIsZibs4+SeSMTpjZCbWqLChO+F0tJ1mpZQ681fFs3s0Gp5KRXShOMV+hh93GJFNfg0gf/uABzUo87Jky/eARlqjaXZf7Wzff StCIUaDr SiqiSov4/khTGsnVHlj9G8XRD+AurPDCsqqSeAJwzuFgm/q6eczxIARj30xS45RqgRKc+9ueoDdO8zinIJj9GbcPqV4J4v5vhZnnmN2QhLmre5aXxmsVPZV4eqK+xLNMrfjQn4969NL6NyJhrWxTFsgpKFygEz+O09Ce9+l/CViqgzqsif1fvn1VFGj7JvlO4O8fvQ+6ebbUgtosI0hPB35HSh51Bsx09uV3tR3seZ9FyTzIblG4Jq4MTuIOGlKKtioCwV/ViGA//kKEo+JDI2HgTlJHQBVTx750sE4yJPc0Tmpy3jJ6QE4jqzBrVe823n+6sMXGoilfPBSrHFtibHkuwpWKH47Jppf6s 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: Added two explicit MF_MSG messages describing failure in get_hwpoison_page. Attemped to document the definition of various action names, and made a few adjustment to the action_result() calls. Signed-off-by: Jane Chu Reviewed-by: Oscar Salvador Acked-by: Miaohe Lin --- include/linux/mm.h | 2 ++ include/ras/ras_event.h | 2 ++ mm/memory-failure.c | 37 ++++++++++++++++++++++++++++++++----- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 9849dfda44d4..b4598c6a393a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4111,6 +4111,7 @@ enum mf_action_page_type { MF_MSG_DIFFERENT_COMPOUND, MF_MSG_HUGE, MF_MSG_FREE_HUGE, + MF_MSG_GET_HWPOISON, MF_MSG_UNMAP_FAILED, MF_MSG_DIRTY_SWAPCACHE, MF_MSG_CLEAN_SWAPCACHE, @@ -4124,6 +4125,7 @@ enum mf_action_page_type { MF_MSG_BUDDY, MF_MSG_DAX, MF_MSG_UNSPLIT_THP, + MF_MSG_ALREADY_POISONED, MF_MSG_UNKNOWN, }; diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h index c011ea236e9b..b3f6832a94fe 100644 --- a/include/ras/ras_event.h +++ b/include/ras/ras_event.h @@ -360,6 +360,7 @@ TRACE_EVENT(aer_event, EM ( MF_MSG_DIFFERENT_COMPOUND, "different compound page after locking" ) \ EM ( MF_MSG_HUGE, "huge page" ) \ EM ( MF_MSG_FREE_HUGE, "free huge page" ) \ + EM ( MF_MSG_GET_HWPOISON, "get hwpoison page" ) \ EM ( MF_MSG_UNMAP_FAILED, "unmapping failed page" ) \ EM ( MF_MSG_DIRTY_SWAPCACHE, "dirty swapcache page" ) \ EM ( MF_MSG_CLEAN_SWAPCACHE, "clean swapcache page" ) \ @@ -373,6 +374,7 @@ TRACE_EVENT(aer_event, EM ( MF_MSG_BUDDY, "free buddy page" ) \ EM ( MF_MSG_DAX, "dax page" ) \ EM ( MF_MSG_UNSPLIT_THP, "unsplit thp" ) \ + EM ( MF_MSG_ALREADY_POISONED, "already poisoned" ) \ EMe ( MF_MSG_UNKNOWN, "unknown page" ) /* diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 739311e121af..d1fb1d6f6b11 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -879,6 +879,28 @@ static int kill_accessing_process(struct task_struct *p, unsigned long pfn, return ret > 0 ? -EHWPOISON : -EFAULT; } +/* + * MF_IGNORED - The m-f() handler marks the page as PG_hwpoisoned'ed. + * But it could not do more to isolate the page from being accessed again, + * nor does it kill the process. This is extremely rare and one of the + * potential causes is that the page state has been changed due to + * underlying race condition. This is the most severe outcomes. + * + * MF_FAILED - The m-f() handler marks the page as PG_hwpoisoned'ed. + * It should have killed the process, but it can't isolate the page, + * due to conditions such as extra pin, unmap failure, etc. Accessing + * the page again may trigger another MCE and the process will be killed + * by the m-f() handler immediately. + * + * MF_DELAYED - The m-f() handler marks the page as PG_hwpoisoned'ed. + * The page is unmapped, and is removed from the LRU or file mapping. + * An attempt to access the page again will trigger page fault and the + * PF handler will kill the process. + * + * MF_RECOVERED - The m-f() handler marks the page as PG_hwpoisoned'ed. + * The page has been completely isolated, that is, unmapped, taken out of + * the buddy system, or hole-punnched out of the file mapping. + */ static const char *action_name[] = { [MF_IGNORED] = "Ignored", [MF_FAILED] = "Failed", @@ -893,6 +915,7 @@ static const char * const action_page_types[] = { [MF_MSG_DIFFERENT_COMPOUND] = "different compound page after locking", [MF_MSG_HUGE] = "huge page", [MF_MSG_FREE_HUGE] = "free huge page", + [MF_MSG_GET_HWPOISON] = "get hwpoison page", [MF_MSG_UNMAP_FAILED] = "unmapping failed page", [MF_MSG_DIRTY_SWAPCACHE] = "dirty swapcache page", [MF_MSG_CLEAN_SWAPCACHE] = "clean swapcache page", @@ -906,6 +929,7 @@ static const char * const action_page_types[] = { [MF_MSG_BUDDY] = "free buddy page", [MF_MSG_DAX] = "dax page", [MF_MSG_UNSPLIT_THP] = "unsplit thp", + [MF_MSG_ALREADY_POISONED] = "already poisoned", [MF_MSG_UNKNOWN] = "unknown page", }; @@ -1013,12 +1037,13 @@ static int me_kernel(struct page_state *ps, struct page *p) /* * Page in unknown state. Do nothing. + * This is a catch-all in case we fail to make sense of the page state. */ static int me_unknown(struct page_state *ps, struct page *p) { pr_err("%#lx: Unknown page state\n", page_to_pfn(p)); unlock_page(p); - return MF_FAILED; + return MF_IGNORED; } /* @@ -2055,6 +2080,7 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb if (flags & MF_ACTION_REQUIRED) { folio = page_folio(p); res = kill_accessing_process(current, folio_pfn(folio), flags); + action_result(pfn, MF_MSG_ALREADY_POISONED, MF_FAILED); } return res; } else if (res == -EBUSY) { @@ -2062,7 +2088,7 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb flags |= MF_NO_RETRY; goto retry; } - return action_result(pfn, MF_MSG_UNKNOWN, MF_IGNORED); + return action_result(pfn, MF_MSG_GET_HWPOISON, MF_IGNORED); } folio = page_folio(p); @@ -2097,7 +2123,7 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb if (!hwpoison_user_mappings(folio, p, pfn, flags)) { folio_unlock(folio); - return action_result(pfn, MF_MSG_UNMAP_FAILED, MF_IGNORED); + return action_result(pfn, MF_MSG_UNMAP_FAILED, MF_FAILED); } return identify_page_state(pfn, p, page_flags); @@ -2231,6 +2257,7 @@ int memory_failure(unsigned long pfn, int flags) res = kill_accessing_process(current, pfn, flags); if (flags & MF_COUNT_INCREASED) put_page(p); + action_result(pfn, MF_MSG_ALREADY_POISONED, MF_FAILED); goto unlock_mutex; } @@ -2267,7 +2294,7 @@ int memory_failure(unsigned long pfn, int flags) } goto unlock_mutex; } else if (res < 0) { - res = action_result(pfn, MF_MSG_UNKNOWN, MF_IGNORED); + res = action_result(pfn, MF_MSG_GET_HWPOISON, MF_IGNORED); goto unlock_mutex; } } @@ -2363,7 +2390,7 @@ int memory_failure(unsigned long pfn, int flags) * Abort on fail: __filemap_remove_folio() assumes unmapped page. */ if (!hwpoison_user_mappings(folio, p, pfn, flags)) { - res = action_result(pfn, MF_MSG_UNMAP_FAILED, MF_IGNORED); + res = action_result(pfn, MF_MSG_UNMAP_FAILED, MF_FAILED); goto unlock_page; } From patchwork Fri May 24 21:53:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jane Chu X-Patchwork-Id: 13673759 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 C40F8C25B74 for ; Fri, 24 May 2024 21:53:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 455AA6B0093; Fri, 24 May 2024 17:53:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 403366B0095; Fri, 24 May 2024 17:53:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27CA66B0096; Fri, 24 May 2024 17:53:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 087456B0093 for ; Fri, 24 May 2024 17:53:55 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C4BFB1C109C for ; Fri, 24 May 2024 21:53:54 +0000 (UTC) X-FDA: 82154642388.01.4A4A396 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf28.hostedemail.com (Postfix) with ESMTP id CC012C000E for ; Fri, 24 May 2024 21:53:52 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=KW8Qwaw9; spf=pass (imf28.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.165.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=1716587633; 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=SihancN5k8LC/Hgj/5KOjJmpYjhXQMOG14zedpZ75B8=; b=SOQe54ZyUpyBbj69rytLZTFVWu2l//JrZTqh9/0kLP0RXjDIqmuSLB9htRJ6sIoxw6EuV9 TEb8zMFHfzlceb/UImgUQPvyhpdHMnt/PvW07LZy2Z0Vsdop86TwyWBkrnfHlFlbl+WwxG bOXW2zAoH/548Nx3G7bTnkxkXzh+rbs= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=KW8Qwaw9; spf=pass (imf28.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.165.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=1716587633; a=rsa-sha256; cv=none; b=CnlNKP2EqJd8DRFubRJhw4g4Ee4QEGmmP4xMwtItShJ3dZT58UZOkhc12p2p76DIa+TeG0 Au6W1roMB0Tt4KUudevUEI7TftAK+oKV0aezCoszf6xFVhn17XfmbkSgyfwI++WYZAZapg mmE8p3eQhbQiNv3MYzQ5hwjGR9KJWNY= Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44OKTbZh023819; Fri, 24 May 2024 21:53:48 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=SihancN5k8LC/Hgj/5KOjJmpYjhXQMOG14zedpZ75B8=; b=KW8Qwaw9MgRTg2x6HgWx4L/6ultVBxcZu1IHaepybohYvCDch5isMwzqEapu2CteSb41 KWsxMyoAa4IVCIzA3xHEdbiU/p+B0JNiK28ssP9KL1at9eBlEDlu9VQvIIPEV71Fe9tl paGzZjvKEZdH3GGMsFwvJI92QFHNMWlBqWjF+krfNuSlKwU/K20kV/2/DaWde3jORtEO tgndbaquKNWUHvyVk4U0GJOw9aDiQFSK6IoxCMC10njzgNpoESMeyt7brQPHCjwIorpk ndpalrOF/jweatfkpifBeTuvSXR0REwwlGLeLTp2455ym1GMtO9lc9Rf0X8ORikqiLFO Bw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6m7bcxts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 24 May 2024 21:53:48 +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 44OLjG1O035956; Fri, 24 May 2024 21:53:47 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-5; Fri, 24 May 2024 21:53:47 +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 4/5] mm/memory-failure: move hwpoison_filter() higher up Date: Fri, 24 May 2024 15:53:05 -0600 Message-Id: <20240524215306.2705454-5-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> 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.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-2405240158 X-Proofpoint-ORIG-GUID: OTsiOAKLEUfSAJALl24pXDTKjX6cQFx5 X-Proofpoint-GUID: OTsiOAKLEUfSAJALl24pXDTKjX6cQFx5 X-Stat-Signature: 7e5uat7yk9a7etodrezqd7sy5cdhgzxy X-Rspamd-Queue-Id: CC012C000E X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1716587632-32541 X-HE-Meta: U2FsdGVkX187GE8DYrTDqKU7A8vLZooosTaG1pEMmE8qLK5IrdGmvSXLPP3VoiFCs75auumbTxlDkxAhmaL2pEZGxDFMaZ2yhjg34Hg4zb6nyrYvsoJzuP+AplnFeDY8Ft5EvZ++ZSI7k8y+00Wsfw19jZL3wDVmqZ1xsToD02vI3IF44pEwKu8GikrunmX3xqTN1zgq4A5RmtpPptXSStkHzDeqffXZSQRN4FPWxfpiUzXOWwQEV1FQGkiNlN55j44d4N+ZOKujDYch4IRXYFRtz7TXMKHGZEEdSsrsxdQpQBt1qaItMZDJz0X/UFrjCt96SHjsfAqelcfwPdG5toy48Z8Ea6GvtUQTSEKgUzcOREZwwMsFfxgOrhnLuolApIM0o0A7bjInIuE1+AxDZBka/IgQ4+NZo1ObUwhnF5wT/5386HdfuUU+g03vLCVh8CMIkan4mWZrutS8SrZqpdkJUsEpTlQyD4tMZOpPHRrKbBqsxgCuaxJahUzhMzkqo2gjhepb4kh+WdOxMRmxaY6n5R8P9BAcxNy6DBC4pG6s8paLWE1sAgQOlrTf662SgEmMK60UyZm9ONqNL3C4o+/FpoAGL6bBZHx1pn9g0WTJU8xx/VzO5+762FEtxTR578DpUvPs+97KsrSwlFL2hrinOuJt8dhwkmjTQQ4656DWqYjTxOVClor4b28ReQ/TW6naFtcM+Yrdv4qw+OD0xE2bRhJ1yPNxySAUa7+Y/BbK0CZtm659cIzQ4xwcpFNdRbqZ6yYVRhgTCdw/omFFU9VZQjG3PO7uJtONSBWVIReWorGXpkfPaxVA/YGp+Xi1anOTZs9Hpj8WeolLdLAL/7kbrrS+2hkN20dIw2lSnRqFEPOS0BgTCs0u4AU5+lRnDMP738ikeffm4AbevA5UY5COgOSfvUWmA/fO0jYWIKMzVN00P2h60EQkVLKLvHvhWY3MRojo3WP7TgngJbT DQXfponH raQmJ6AsUXW7+b8Uh95KfA2Trfcrf7XSSSJ+uvLLGeLZW8v6AkKXiaPeKXD1DxkmxbmszoJz8HyS4x5AhGY9U5hODUv3n3kcWeceYvffaUAYqb6NprGKFoHJIYv0Wgl4ylCyWMnPmEkDyCmAju58Wl9K/bHHhaITaUIOpQqWY8SODPb5AphxHIZJWMA+nlfZDjiohLyybFI2f5eqtRBBfYjssoPMJDkd+2hYVCcFNhx7757q0a/f+iE1GCZvUbwn0w+sWTcAPvtLxxbeWK4yPhekzHO4sSMXVEdcuXdwEIU2Hzs25c53D7YeQzC1lJs29KJ8ya8EWgK82MilTVxiLMMzwbYWaPEQ/Lw9/ 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: Move hwpoison_filter() higher up as there is no need to spend a lot cycles only to find out later that the page is supposed to be skipped from hwpoison handling. Signed-off-by: Jane Chu Reviewed-by: Oscar Salvador Acked-by: Miaohe Lin --- mm/memory-failure.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index d1fb1d6f6b11..85659dd0ea32 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2300,6 +2300,18 @@ int memory_failure(unsigned long pfn, int flags) } folio = page_folio(p); + + /* filter pages that are protected from hwpoison test by users */ + folio_lock(folio); + if (hwpoison_filter(p)) { + ClearPageHWPoison(p); + folio_unlock(folio); + folio_put(folio); + res = -EOPNOTSUPP; + goto unlock_mutex; + } + folio_unlock(folio); + if (folio_test_large(folio)) { /* * The flag must be set after the refcount is bumped @@ -2363,14 +2375,6 @@ int memory_failure(unsigned long pfn, int flags) */ page_flags = folio->flags; - if (hwpoison_filter(p)) { - ClearPageHWPoison(p); - folio_unlock(folio); - folio_put(folio); - res = -EOPNOTSUPP; - goto unlock_mutex; - } - /* * __munlock_folio() may clear a writeback folio's LRU flag without * the folio lock. We need to wait for writeback completion for this From patchwork Fri May 24 21:53:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jane Chu X-Patchwork-Id: 13673864 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 486ABC25B74 for ; Sat, 25 May 2024 00:35:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89B046B0088; Fri, 24 May 2024 20:35:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 824456B0089; Fri, 24 May 2024 20:35:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C4876B008A; Fri, 24 May 2024 20:35:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 478F06B0088 for ; Fri, 24 May 2024 20:35:44 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EA3D7A1FBC for ; Sat, 25 May 2024 00:35:43 +0000 (UTC) X-FDA: 82155050166.14.13BBAE1 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf17.hostedemail.com (Postfix) with ESMTP id C3DCE40002 for ; Sat, 25 May 2024 00:35:41 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=lYxXVGvI; spf=pass (imf17.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.165.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=1716597342; 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=NItRoZidtl5jZFk2E3c9bRVzuOiNACCqAvB+zCVBjYM=; b=vCGxEO4G0364ZwHdOAxOauHzXrnZVzl+3Smjglr+dgAdiaR7U54SLtUcSI9+LD6EIl2XmC HAXQiwY5IYfIab1cPtX0oDPQ7GXjXf56CUKn5QYwVwBUwLtapQ+hgMh+Iq6d5us+svOXiH mOrIr8Hh+q6sv0BmZoCO3tnHkfQLX30= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716597342; a=rsa-sha256; cv=none; b=rJfbj446MyzUR2R2fDLMtiXT170ZDlyFoByePYZ4627FD0jyYIFVskir+S4jR3twPmrDQl q7X7SCRzPWkJMkhlYFkifOd1md02JhOKO4DOMmL3+G5yh6bvW+eHardyUOaKzSZChyINc7 qPC/sq4sryMhOYJOHlsx5FmxThSlsOE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=lYxXVGvI; spf=pass (imf17.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com; dmarc=pass (policy=quarantine) header.from=oracle.com Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44OHcEG8021717; Fri, 24 May 2024 21:53:51 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=NItRoZidtl5jZFk2E3c9bRVzuOiNACCqAvB+zCVBjYM=; b=lYxXVGvInCRrVClVw+SA1gLS/PoZSLuThuPH2VElXUrdvyUuoUBAjy9MpgU6YzWceXem BZbTLq1JzVtnDMGh6Uh7mTdNen0dxTm8UUbCdQJAYXIaP3yd5zN6XyZ+ngfrMoAE6WOF KWRl1cKdzdZAihheh+6KJSVT5CTtnwNWg1tLBaZTXw69Fqqiozft4SWpyJH+rER00ZSb 2b9tOmhozHoN9sEHi6gCCWEfVPjFto+TkY4Ja4x2K5laurVTgs0/19bHk5bVjOmupBSQ RjuNJwWEn6CJlXSSQVTmrC4tHvyaMbK1bKokqG6Aya5gJJNurZAMxygDOTuEvYQVTePE yA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6k8ddd0n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 24 May 2024 21:53:50 +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 44OLjG1Q035956; Fri, 24 May 2024 21:53:50 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-6; Fri, 24 May 2024 21:53:49 +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 5/5] mm/memory-failure: send SIGBUS in the event of thp split fail Date: Fri, 24 May 2024 15:53:06 -0600 Message-Id: <20240524215306.2705454-6-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> 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.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-2405240158 X-Proofpoint-GUID: hPXbkI42xBQJuar7JkbK3Zr9qXE31038 X-Proofpoint-ORIG-GUID: hPXbkI42xBQJuar7JkbK3Zr9qXE31038 X-Rspam-User: X-Stat-Signature: m9nb9ki6a4jxdfx3mr9dt5goiytx7dur X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C3DCE40002 X-HE-Tag: 1716597341-601201 X-HE-Meta: U2FsdGVkX19inrOnZbQ3e4zfw0oavmeLvgD+Vfcp3F3FqXVGDovAOLTo7li0D5gh+Dmsno7DXXPLWwYxVbgKPWzEG45iuLqaVoYf6xLAjHHRpoemAl3EEL1hHzx9RcBBvFT6AVSS9ihANgAbkiqAK8toPJr6dc3ow5EbxFpfBYbKin5I92iTCH8FPZyapK1uHgjk0sh3jGgf6bYME+yY3WHK63gOHdmdQ/V476ik99v9X2EpV6aJPrBDgls7J9BI19yfKzgzpHRztY+RkvAt9SppmSQX8iRfrksJ79aho51IESJotgKNwCoKVbz6L9lFNVlAzPzGe29B6JqV9ghUsGLw1Rsf5jcJSAkIc2+tmH9uKoQBJGJ+UKcQ3Vkscd3E099FnRdD8MRRZJW4+fFwdYj/3gFve2kNW+CiGUDxYYYVECC3Qx/81onVclIZbSSrYX96VliwY8Mgz/+HOnJLjRVXtzAqeLt4PXng5l26/scxcutSYecwVVdko8aDgvU9n73JSLhAOaHu6yYwDPE/1kblNy/ilfsuhrs60QVXMmd60CcqrAjQg/NXgPnQRlQge+70u06UQoO5LCvWAhJkoL/vZSA2aeQUjNIoHAwDLIs8WzHUQuvd9LaVmeql9UVgv/ccZ4rHCNd3M4lnxb3xTsGtt5dGN4hk36VpMGs+MDle5NexWKOnPBw3hsUp28kOmErLmx4xts7vSukKoXLWsHX1Y1hFe1ySMbkB9kESdNpTBumAwtDFWItxhBZF5nT1TbCSWbAFTHOhu99ElJ9mfBLr6LedeEuqOa4tqK4tkmtujATujLFUexhB3s3Os87sfY90JCcCF0u3D93fBC0Zm5qO0d838fITrEbnRY0xMv3818TM1fbfkyLDlyTZ7SLeK94bBxKpNQTV777wdwt9ENC8e9QtO2Dpsdt7MM4uXEVjK3M97bM88525aItH1gQmJXCObq6BKMIwbFl8pcG WS3NvUIK PaXHCmXUTJeCa/t124iYHQZXK74p9Npekj5NZnPuBdno2a9sM5m3JUtLQTub+rMre5GT4z7K50yLGN4hWnU7mPuSgS1XwGTtQ7zi5lu8V3pPZGpe95YxXBt8mHYKnWqrWVxWKG66CuqSfRuJ3ftxsvJ2XlKaPNQzwuSLi6JOSmx2S+idZDYnSyByZA+6Av4pFvLi1Ua/n1dUBQ02pdAKu6q0tf9Fio4Iw+h+vJItGr9AuNCQZlXEET34DXWX59R91fkXVJAYk7sc4zeYf/+cNzHqFjlg4ciZ89rydDao37YrUo0OnAobgt8rGVVTSpmfgbKju82BLrKI6c5DXZLSeoB4ULzsIUPsT73g/CdNI2dObcKXU2XsC9U4oUTkfM8EdGlBB4n/+bE50/1MQjMfyoOAeyQ== 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: While handling hwpoison in a THP page, it is possible that try_to_split_thp_page() fails. For example, when the THP page has been RDMA pinned. At this point, the kernel cannot isolate the poisoned THP page, all it could do is to send a SIGBUS to the user process with meaningful payload to give user-level recovery a chance. Signed-off-by: Jane Chu Reviewed-by: Oscar Salvador Acked-by: Miaohe Lin --- mm/memory-failure.c | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 85659dd0ea32..dcca7297a94c 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1706,7 +1706,12 @@ static int identify_page_state(unsigned long pfn, struct page *p, return page_action(ps, p, pfn); } -static int try_to_split_thp_page(struct page *page) +/* + * When 'release' is 'false', it means that if thp split has failed, + * there is still more to do, hence the page refcount we took earlier + * is still needed. + */ +static int try_to_split_thp_page(struct page *page, bool release) { int ret; @@ -1714,7 +1719,7 @@ static int try_to_split_thp_page(struct page *page) ret = split_huge_page(page); unlock_page(page); - if (unlikely(ret)) + if (ret && release) put_page(page); return ret; @@ -2186,6 +2191,22 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, return rc; } +/* + * The calling condition is as such: thp split failed, page might have + * been RDMA pinned, not much can be done for recovery. + * But a SIGBUS should be delivered with vaddr provided so that the user + * application has a chance to recover. Also, application processes' + * election for MCE early killed will be honored. + */ +static void kill_procs_now(struct page *p, unsigned long pfn, int flags, + struct folio *folio) +{ + LIST_HEAD(tokill); + + collect_procs(folio, p, &tokill, flags & MF_ACTION_REQUIRED); + kill_procs(&tokill, true, pfn, flags); +} + /** * memory_failure - Handle memory failure of a page. * @pfn: Page Number of the corrupted page @@ -2327,8 +2348,11 @@ int memory_failure(unsigned long pfn, int flags) * page is a valid handlable page. */ folio_set_has_hwpoisoned(folio); - if (try_to_split_thp_page(p) < 0) { - res = action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED); + if (try_to_split_thp_page(p, false) < 0) { + res = -EHWPOISON; + kill_procs_now(p, pfn, flags, folio); + put_page(p); + action_result(pfn, MF_MSG_UNSPLIT_THP, MF_FAILED); goto unlock_mutex; } VM_BUG_ON_PAGE(!page_count(p), p); @@ -2702,7 +2726,7 @@ static int soft_offline_in_use_page(struct page *page) }; if (!huge && folio_test_large(folio)) { - if (try_to_split_thp_page(page)) { + if (try_to_split_thp_page(page, true)) { pr_info("soft offline: %#lx: thp split failed\n", pfn); return -EBUSY; }