From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796068823; b=S285TigrSrzC3eoWYtqREWOrjl/+RFFJ47wB/8wUeaqF7VrZxBrnpDpRlcaoFhcUsSM3 u1aW3LQx9EtQNOi/OiP9/KJhRMH5lgnIoRn4T6iSxZiDOyovWoDZVW++QR6iHw/NL51MU BL5cEhmzZoVSMrNgohZle8z+/p/c9hBmCL2xZeSxbRWY0XDGPhfSp3F9NrdZ2G3ICqbW+ 1PpwSBoN7NeSiHCSTriV4llvqV7tI0pekn9F0enjBzPLUeIlFviKKG518Yr7st/hCw2tr n+9rj2H+egO3x215lQ71jkE73lqlBjqBzM0dH3cZyFbvkCGr04lP7BT+wPEBqlgdC7A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796068823; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=x/2jyYaRj+IB7Olc3HMooLDmYcBI6yiZNNi3XjXMobw=; b=UOYursYSiCqRsF+jKkWKFG6LHV5xccqpBFWwVquHjDXkbLTS7JvCi1hZmS7B1SlZZXgx Q95qda28BZO5SVtLLEWDa3UXbbdsqaJLcuUhiJKIDSIFczcsB/S5Brwct7IGqPFAF3Gpf XU94Yq1PBPo+vpKsEi0B53Eojl7G2BmlqGWG0bvRkZDVuCGawJGXVap5MtV7oWOIt2q/J MslijshI2Ei7pRzD9JufzNT7LQGK3CZT1NMGZG7GqbUzovc9aSH2qqPmAT8v6fRCZ8MUh ssF+NUyE85LXN5B39XmkBToo46YUxL3jqKBXr4gpterANOvLRH3QbBTAKdcZLrq6vVw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=N8dWykv3; arc=none smtp.remote-ip=74.125.82.47 Received: from mail-dl1-f47.google.com (mail-dl1-f47.google.com [74.125.82.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCC03606A32A for ; Mon, 30 Nov 2026 20:00:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CCC03606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=N8dWykv3 Received: by mail-dl1-f47.google.com with SMTP id a92af1059eb24-1a3c08d6928so16571728c88.0 for ; Mon, 30 Nov 2026 12:00:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796068822; x=1796673622; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=x/2jyYaRj+IB7Olc3HMooLDmYcBI6yiZNNi3XjXMobw=; b=N8dWykv3ODq3o6t/ZNYoRyB8Xeq/eZiBr+cHlCp4cMEJqjFsu0BgjobKWjry0wipbH Pwu0QKtfnQnE3aQ/He6OpEEBiLKqkYjfV/gHFDM5nyDJX6of/5OC/3jyKdquGmcrG7K2 ocnryMFNXzqVe5I+t1dto6daxIGMlp1UXmZKo9jj7pUVjDcI/0rwJ/+Pvt1rLaVCWAbG ukCFZgE/MzqOEivCI50Rj7XPy6NznV622CWTSOMfYK12cjUX4lVzb1pBumqcofcPMCK+ W5d+n9UZBS/VKHH0K8JTNKhEkDDSlf2677TbVEG2YQ6tun4wve3tLr56cH7Owg16eN6j W0Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796068822; x=1796673622; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=x/2jyYaRj+IB7Olc3HMooLDmYcBI6yiZNNi3XjXMobw=; b=HektcqgU1A0ATkHg4HMv8YKIRO4kk+2RtF6GoVdmO+jzbQm5h8ePPJhPcn+r2MR3r2 Q33fibRoMZe+opTGdFn8i6i+Wte4x8ioQFGWPWX1AJ9x78MYTODW8YdabnfCdyHnvQVH BWeKMGKfxiYIYiaegbxKDxDyyZNP2baYb7uzM+GWLVLhXxR0m3CcBOgu8HBzUkulAcwg SppkUth6q3e5dfuNZot3JtuLdwL++0L79BknaFFDUtP5p+tTgtT0Q+DvS9fAaLbRuDTE t2An3O3cKHR7efaIvwXokr7F0XWDYOhU8e7+oHMfTCvt6iHjUIBNtGkmMBQXDsuCJyC6 5uZA== X-Forwarded-Encrypted: i=1; AL+hErF5P2pG8YoUc6td7Z2HP7LhvqOP09QGLYEi/I4qac+2Ju/BPqM7Y7b81Cxmv9wGNyzmPL22f+7Djo6bAh4=@vger.kernel.org X-Gm-Message-State: APuU4Z/Y8sskxYfDKDDsnypq29dJrm6FQ20o+umYN1x/xmU8oY+Uty+X LDOlmOSLk2gPIbPew+OTuiPjx56j/U9Rv9UCnn6xSzwCTrzqTLUcA4Od X-Gm-Gg: AZFdTZfuzkNH9AxKs9NEDTNqNT8N4mu4FymsHnKqVuSi9NVi+H14+ffF5s57+uY18gn 5ked46lJ4PETt0RmZp/yBQq3eYBO/5eQ7qi4zH5vvDSp26cVbfu/iTjbmgLFKFD8BITUkk5G0pX Mjeq7xQPHyBY1bo1Do6/9hyc+w8vOfIEZ/A3j4MxGlEw5/x3IC5IoUNvqh8+FiKP5YYQwhvEs0O 19fdjnDQQjr3tFQc/6LIq4x/zmKLs03tA0Z2zLBQ74xiw8OZTl4eNJoOgB3/4T4k5MEMCAZTxFl svWmawoQ2GliH2U4bM0Rx3ggL1b1obcitDrTZ69YyH6smQLZ6mkSsfKKXMk3cXhKzvuYlFAgxqV oU3SOvAXc5QCuFxJoMkSQw/h+zRbyzlWNjgDl4mAKwYTVb0G5rTQvT1pY9kp1kqAdCmjUrNhQxg 8/OsJjAJopRQZHtZr+6lODBq1NqAL1uwXC4ANRbbWM1I/+CFMLob0iSUCHAuFtHFK3TJzt3H/6m sH6stcngFvAkSbtL/8QOw2naZ7FBodpZQzmSYlH+BFIMKqxmGx+YT6HtBQ+Wt+43UCUlAg+oCdG 9xE+eHdwgWtcW1u/FBaV2ZlsJcp867mOfFQ= X-Received: by 2002:a05:701b:450f:10b0:1b5:22fb:848d with SMTP id a92af1059eb24-1b56f87ae7cmr25753341c88.16.1796068821479; Mon, 30 Nov 2026 12:00:21 -0800 (PST) Received: from localhost ([2409:4071:4e9b:468:fff3:802a:1894:6274]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5569bffd2sm74666009c88.0.2026.11.30.12.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 12:00:20 -0800 (PST) Date: Tue, 1 Dec 2026 01:30:16 +0530 From: Shaikh Kamaluddin To: Jonathan Cameron Cc: Davidlohr Bueso , Dave Jiang , Alison Schofield , Vishal Verma , Dan Williams , Miaohe Lin , Andrew Morton , Vlastimil Babka , Breno Leitao , Ira Weiny , Li Ming , Richard Cheng , Naoya Horiguchi , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, David Hildenbrand , Oscar Salvador , Kiryl Shutsemau , Harry Yoo Subject: Re: [RFC PATCH 0/5] cxl, mm: Keep device-reported poison out of the page allocator Message-ID: References: <20261010162017.62506-1-shaikhkamal2012@gmail.com> <20261016214206.1dc8484a@jic23-hlaptop> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20261016214206.1dc8484a@jic23-hlaptop> On Fri, Oct 16, 2026 at 09:42:06PM +0100, Jonathan Cameron wrote: > On Sat, 10 Oct 2026 21:50:08 +0530 > Shaikh Kamaluddin wrote: > > > A CXL memory device keeps its own poison list: the DPAs it knows to be > > bad. The list lives on the device, so it survives a host reboot, a power > > cycle, and moving the device to another host. > > That is a bit too general + needs backing with specific spec references. > I'm not sure for instance if there are any guarantees around poison > lists for volatile as some errors detected by local ECC will be intermittent > anyway. > > I may have forgotten it but I don't recall the CXL spec talking at all > about any long term tracking of errors in volatile memory across power > cycles. There are interfaces to test memory to detect stuck bits but > I don't think there is any requirement to run them at device boot (and > we haven't enabled them in linux yet as on demand things). > Hi Jonathan, Agreed; I conflated the device's poison list with persistence of its records. CXL 4.0 Section 8.2.10.9.4.1 requires Get Poison List to return currently known poisoned locations. Its reference to volatile and persistent partitions concerns the DPA range being queried; it does not guarantee that poison records survive a power cycle. For v2, I will say that the series queries each participating decoder at region probe and withholds pages covered by records returned then. I will remove the claims about survival across power cycles and device migration. > > > > > Linux reads that list only when user space writes trigger_poison_list. > > Nothing reads it when a region is assembled, so with a device that > > already has poison: > > > > 1. the RAM region is assembled and dax/kmem onlines it; > > 2. every frame enters the buddy allocator, including the ones the > > device would have named had anyone asked; > > 3. a task is handed one and reads it: machine check, memory_failure(), > > SIGBUS. > > > > This series reads the poison list at region probe, before the range is > > onlined, and keeps the frames it covers out of the allocator. Nothing is > > unmapped or signalled, and no runtime path changes: the frames never > > enter the allocator, so this is not forwarding latent poison to > > memory_failure(). > > > > Dependency > > ========== > > > > This is built on Breno Leitao's hwpoison series [1], which keeps frames > > poisoned before a kexec out of the next kernel's allocator. The approach > > here, withholding frames as they are onlined rather than taking them > > back out later, follows [1]. [1] hooks __free_pages_core(), splits a > > block around its bad frames, and marks them with hwpoison_boot_page(). > > Patch 4 adds a second source to that hook. > > > > The two cover different cases. [1] records frames in a bitmap spanning > > the RAM the EFI memory map describes. Memory hot-added after boot sits > > outside it, and CXL region memory is hot-added after boot. [1] also > > carries its record across kexec only, while the device's list survives > > reboot and migration. > > The CXL region - may be hot added after boot. Whilst I like that model, > on many existing systems the CXL subsystem is just identifying what > was already there. > Agreed. If firmware marks the range EFI_MEMORY_SP, the CXL driver assembles the region and dax/kmem adds it, so it goes through this path. If firmware hands it over as normal RAM, it is already online before the driver can read the list, and this series doesn't cover that. v2 will say so. > > > > Applies on next-20260908 plus [1] v5. The num_poisoned_pages_inc() > > change agreed for v6 [2] does not touch these patches. Patches 1, 2 and > > 5 touch only drivers/cxl; patches 3 and 4 touch mm. > > > > Design > > ====== > > > > Which records are withheld. A corrected error never reaches the poison > > list, so every record is uncorrectable. Only records with source > > Internal, a failure of the device's own media, are withheld. External > > poison was written by the host into healthy media and a rewrite recovers > > it; Injected poison comes from the Inject Poison test command. Withholding > > either would make a recoverable state permanent. > > At best a detection of an ECC error in local media is a hint that it > might not be cleared by a suitable full cache line write. > Agreed. I overstated what Source=Internal means: it identifies the origin of the poison, not a permanently failed location. This RFC withholds a currently reported poisoned page before onlining, but does not test whether a full cache-line write can recover it. I will correct that description in v2. Recovering such a frame (write a full cache line, read it back, and if the data is intact give the frame to the allocator again) would be a separate follow-up, not part of this series. Is that acceptable, or do you want it in this series? > > > > No host-side storage. The device is the source of truth and is re-read > > on every probe. When a location is repaired (sPPR, sparing, hPPR) the > > It might well be repaired just fine by a host write assuming the CPU > arch supports clearing poison that way. Ideally we'd poke it some to > find out whether it is recoverable. > Agreed. A full cache-line write may also repair the location, if the CPU architecture supports clearing poison that way. The cover letter lists only sPPR, sparing and hPPR as ways a location gets repaired, so I will correct that in v2. This RFC does not do that write or check whether the location recovers. Trying the write and reading the location back is the follow-up I mentioned in my reply above. > > device drops it from the list, and the next probe onlines the frame > > again. A record persisted by the host could not learn about the repair. > > > > Volatile ranges. CXL r3.2 8.2.9.8.4.1: > > > > If the device does not support poison list for volatile ranges and any > > location in the requested list maps to volatile, the device shall > > return Invalid Physical Address. > > > > A device that returns it, or that has no Get Poison List at all, is > > onlined as today with nothing withheld. This is also the reason for the > > RAM -EFAULT tolerance poison_by_decoder() has carried, without a comment, > > since f0832a586396 ("cxl/region: Provide region info to the cxl_poison > > trace event"). > > > > Incomplete lists. If the device reports overflow, the host stops at > > max_errors with more records pending, or a media scan is in progress, > > region probe fails rather than onlining on a partial list. > > This bit needs shout more about as you just stopped region probe > on regions that previously probed (but would potentially return poison > on some memory). I'd put a Note: Will stop regions probing if poison list > has overflowed. right at the top of this cover letter. > > I'm not necessarily against this. I need to think a bit more on the impacts. > > Certainly an interesting patch set. > Agreed. This changes probe behavior for regions that probed before, and I buried it in the Design section. v2 will have this note near the top of the cover letter: Note: A RAM region that previously probed may now fail to probe if Get Poison List reports overflow or the records cannot be retrieved in full. Thanks for the review. > > prerequisite-patch-id: a23fe88ab4529b6a6669a991e15cf1631311391c > > prerequisite-patch-id: 111c69880ed0e148cdda285896c006e8d1fc98a8 >