From mboxrd@z Thu Jan 1 00:00:00 1970 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 31AD9C35274 for ; Tue, 19 Dec 2023 02:17:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A5B706B007E; Mon, 18 Dec 2023 21:17:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E31B6B0081; Mon, 18 Dec 2023 21:17:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8835C6B0083; Mon, 18 Dec 2023 21:17:37 -0500 (EST) 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 732E56B007E for ; Mon, 18 Dec 2023 21:17:37 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 431EF12037F for ; Tue, 19 Dec 2023 02:17:37 +0000 (UTC) X-FDA: 81581956554.17.417D7F9 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) by imf12.hostedemail.com (Postfix) with ESMTP id 7C6FE40008 for ; Tue, 19 Dec 2023 02:17:35 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=UME3Rd6j; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf12.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 91.218.175.179 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702952255; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=N4TtHcq2TsQinuDWqHZmTllB2P81yCAywzsZcw90ozs=; b=yjJL/UovIybumQhYz6VxPWI+LZlcolNi145rum7P2D+dbsDDOrIItY5eUq5oBFSpziTCgn P2pESexIwZBBwW/HYNYBT4P1TapREykkovl8JDvWrsBk6PBTQIFfKH/1iCARRiDIsmUUtQ cllnc2AUwt5Y9A5GifzWsR6WRNhD8qI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=UME3Rd6j; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf12.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 91.218.175.179 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702952255; a=rsa-sha256; cv=none; b=GpaUHpYytoPrQO8KVCt1R+/ptn6360h4KvD02H6dLcyU0ZOm6xyiIE57rk5Fnriqn/9rG3 oCmNcQPZnoO5OXCJ7J/psHIaVSIxqDX+Fl1Nf/pHZd+4XFJyHYA/qHywWF5LJdFK0ffErn zkVJ8nooVIzHQKK4NH5GDsTHGw82tcE= Date: Tue, 19 Dec 2023 11:17:23 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702952253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N4TtHcq2TsQinuDWqHZmTllB2P81yCAywzsZcw90ozs=; b=UME3Rd6jOx+6ABruQyvRk7rn9I34Rg6jpkAmKCkH52EWEfumChHEUEMTwavXXBQGnN7lKR fJsJiQO4iRHn0KGJ5iphl/993ZCsLO/yiAyO+FGwKdvlS2kM19/WcU1FmhmQMYdlU9PY7k SXiPI0G9/C3imBGdnEj2Ugf7Yxh1G1M= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Naoya Horiguchi To: Qiuxu Zhuo Cc: naoya.horiguchi@nec.com, linmiaohe@huawei.com, akpm@linux-foundation.org, tony.luck@intel.com, ying.huang@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] mm: memory-failure: Re-split hw-poisoned huge page on -EAGAIN Message-ID: <20231219021723.GA158136@ik1-406-35019.vs.sakura.ne.jp> References: <20231215081204.8802-1-qiuxu.zhuo@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231215081204.8802-1-qiuxu.zhuo@intel.com> X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 7C6FE40008 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: x81gz4akxkrp9q46j41obqfnx5o8fqcu X-HE-Tag: 1702952255-938727 X-HE-Meta: U2FsdGVkX1/za8FeyJuP1etkr7Q1ev9jzXpU/JZmeyEPkVZOVMASRfIk1pd8GvG086OuonrwIJVZq07K/4nHk8DyGMe+RJM2l8lwPbVnH8Gf4KP+O734kppcR4gL8I0DHLA0vG+eOc4sDFpIMBRABMiDUVSyIYJ6gIHqPcaFglCnmHW/21ovMGcmjYLrX4FJQ8BXzC6loQspZ7xAgzaxVuy7FWyEAlAwp7ENKq3myPs1CREfPMqpSaOdb/NtJzWAITYtdTxK7T0S5nKtsib6i4FgV4gcan20ie+NHqwk+0ME+KUW1WjZx6Aunch/5SSRzTEspYVfu2EGdWJX4v8A1DMJIyV28YOvvMV9eSYhxI7PJiEXf2VhRZwklEaX6jwUikhhNQweti/w6WkQA883OQlBXgA/Aie4cWbIIMaq7rCL7dDK6xjrfuPY67GBVz0qX0xYhrGMt9ab9v1tynG8aqsqhov7HWy2eaDR7Pe+hkQ/Bz/Gizfbwfiq7vgbygQlg4cAlMXAAmS2/XfpZoY6orr6tinjEerMpgXRPFvW6jvlMxCF1MjdXWjSgfxptiqm+ITRwQB8lyxLnAiuzkKyqoPL8HV34hG/XCOLEM+K9dSh9HinXJaceUg91gGOTKLgG4nBZfWkIKTd5pQxzKCwxsMwKGO7ABAhfkpeUFePfMFkAnr7Uqp7CpSjGT1/8b1zJey2Zrid3fNvu/rYr/pklVDZ7H0ySEIbnDiKpto94y/w5Hb3FqlRIxiqfqH4FWOoMbD2f8hoLEs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.002619, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Dec 15, 2023 at 04:12:04PM +0800, Qiuxu Zhuo wrote: > During the process of splitting a hw-poisoned huge page, it is possible > for the reference count of the huge page to be increased by the threads > within the affected process, leading to a failure in splitting the > hw-poisoned huge page with an error code of -EAGAIN. > > This issue can be reproduced when doing memory error injection to a > multiple-thread process, and the error occurs within a huge page. > The call path with the returned -EAGAIN during the testing is shown below: > > memory_failure() > try_to_split_thp_page() > split_huge_page() > split_huge_page_to_list() { > ... > Step A: can_split_folio() - Checked that the thp can be split. > Step B: unmap_folio() > Step C: folio_ref_freeze() - Failed and returned -EAGAIN. > ... > } > > The testing logs indicated that some huge pages were split successfully > via the call path above (Step C was successful for these huge pages). > However, some huge pages failed to split due to a failure at Step C, and > it was observed that the reference count of the huge page increased between > Step A and Step C. > > Testing has shown that after receiving -EAGAIN, simply re-splitting the > hw-poisoned huge page within memory_failure() always results in the same > -EAGAIN. This is possible because memory_failure() is executed in the > currently affected process. Before this process exits memory_failure() and > is terminated, its threads could increase the reference count of the > hw-poisoned page. > > To address this issue, employ the kernel worker to re-split the hw-poisoned > huge page. By the time this worker begins re-splitting the hw-poisoned huge > page, the affected process has already been terminated, preventing its > threads from increasing the reference count. Experimental results have > consistently shown that this worker successfully re-splits these > hw-poisoned huge pages on its first attempt. > > The kernel log (before): > [ 1116.862895] Memory failure: 0x4097fa7: recovery action for unsplit thp: Ignored > > The kernel log (after): > [ 793.573536] Memory failure: 0x2100dda: recovery action for unsplit thp: Delayed > [ 793.574666] Memory failure: 0x2100dda: split unsplit thp successfully. I'm unclear about the user-visible benefit of ensuring that the error thp is split. So could you explain about it? I think that the raw error page is not unmapped (with hwpoisoned entry) after delayed re-splitting, so recovery action seems not complete even with this patch. So this patch seems to just convert a hwpoisoned unrecovered thp into a hwpoisoned unrecovered raw page. Thanks, Naoya Horiguchi