From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 A01E43BADA3 for ; Tue, 2 Jun 2026 22:24:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780439083; cv=none; b=WEaS+j1JV1meJneJ2JOPytJ3s4AyE5+vEGiUkQoBWCsGWlVOuWfLGEn+DqtYv9XLugeGQHDlbQvu6Knlbyip/ZtItBx/UXiaBXwgtUEBAmjuuaFx9fa0+rFDH8Dc8kxLOMQrUx9NqX8y4Dj/yRZMamRampMBZMpA69+nskJb27A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780439083; c=relaxed/simple; bh=7NP9lzXigwEINvpi9lOaoERauReRMwCQFO1K3R7CFw0=; h=Date:To:From:Subject:Message-Id; b=jrCMwvsElytDs1jojj/35MeE3noPUtE2pVgU+OphFoUvibmNFjd+4KUt44KhJgoHySNKKjsbnpjzj5jXMj6M3D3H7gQFrvjB6HuENeWQrSpWJdxchMnJ8/K/dkgs/uJwGaOTDrJx2qMkrufJMKw8hCQfcvnqDgiawr7LgSEtG7Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=HqWXT39y; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="HqWXT39y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 777901F00893; Tue, 2 Jun 2026 22:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1780439082; bh=9aotlEqWknYDhkXCL5BxT9w1J+Y4IQkE1C2Wu6buHAk=; h=Date:To:From:Subject; b=HqWXT39yl5drlTgAQxbi17mDxfZ4aEy0ICt80x1dacGM0UKl1C+ZfzBdNkdWWrh77 5oi4DOKwcespiReQrJggm+Pmk/ttnSxFSpHmfHsskgkPkXtjbjbeasvahBsZceO96m 53IjdpUIeUNx3Ycca/ayhHOLaetTbO9QZ2Lepllo= Date: Tue, 02 Jun 2026 15:24:42 -0700 To: mm-commits@vger.kernel.org,osalvador@suse.de,osalvador@kernel.org,nao.horiguchi@gmail.com,linmiaohe@huawei.com,liuye@kylinos.cn,akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-stable] mm-memory-failure-remove-hugetlb-output-parameter-from-try_memory_failure_hugetlb.patch removed from -mm tree Message-Id: <20260602222442.777901F00893@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The quilt patch titled Subject: mm/memory-failure: remove hugetlb output parameter from try_memory_failure_hugetlb() has been removed from the -mm tree. Its filename was mm-memory-failure-remove-hugetlb-output-parameter-from-try_memory_failure_hugetlb.patch This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Ye Liu Subject: mm/memory-failure: remove hugetlb output parameter from try_memory_failure_hugetlb() Date: Fri, 15 May 2026 10:01:43 +0800 Use -ENOENT return value to distinguish "not a hugetlb page" from "hugetlb handled", instead of carrying an extra output parameter. Link: https://lore.kernel.org/20260515020144.164941-1-ye.liu@linux.dev Signed-off-by: Ye Liu Suggested-by: Oscar Salvador Acked-by: Miaohe Lin Acked-by: Oscar Salvador (SUSE) Cc: Naoya Horiguchi Signed-off-by: Andrew Morton --- mm/memory-failure.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) --- a/mm/memory-failure.c~mm-memory-failure-remove-hugetlb-output-parameter-from-try_memory_failure_hugetlb +++ a/mm/memory-failure.c @@ -2027,13 +2027,14 @@ out_unlock: * So some of prechecks for hwpoison (pinning, and testing/setting * PageHWPoison) should be done in single hugetlb_lock range. * Returns: - * 0 - not hugetlb, or recovered + * 0 - recovered + * -ENOENT - no hugetlb page * -EBUSY - not recovered * -EOPNOTSUPP - hwpoison_filter'ed * -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 *hugetlb) +static int try_memory_failure_hugetlb(unsigned long pfn, int flags) { int res, rv; struct page *p = pfn_to_page(pfn); @@ -2041,13 +2042,11 @@ static int try_memory_failure_hugetlb(un unsigned long page_flags; bool migratable_cleared = false; - *hugetlb = 1; retry: res = get_huge_page_for_hwpoison(pfn, flags, &migratable_cleared); switch (res) { case MF_HUGETLB_NON_HUGEPAGE: /* fallback to normal page handling */ - *hugetlb = 0; - return 0; + return -ENOENT; case MF_HUGETLB_RETRY: if (!(flags & MF_NO_RETRY)) { flags |= MF_NO_RETRY; @@ -2108,9 +2107,9 @@ retry: } #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) { - return 0; + return -ENOENT; } static inline unsigned long folio_free_raw_hwp(struct folio *folio, bool flag) @@ -2348,7 +2347,6 @@ int memory_failure(unsigned long pfn, in int res = 0; unsigned long page_flags; bool retry = true; - int hugetlb = 0; if (!sysctl_memory_failure_recovery) panic("Memory failure on page %lx", pfn); @@ -2387,8 +2385,11 @@ int memory_failure(unsigned long pfn, in } try_again: - res = try_memory_failure_hugetlb(pfn, flags, &hugetlb); - if (hugetlb) + res = try_memory_failure_hugetlb(pfn, flags); + /* + * -ENOENT means the page we found is not hugetlb, so proceed with normal page handling + */ + if (res != -ENOENT) goto unlock_mutex; if (TestSetPageHWPoison(p)) { _ Patches currently in -mm which might be from liuye@kylinos.cn are