From nobody Mon Feb 9 04:03:52 2026 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E7681E2606 for ; Mon, 12 Jan 2026 00:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768178970; cv=none; b=PvGn6VkxW9PA2lywoIh8Qjp0fOmENLiUDGwH9PwENawyP2eCS3Hjro0ScLY2ZkXMiDs+niOXSA9tJTgo6UbHnxCK/1CW2Iet7lwgNvLAJNfd3tKq35eCzrYFI9XXsWI6PoytrUalee/XX9RmUh3zOK+PteRMp7C03wRbRA1PO9Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768178970; c=relaxed/simple; bh=Q+sritPehEeS6wAIA6c4wtQmtWYoZZ9O37BCaRGN1P8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=GToBs5dTwygbmoTazo7vxTTVCUqNjfCuAm7g+Vpd2+YnSPsBKiZNld8FCVF/2WRx6u+GxBaVk2Gb0H3cbG73lTKMpEuozUdN2CuYd17ZIDF4njSzJB2NBkoJ/BD2ShQ99KnSrPphfiuehmlx1MNtbMhIeY8ToAFFBp8td9uAl0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jiaqiyan.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=i5oHGA96; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jiaqiyan.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="i5oHGA96" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-34ea5074935so5788171a91.0 for ; Sun, 11 Jan 2026 16:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768178969; x=1768783769; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=gjAce3C3Y1QIKd40PiLPufwi5ToI+2zeU/k8z/0R9VU=; b=i5oHGA96WVwlGnYZWoa58/zaQebDelHS5yXemcxXZtbLKf4WuvcJxxWSfoySzBvFpe UpdOFrtoqXQxiORO4XnIK0RzMIR0xYSN9yQRskTfie9vatpZyfxl2VkXtdj5ybStPVXr C9QiQE/CJUOytQM5VHUugIL/ACVScirldXFi0HEOhTLWY02YsFIcCEQEK6K9JRirhySc Zm/VPA2F/jt6ZsjZ0gLGKWujpHrYM4ulZ8kyQ81Bu3ikB+Nb/SaMSNn1FR3pPHYrVHaR DB8WJCAFR2/3a9EU5xrJ188YR3iEn6tLR5qZlg+2ZQo+pjHZF/KQQr8Nh7/38vx51kHU TFXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768178969; x=1768783769; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gjAce3C3Y1QIKd40PiLPufwi5ToI+2zeU/k8z/0R9VU=; b=JDxId/V+lxvFocGbppU2hmMXzdV8HTsRGABFJSqqQ+v1t6zx2nfB/ZBLIWUfc2RwTB /r5REIIiOK3RW5FRl/Vt9S5uJGi/k/l4V6NAJUMG5Wmr8Qs9uVnUrQHTRJeRHEQP65w6 HU1tuHqYN0KRwnLB3JjsoRNea9Nw2I21NBCEjKGYUJEvycjYvsLAZi6/NEX+flt4aod8 hAlbeFyGPBi1xryR15/eFa/pQVCV9O2JdhkyyPYNwowkdKSCElugLecTs6jSPpE6MTdZ oQH5x6b+PT50KYdJqkdn9kJr59IyI/QLo4le6SsHX+GyUPx5hSlerYcJuaR24a59oCR8 qyaA== X-Forwarded-Encrypted: i=1; AJvYcCU4TUoo3O2Cu4VYTcGEtQSPL7Vl1yiIMSAPSXIc7Sd83Bg1DjT1jrXn7GJvyGG0JVKfC6oUsH3X7RJAA0c=@vger.kernel.org X-Gm-Message-State: AOJu0YzoDT3+V2ESVRBWnJhScIoOLWk85Pz9Ro1HKJS+g0JHFACi4Uvx CyNu1e6y8UudVRjXHE//2pksjVMDjBOaqbiLhGZhFX8ZNvqAH+u3SE/ux9btTZ+kYhpYFAGzzW3 6wUHTQtSWhOBBcw== X-Google-Smtp-Source: AGHT+IGRsYmD0Owt99yy0ghEM70oDPPy8Wm8X//vCefVX5nk+u6cdO2UbDFZj27GMxMpcJ/JK+UWe9vqv3woFg== X-Received: from pjbgk1.prod.google.com ([2002:a17:90b:1181:b0:327:50fa:eff9]) (user=jiaqiyan job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2642:b0:340:d578:f2a2 with SMTP id 98e67ed59e1d1-34f68c335e4mr15145403a91.6.1768178968964; Sun, 11 Jan 2026 16:49:28 -0800 (PST) Date: Mon, 12 Jan 2026 00:49:21 +0000 In-Reply-To: <20260112004923.888429-1-jiaqiyan@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260112004923.888429-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260112004923.888429-2-jiaqiyan@google.com> Subject: [PATCH v3 1/3] mm/memory-failure: set has_hwpoisoned flags on HugeTLB folio From: Jiaqi Yan To: jackmanb@google.com, hannes@cmpxchg.org, linmiaohe@huawei.com, ziy@nvidia.com, harry.yoo@oracle.com, willy@infradead.org Cc: nao.horiguchi@gmail.com, david@redhat.com, lorenzo.stoakes@oracle.com, william.roche@oracle.com, tony.luck@intel.com, wangkefeng.wang@huawei.com, jane.chu@oracle.com, akpm@linux-foundation.org, osalvador@suse.de, muchun.song@linux.dev, rientjes@google.com, duenwen@google.com, jthoughton@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, Jiaqi Yan Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When a free HWPoison HugeTLB folio is dissolved, it becomes non-HugeTLB and is released to buddy allocator as a high-order folio. Set has_hwpoisoned flags on the high-order folio so that buddy allocator can tell that it contains certain HWPoison page(s). This is a prepare change for buddy allocator to handle only the high-order HWPoison folio differently. This cannot be done with hwpoison flag because users cannot tell from the case that the page with hwpoison is hardware corrupted. Signed-off-by: Jiaqi Yan --- include/linux/page-flags.h | 2 +- mm/memory-failure.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index f7a0e4af0c734..d13835e265952 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -904,7 +904,7 @@ static inline int PageTransCompound(const struct page *= page) TESTPAGEFLAG_FALSE(TransCompound, transcompound) #endif =20 -#if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_TRANSPARENT_HUGEPAGE) +#if defined(CONFIG_MEMORY_FAILURE) && (defined(CONFIG_TRANSPARENT_HUGEPAGE= ) || defined(CONFIG_HUGETLB_PAGE)) /* * PageHasHWPoisoned indicates that at least one subpage is hwpoisoned in = the * compound page. diff --git a/mm/memory-failure.c b/mm/memory-failure.c index fbc5a01260c89..d204de6c9792a 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1952,6 +1952,7 @@ void folio_clear_hugetlb_hwpoison(struct folio *folio) if (folio_test_hugetlb_vmemmap_optimized(folio)) return; folio_clear_hwpoison(folio); + folio_set_has_hwpoisoned(folio); folio_free_raw_hwp(folio, true); } =20 --=20 2.52.0.457.g6b5491de43-goog