From nobody Fri Jun 12 19:46:25 2026 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (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 A406B3603C3 for ; Wed, 13 May 2026 02:49:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778640547; cv=none; b=doFdwJ5bjSLDEvl5KFgN3u/Kq76ArkNbTAIglL61MD9FKORiiS6/MPBh3z51FO1MybMLOuZl0u3Gsd8y292Wpp5qTghjkaTwRznCe562DxksP4r6jHg3OHW/4uvs/1EEeHDTeb05K7ezpnDSDuri95vS4+FqPsAUwtq07AyNVwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778640547; c=relaxed/simple; bh=vxAMKOCNJuDC8AC1RH2OSCg4qpYFPmYiqxhJtSswCMs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SCOlIoEbe3FvWWrK99oXLb+Y25QGNFSgaFWiQ9oo3VeU+BJtmiGG9jPEC9/vA8aLBt3CoecLeiUIFowOQfx+KstnLFi22ORyuZx9vmvDEtPq9L9PBMBioX1jr7ydBxzP5OtxFNSXa/uwfV3F15hAxuPNnNhiexiesMTQO1BX2jM= 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=aN51modi; arc=none smtp.client-ip=91.218.175.173 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="aN51modi" 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=1778640542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ac+/09xni07WMR4KrujX3u+mPbI/ECBXE+1EPYxqsnM=; b=aN51modiINYEaGl+Id/b9+bp1r9lQEMHBEwSjWK1N6qX3ZxKpcg16PMRjDc2wcrvctw3Xj T3xfOBN5yGMOsc8CnOzfn8rXK8AUm6V+/KtmymliF+SpEBspSqMX3sAYVWS5/WrEg6uoGg L9Nqk/diP3bun0h8H4NPHMB7ymKRSy8= From: Ye Liu To: Miaohe Lin , Andrew Morton Cc: Ye Liu , Naoya Horiguchi , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] mm/memory_failure: use bool for hugetlb indicator in try_memory_failure_hugetlb Date: Wed, 13 May 2026 10:48:52 +0800 Message-ID: <20260513024853.65566-1-ye.liu@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Ye Liu The hugetlb indicator in try_memory_failure_hugetlb is a Boolean flag, but was declared and assigned as int/0/1. Convert to `bool` and `true`/`false` for clarity and type safety. - try_memory_failure_hugetlb(unsigned long pfn, int flags, bool *hugetlb) - testcase path in memory_failure(): bool hugetlb =3D false - clear semantic conversion in MF_HUGETLB_NON_HUGEPAGE - preserve behavior (no functional change) Signed-off-by: Ye Liu Acked-by: Miaohe Lin --- mm/memory-failure.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 866c4428ac7e..f164fc5959f0 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2032,7 +2032,7 @@ int __get_huge_page_for_hwpoison(unsigned long pfn, i= nt flags, * -EHWPOISON - folio or exact page already poisoned * -EFAULT - kill_accessing_process finds current->mm null */ -static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *h= ugetlb) +static int try_memory_failure_hugetlb(unsigned long pfn, int flags, bool *= hugetlb) { int res, rv; struct page *p =3D pfn_to_page(pfn); @@ -2040,12 +2040,12 @@ static int try_memory_failure_hugetlb(unsigned long= pfn, int flags, int *hugetlb unsigned long page_flags; bool migratable_cleared =3D false; =20 - *hugetlb =3D 1; + *hugetlb =3D true; retry: res =3D get_huge_page_for_hwpoison(pfn, flags, &migratable_cleared); switch (res) { case MF_HUGETLB_NON_HUGEPAGE: /* fallback to normal page handling */ - *hugetlb =3D 0; + *hugetlb =3D false; return 0; case MF_HUGETLB_RETRY: if (!(flags & MF_NO_RETRY)) { @@ -2107,7 +2107,7 @@ static int try_memory_failure_hugetlb(unsigned long p= fn, int flags, int *hugetlb } =20 #else -static inline int try_memory_failure_hugetlb(unsigned long pfn, int flags,= int *hugetlb) +static inline int try_memory_failure_hugetlb(unsigned long pfn, int flags,= bool *hugetlb) { return 0; } @@ -2347,7 +2347,7 @@ int memory_failure(unsigned long pfn, int flags) int res =3D 0; unsigned long page_flags; bool retry =3D true; - int hugetlb =3D 0; + bool hugetlb =3D false; =20 if (!sysctl_memory_failure_recovery) panic("Memory failure on page %lx", pfn); --=20 2.43.0