From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 E9C023A6EF7 for ; Tue, 2 Jun 2026 21:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780437367; cv=none; b=uMQNp0jPNSVoWH1M6DAnF5F0EeOYU/3cKIWG3s8eZim7o1TVJc9+Cfts3dS6auuRte0K3aqjRzXl1a9eirgeIJp8d/Hnob+ZNdzDqI1EYKxGK3FTCb0RjYii5Zx/0adJjJv2z/R0WH1vxg9hR4tahpgWm0rZNbcXxsfZ56LB9FU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780437367; c=relaxed/simple; bh=eDCJmE+ukj/QmiRfjhh4tiNP2lmAkBpX7X42rYIjVPg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=EEPcWhbAa5mJBPpk0zDCIK32xQr1suEXwd1LtEZXTNz+zQKBN9mdFq23QSTcQNk/4c1asCTJHBodZGmrnNkV4qbkMVL0orlMbbwSRgHP7/jnNAPxGUFaZBmlf6aOVN6WoflVc17z4OrrlaHgZY7yhpUoVTe/eB5okvkQL0Ee+Yc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--wyihan.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FVHMQ5mt; arc=none smtp.client-ip=209.85.214.202 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--wyihan.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FVHMQ5mt" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2bf335549b8so54888765ad.1 for ; Tue, 02 Jun 2026 14:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780437365; x=1781042165; 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=IodJjZi5r7h0hIvWeeU29JYBpcZRZhnAZAUBtd3riDg=; b=FVHMQ5mtmSeIfohMz54I3zBYQVu3f5WT9tNk/XSE71azpt9WW6ygJyBSzNZoCe2lGn hjIpwezmgVBFVDT0ZwKAEMpR9aZTpYyRr6mWUJlaqzAOQWsPSiarUQxqbavAeWEH/XVQ 1M1OVPkIqXrnBkbWGIaxQWKRsisaEB8bVn5BYCmLjsyuYXbvjJKMCSkoe1nOH2D3ncZb /MTAL7D+qNvKVxhSXfmiw2drSCtCZS+/c1XCyo+J/U042S4aTKfhmC6KwHqORczLwlfj DOCdm7w4WDAErrt5UgwtXI3B97iU2u6qUlayiiODKGzxeMm4CUmCr4biV4W3DMdjaoHS IvcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780437365; x=1781042165; 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=IodJjZi5r7h0hIvWeeU29JYBpcZRZhnAZAUBtd3riDg=; b=ie3b7u6wvJiSD6Z4b/zPRCUWWCSnhYsKk4nfHgBMs0NY6v4VYgi8v0V5LzyYxUIdgt CPPlzXVgJdznichpoUJ2noAymGvSnUv0Jo6MjbarACF/wSJh5+33KSU/5UdcXCv+YitF hmCeSu60iDXHHLevUmHZUc0m088HHAmHU66K1w8hD2IfG69qzuzuywwBsEebF4WzMBPP NYrohH2Kf8kcK8QFRhN4Kj8PaUBy7eWTub217yQxLo0HRUkWx/EczY9Wj5vhg4U3JCBT uyYOeZqC3aRagwj43gCWE5jYElpViAObnWHW74ENNLowUlM74xkCYPhgS78dmn197KVe 3j9w== X-Forwarded-Encrypted: i=1; AFNElJ8By802BTcPZnjCcfF5fpxGEmf5l9DGaHtM3XC67Q/u/plIOQvP+uYztcd5NNUb6PiMwZbJdkDlPvpIDf4=@vger.kernel.org X-Gm-Message-State: AOJu0YxPW0DQ5juQJ0AgHg3mVffwX2xXwB31TqmiPfxTaRlbXvefVu5q wn2p/Le5zpEeMECKLLKo09EyrxkmWUBMM8BSIE85ZuJNHYhd4cGSY1N2lR8V+OoFev8D4/MBQ2r OdnX9JA== X-Received: from pljf15.prod.google.com ([2002:a17:902:ff0f:b0:2bd:e92a:169b]) (user=wyihan job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:b8d:b0:2c0:cbd8:5ff9 with SMTP id d9443c01a7336-2c163fa8268mr4999375ad.21.1780437365088; Tue, 02 Jun 2026 14:56:05 -0700 (PDT) Date: Tue, 02 Jun 2026 21:55:41 +0000 In-Reply-To: <20260602-memory-failure-mf-delayed-fix-v4-0-a5bc7db5a9b2@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260602-memory-failure-mf-delayed-fix-v4-0-a5bc7db5a9b2@google.com> X-Developer-Key: i=wyihan@google.com; a=ed25519; pk=cRi0fKzS5BMxlHyHY2pJv3w/1zcgfYKr6EYGYppdMYc= X-Developer-Signature: v=1; a=ed25519-sha256; t=1780437363; l=2390; i=wyihan@google.com; s=20260319; h=from:subject:message-id; bh=eDCJmE+ukj/QmiRfjhh4tiNP2lmAkBpX7X42rYIjVPg=; b=qlOZ4DnpysCVCE4RR3aGPdX4Di/mOUwwaTmtW26PG+ejDM/9AkmX+V6nOEdYaPJYt6sl8ORav 5QxNZfYotzjAiPo92LoZAmJK1I57WL8Zcm0X9kR0EJD3OR5c59Nwoco X-Mailer: b4 0.14.3 Message-ID: <20260602-memory-failure-mf-delayed-fix-v4-1-a5bc7db5a9b2@google.com> Subject: [PATCH v4 1/7] mm: memory_failure: Clarify the MF_DELAYED definition From: Lisa Wang To: Miaohe Lin , Naoya Horiguchi , Andrew Morton , Paolo Bonzini , Shuah Khan , Hugh Dickins , Baolin Wang , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: rientjes@google.com, seanjc@google.com, ackerleytng@google.com, vannapurve@google.com, michael.roth@amd.com, jiaqiyan@google.com, tabba@google.com, dave.hansen@linux.intel.com, Lisa Wang Content-Type: text/plain; charset="utf-8" This patch clarifies the definition of MF_DELAYED to represent cases where a folio's removal is initiated but not immediately completed (e.g., due to remaining metadata references). Signed-off-by: Lisa Wang --- mm/memory-failure.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index ee42d4361309..2e53b3024391 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -849,24 +849,25 @@ static int kill_accessing_process(struct task_struct *p, unsigned long pfn, } /* - * MF_IGNORED - The m-f() handler marks the page as PG_hwpoisoned'ed. + * MF_IGNORED - The m-f() handler marks the page as PG_hwpoison'ed. * But it could not do more to isolate the page from being accessed again, * nor does it kill the process. This is extremely rare and one of the * potential causes is that the page state has been changed due to * underlying race condition. This is the most severe outcomes. * - * MF_FAILED - The m-f() handler marks the page as PG_hwpoisoned'ed. + * MF_FAILED - The m-f() handler marks the page as PG_hwpoison'ed. * It should have killed the process, but it can't isolate the page, * due to conditions such as extra pin, unmap failure, etc. Accessing * the page again may trigger another MCE and the process will be killed * by the m-f() handler immediately. * - * MF_DELAYED - The m-f() handler marks the page as PG_hwpoisoned'ed. - * The page is unmapped, and is removed from the LRU or file mapping. - * An attempt to access the page again will trigger page fault and the - * PF handler will kill the process. + * MF_DELAYED - The m-f() handler marks the page as PG_hwpoison'ed. + * It means the page was unmapped and partially isolated (e.g. removed from + * file mapping or the LRU) but full cleanup is deferred (e.g. the metadata + * for the memory, as in struct page/folio, is still referenced). Any + * further access to the page will result in the process being killed. * - * MF_RECOVERED - The m-f() handler marks the page as PG_hwpoisoned'ed. + * MF_RECOVERED - The m-f() handler marks the page as PG_hwpoison'ed. * The page has been completely isolated, that is, unmapped, taken out of * the buddy system, or hole-punched out of the file mapping. */ -- 2.54.0.1013.g208068f2d8-goog