From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (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 1BB55399039 for ; Mon, 27 Apr 2026 12:33:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777293240; cv=none; b=Tn0FMD+mdHDN3NuITShQiCHbeE+JslVcImhSQYtWGXXoB97b/VaxNvCl2Gfr3D2ILlSIf2BXPgdGbMbJjFRCBPowLPo/HITmaCpfGMsXRDBnNe32wsMO46QNgA4tB+waK3htFPzW4Gh3yuuqvX0ruYQc6XnozBN+yZdJXht/DMk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777293240; c=relaxed/simple; bh=iE6r7hVylhito6gtb2Vir/8ve7gmL/U6+hUPxE9ZWd4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=JM4nybW0ULbxJ/rRBvKhPcSxYND2zt2C4s/qEmDOvnL2mAl2hgfjRVCe9o8w2ZvezaszRxifVedSsMhTqWnlv6S1eI8lrjJgcLih3nJk3ywGHjoig6n7Q5/cKkwy5PGfpqaZwYoMWBCdbukQOBhzZl5PKMpfSN5LstFFaDmLy3Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=q1uWzxPq; arc=none smtp.client-ip=95.215.58.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="q1uWzxPq" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1777293225; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=le6hydx/0AV9ez00tRp6YUb5tjV/ytJlHiXxDmzs5Fw=; b=q1uWzxPqZjeOSed5zBa2SVBta4POQ6DRm/xYANV+EBMy77g8C/H+CzzJafOcG8lynu166S nXOHZ+9j6PscxlvuS3RqwUkBiSg+g6O3acv5kW02iALlOujnhGt7QECEOGiXFVsD8NGbvb vlQyW3Mz0hVavf/L7W6oqgebqmdtJx8= From: Lance Yang To: leitao@debian.org Cc: linmiaohe@huawei.com, nao.horiguchi@gmail.com, akpm@linux-foundation.org, corbet@lwn.net, skhan@linuxfoundation.org, david@kernel.org, ljs@kernel.org, Liam.Howlett@oracle.com, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, shuah@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@meta.com, Lance Yang Subject: Re: [PATCH v5 1/4] mm/memory-failure: report MF_MSG_KERNEL for reserved pages Date: Mon, 27 Apr 2026 20:33:30 +0800 Message-Id: <20260427123330.92847-1-lance.yang@linux.dev> In-Reply-To: <20260424-ecc_panic-v5-1-a35f4b50425c@debian.org> References: <20260424-ecc_panic-v5-1-a35f4b50425c@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On Fri, Apr 24, 2026 at 05:23:59AM -0700, Breno Leitao wrote: >When get_hwpoison_page() returns a negative value, distinguish >reserved pages from other failure cases by reporting MF_MSG_KERNEL >instead of MF_MSG_GET_HWPOISON. Reserved pages belong to the kernel >and should be classified accordingly for proper handling. > >Acked-by: Miaohe Lin >Signed-off-by: Breno Leitao >--- > mm/memory-failure.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/mm/memory-failure.c b/mm/memory-failure.c >index ee42d43613097..7b67e43dafbd1 100644 >--- a/mm/memory-failure.c >+++ b/mm/memory-failure.c >@@ -2432,7 +2432,16 @@ int memory_failure(unsigned long pfn, int flags) > } > goto unlock_mutex; > } else if (res < 0) { >- res = action_result(pfn, MF_MSG_GET_HWPOISON, MF_IGNORED); >+ /* >+ * PageReserved is stable here: reserved pages have >+ * PG_reserved set at boot or by drivers and are never >+ * freed through the page allocator. >+ */ Not necessarily. PG_reserved is not a permanent lifetime property for every page that has carried it. page-flags.h says early reserved pages may later have PG_reserved cleared and then be given to the page allocator :) At least some drivers also clear PG_reserved when releasing pages they marked reserved. Would it be clearer to say that pages with PG_reserved set are not currently managed by the page allocator, rather than saying reserved pages are never freed through the page allocator? Otherwise, LGTM. Reviewed-by: Lance Yang