Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796068823; b=WCdKO/mAIwoqE5e4e3E9XCXkuqDbYFDN5XZ700RMGTMUgYYMQrIETtcu2F2Jq+z4wndJ uMoPdgw3PqVoI1VsGrcq0RQ0xilNbtinPCi1NUDhzdSfAUBt8OxP7ZditXbTk+8Yk9/L2 W+1soUE8WEQbUDmgwwc+BRlRzBHJkeTYDI/1NaRvmR18TzF4XpBpDTaB8ITa4erDjhuRT w2yz6FQVg3vwXDCMmCG42xQVE7UnXJmOeOMp+8AfRRQlUtCr3hFKS+pXeL2m8E1ecLADy Vj6MZBJG9rs9AUxyAAEf3HPx1/48COPA8dOcS36Y1uS6i9fObBH5/fCb4W9YC875SfA== 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=QKA9r6TWua3/nDWRpm6e86PcHgiTt74ScRfZH8T8Kf3MtQLmWQpa3opcWiZzeSccFpWV 6mbDGwKFgWWIEooSHRPBOL4OP5JM0vT32bDo15xr1I4mZrj2SHHHCKSqq+LSGjaRp1TCD 5xq7PL+kgMllmcH4Q3QVaZaqMCT7gmE9tQFPRbbolmgd0LNdHKTq1nwHSBpUthuZN9HaU x4pjYsLgUI+8P1sdeUXrgJqSR0R49IawZ6Ds2PlVsQdOfmQTfUsri9/uxZnPOZNlDUVzO HDChPMKmvmyYghMO7prxp4O0Asyz+wgCSTVDEbghvHHl3Ly4A5l33ju3UVHKl91IVYA== 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.46 Received: from mail-dl1-f46.google.com (mail-dl1-f46.google.com [74.125.82.46]) (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 D2BD8606A680 for ; Mon, 30 Nov 2026 20:00:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D2BD8606A680 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-f46.google.com with SMTP id a92af1059eb24-1a3c08d6928so16571721c88.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=aTYr6I60OZxUEKQ2wDm+Zp41dENRzieEshPf2qobRPwnmbhpmMh/wSV7jjdGWiXQu1 +BLpgV6uXt7C3IeYPIKlzbXr0kX2MKstxyPeDl53CtW2y03SJRszbIHvQxWPqTJHggTn ekNDdsIlPGdmtr00CO+Ip+IqS2Ba2wfXwtq9vjojODoDjP0ZAXT70Dh0DkVhLjgMPd1B FaYX0Shuv7WSAzNFxsyX8ePOHiZHju6J5OnflLSZq/z7nWQwvtujtnA68TpVdM7BdX0v uvMsosCO2woYqe0at/Ah2PiW+c/f2mOSSjOg35eI5+hDyNGiJPKDZTxxC2uPG3ZWaZzD 8cew== X-Forwarded-Encrypted: i=1; AL+hErHjcWonXGUvgjYNK80wtxT2KypNAtjOhX6nNg8LniFX2phYgdgfZyXJxvfh1RmqVdohlmO9r1S7vJI=@vger.kernel.org X-Gm-Message-State: APuU4Z8fH1UBd1eTwdD9A6E6JNZcLU2k0d3TLPKqHzLdbcgevTRGdfw6 GXbqdHZTUFQ9/x3r/62yCYZjHVJJwVm37khiwKmS+xUHF52+xZhfjn2b X-Gm-Gg: AZFdTZe+uPAeVIhZZ8dMYZShXpdhP9ZhzB1eCeU93aj2Qb2v2O7x2b7hdYza/ChbjYr qAJrPV1bqyadOmUk8ikXjZ48K1XKR2hUk5wWD4JCTxaetfbIKafK3UmLiJmr9lXLhoN8TGgoW84 YCXoiI7lacTd3nyHprZuRxtet5+wCNwuLCMH7MeUMGvHglxUcRag28bONzbvVm0XsULjgOCOX+V PPmDSIY9UdLVtjybG0ni3P99S5JTiCa73cm8Z9fIcs0oDpnBQaX/rEydvuZM3wYcuI27sJCmx2z 5m7UfoCpZ0Y9YRpmGgZd2n8SYnipZ0x5xVb9abHvalB/GCkWvb3yx1PC4FZUxieqCvrIy4OaV6s 2G/LnGc9sNUKNUtnFH09hz4jRcGmC1HvH1LyScsV3OXlQAwB/WEqpOY6SHvrpvuvFbvOUFA2CHU BN7VYxpOTsH7H57zdyRFVSjoUysLStjOLCIkxaO2LIKiEYAjI5lmIyukyE2BaIlvzxV2Qmyp769 +TfMiedLscJIcBsc5ejlyKQAJrydvdCSAD4OGLqKO+i8FowsJnc3TQT4C7P5Fhl+FUdcJdnisy3 h+TvFJvxDwtn+3jNVtOwqYnaFAubrHP3xvM= 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-cxl@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 >