From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796335648; b=YP9wI3IfMnBJTn9YxVwVnWK8UFdFlYJkHgy3uVCaM7GbZmRBQ3vZ6wJkXxl6wI669FRB IOyLt6grG/7rtJ5x/dCzcUjjriW3iLzeglmd+Q2d0WKS2j9yS35HHj2rqUpw6aRbWk3jv Zimy6QJ2kGYXhAwxpVE5HfyTcpsSKmxvbeEScldRYWgJo/xHptbx7/941g0grUCPshmVY IVsbTRjomP8F++oVdOquUEr490fnnEgi1acRuz2tESwN5u+51wVUNgvy7BDvQirK724i6 XTkQc+bJD/duz/s3jDxARM8jzi61d0H8LsPnVQU5CDkjON6uXnEp0y384eklhbfh+6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796335648; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:X-Google-Original-From:Date:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=YUlUKTbZdxbsPEqUhCIz1w7mTmvcUPxb69+Vq7EsCVs=; b=5na6fQlGC1nDHWDog/6SV96+LR49aXUXgv0kqm9yBNxzs5/HkaNFkdYJ1x7L8qsIPnTV uCk7oCq/9qsRglqdXoxWRf9zrlH6nO8v6Mwyz2Y8nTf28d/XK+G6Cd1o+D1A3eacrObJa pn4w8XtPBqR45R3dKyIhsS/BUjKLIOaFdSUfeYAesFPvdvgUO/ieq2V+y+hIQmeMsR/b/ zzl8RWIzbyoD7xU73VKK4xOFCBuzoKBaYVrghH9G7YrGYWv8WLzi+aBMSGUOKjnp2cGxS z2zVv8IOojZB8hM1vpavcz1VuCQkL46uvug1Vm0sZRV3AsfCUB2Lw/goK6CqDBUrN5w== 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="Ab9/n4Pv"; arc=none smtp.remote-ip=209.85.214.175 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 AE173606A333 for ; Thu, 3 Dec 2026 22:07:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AE173606A333 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=Ab9/n4Pv Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2f02f04a426so480615ad.1 for ; Thu, 03 Dec 2026 14:07:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796335647; x=1796940447; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:date:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=YUlUKTbZdxbsPEqUhCIz1w7mTmvcUPxb69+Vq7EsCVs=; b=Ab9/n4PvfSPCsp16qU9yH6MRhAfmNAiM5gUeRrR2/f+2HAPrfky/qQreNLwmb2BiuF eOc9sZt3sLWKntR00eBXdEgwcsKHEb4OoZowf4mOKZ+nl1Q0ApeJSOe5sJaF6Niw73Tz fXXhiESoAKf2tATxbV+zt/psRXjiitJXvUuJP2x7XpFCHJAyHeNZ530hJGQXMAqbZVWz QDjykhHUSg/pEylCcJJUY0mkzDRZBE+qvr4K8EJTGFznF+gtdx5wKXncf28nwJkkQZSs TZdTPtZG7BcfIWQIOWtM//bzjp6ileYBfpWdR66apxSjxbSwU5x0w7hK2Z4rZK7JVWuC AMyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796335647; x=1796940447; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=YUlUKTbZdxbsPEqUhCIz1w7mTmvcUPxb69+Vq7EsCVs=; b=foe/cfvKtXv8Fj2DbvRBW0Du7mGLafR51PBr6RfC4RouIh1KVQdYuMXsfWLEkxdRvy a0KOgHi3xSAuiKMdzbtyJX1CsZ9I/mXgPTTff0BnWHfWoq157/AnR57ueXo9LjCzBskx V8zwhC8ZESrcOy41E88NNdHT8sgop6BiQsVYJLWhKU00LnVxm7CxaMsxvuMTCs6G+5P1 vRJ1C3RWRDaSAT2wK6s+pzSdAdHVbHaqjnABOzmFxniDKOdpFefr1V/SzP6p3O/MAuR1 HcEtvD2Zy65XdR2CgPBQg/GXvOQINArGOpvxJ/gf3soYxiYzZBqWN2CCzY00gmIJPE/u /gIw== X-Forwarded-Encrypted: i=1; AL+hErF3b/YdXriueZn0ZsPH/xbLPbHovIw2aYK2gtlah+4EW59RATL5bp7zYPwkhHmEfvg74TDkujYsaX8=@vger.kernel.org X-Gm-Message-State: APuU4Z+M7HMYDQJhUBKemsdZjsbnEGyA4KK/dk0iaJlEuyNfWCTa2T7n 3hzgNIj/G6meCGcpAL3ph9NBUOANmYWQEFFj7OFP74HRnptRgVUs5fSJ X-Gm-Gg: AZFdTZcHxl6g8/2ECuVfr8Tx9SacHA3te4cOtohBLtOjyU0o9uwAmcSFgXCXZhvDbBC xh18E6FIt2pLaYLk+6WNqRQ/U5Td30jom6uRNPgydFlVBYqtazaaONaGT2q3LCPCUkTuCb8tmho KiA2Oa9NlzplIu1K67yjy+54nnqxSuIOEPhpezu/O1UFbCWbiauRXgrZ7hGzTkzL64oorYhZDbG Lagmu+owLpiPS2gSrf/GzgFPNixJhiA+gWi4F1HVU9Y0j6ki7+IW8317RaiDpl1sxT1kf/BQhoz fiaLPFyhVhW8bOKh7Htl+rslW2SlSEQX4Rd3jVuEjxyt+wWsffi0wh4ScoWPCzG6BuatRhGR6z6 sMHmOIoUyuJyrDT4rxVMcUppfzKkyWWwfAKrfIHooYMhh9Pkf5012tosBceX794IZnnlN+A6BA8 JsSdglnTEY7s8JTGYb00fk5eiCMQTnQR945SlBknC6mQcG26PIuurwfEx1yFVzCpIWxj7ssDIkL zj7aUq0cQHI007uEp+kTk9B6APPWBgQVyyGMf+ufq72amtXyJPwOIV/5oIXSN1BaXTnKozf07Nr MVF5Vxad9zQG4tC9l0xAni6GBw== X-Received: by 2002:a17:90b:4ccb:b0:3b3:b417:607d with SMTP id 98e67ed59e1d1-3b41c8d95e5mr44921204a91.18.1796335646815; Thu, 03 Dec 2026 14:07:26 -0800 (PST) Received: from cxlqual ([220.120.90.131]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d10dadsm6175370a91.5.2026.12.03.14.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 14:07:26 -0800 (PST) From: Anisa Su X-Google-Original-From: Anisa Su Date: Fri, 4 Dec 2026 07:09:18 +0900 To: Alison Schofield Cc: Anisa Su , linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, Dave Jiang , Jonathan Cameron , Davidlohr Bueso , Ira Weiny , Vishal Verma , Fan Ni , Li Ming , Benjamin Cheatham , Gregory Price , Richard Cheng Subject: Re: [PATCH v1 03/14] cxl/region: Add dynamic DAX region support Message-ID: References: <20261104230445.66625-1-anisa.su@samsung.com> <20261104230445.66625-4-anisa.su@samsung.com> 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=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Nov 24, 2026 at 10:55:33AM -0800, Alison Schofield wrote: > On Thu, Nov 05, 2026 at 08:02:27AM +0900, Anisa Su wrote: > > From: Ira Weiny > > > > CXL DAX regions must allow memory to be added or removed dynamically > > to support DCD. In addition to the quantity of memory available, the > > location of the memory within a DC partition is dynamic, based on the > > extents offered by a device. CXL DAX regions must accommodate the > > dynamic movement of this memory in the management of DAX regions and > > devices. > > > > Introduce the concept of a dynamic DAX region. A dynamic region > > carries the shareable and read-only properties of the partitions it > > decodes, fixed when the region is created: every endpoint decoder > > attached to it must point at a partition with exactly those > > properties, and the region's 'mode' reports the matching selector. > > > > A dynamic region has no capacity when it is created, so the DAX device > > that cxl_dax_region_probe() creates for every region gets size 0 > > instead of the region size: a seed that claims no capacity the device > > has not offered yet. Its dax_region is created with IORESOURCE_DAX_DCD > > rather than IORESOURCE_DAX_KMEM, so the DAX devices on it bind to > > device_dax and not to kmem. > > > > Indicate 0 byte available capacity until such time that capacity is > > added. > > Is "until such time that capacity is added" describing this series? > dax_region_avail_size() returns 0 for every DCD dax_region. > > Maybe just say the available size is always 0 here, and leave the > change to the series that makes extents usable? > > This paragraph also seems to repeat the one above it. Maybe drop or > fold in. > Reworded to one paragraph that just mentions 0-size seed device for DC regions: A dynamic region has no capacity when it is created, so the DAX device that cxl_dax_region_probe() creates for every region gets size 0 instead of the region size: a seed that claims no capacity, as the device has not offered any yet. Its dax_region reports 0 bytes available and is created with IORESOURCE_DAX_DCD rather than IORESOURCE_DAX_KMEM, so the DAX devices on it bind to device_dax and not to kmem. > > > > While DCD is disabled, auto region creation and the region 'target' > > write refuse endpoint decoders on a DC partition with -ENXIO, as the > > decoder 'mode' write already does. The sysfs entries for manual region > > creation follow in a separate patch. > > No later patch in this series adds the manual creation files. > Maybe just drop comments about what this phase now doesn't do. > Okie dropped all references to manual creation. > > > > Additionally, dynamic regions complicate the range mapping of dax > > devices. There is no known use case for range mapping on dynamic > > regions. Avoid the complication by preventing range mapping of dax > > devices on dynamic regions. > > > > Interleaving is deferred for now. > > > > Based on an original patch by Navneet Singh. > > > > Signed-off-by: Ira Weiny > > Co-developed-by: Anisa Su > > Signed-off-by: Anisa Su > > Tested-by: Wonjae Lee > > Tested-by: Junhee Park > > Tested-by: Heesoo Kim > > --- > > Documentation/ABI/testing/sysfs-bus-cxl | 5 ++- > > drivers/cxl/core/region.c | 60 ++++++++++++++++++++++--- > > drivers/cxl/core/region_dax.c | 6 +++ > > drivers/cxl/cxl.h | 4 ++ > > drivers/dax/bus.c | 10 +++++ > > drivers/dax/bus.h | 1 + > > drivers/dax/cxl.c | 17 ++++++- > > 7 files changed, 93 insertions(+), 10 deletions(-) > > > > snip > > > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c > > index f4a9839c73d2..fc9139ce358f 100644 > > --- a/drivers/cxl/core/region.c > > +++ b/drivers/cxl/core/region.c > > @@ -495,6 +495,11 @@ static int set_interleave_ways(struct cxl_region *cxlr, int val) > > int save, rc; > > u8 iw; > > > > + if (cxlr->mode == CXL_PARTMODE_DYNAMIC_RAM && val != 1) { > > + dev_dbg(&cxlr->dev, "Interleaving and DCD not supported\n"); > > + return -EINVAL; > > perhaps sync this msg with devm_cxl_add_dax_region() messaging, > which emits: "Interleaving DC not supported" > Synced, and from your feedback below, the interleave_ways != 1 check was moved from devm_cxl_add_dax_region() to construct_region(). And now both read "Interleaving DC not supported". > > snip > > > @@ -2737,6 +2765,8 @@ void kill_regions(struct cxl_root_decoder *cxlrd) > > * @cxlrd: root decoder > > * @id: memregion id to create, or memregion_free() on failure > > * @mode: mode for the endpoint decoders of this region > > + * @shareable: dynamic region: its partitions must be shareable > > + * @read_only: dynamic region: its partitions must be read-only > > * @type: select whether this is an expander or accelerator (type-2 or type-3) > > * > > * This is the second step of region initialization. Regions exist within an > > @@ -2748,7 +2778,8 @@ void kill_regions(struct cxl_root_decoder *cxlrd) > > static struct cxl_region *devm_cxl_add_region(struct cxl_root_decoder *cxlrd, > > int id, > > enum cxl_partition_mode mode, > > - enum cxl_decoder_type type) > > + enum cxl_decoder_type type, > > + bool shareable, bool read_only) > > match kernel-doc to this order of params. > oops, fixed! > snip > > > diff --git a/drivers/cxl/core/region_dax.c b/drivers/cxl/core/region_dax.c > > index de04f78f6ad8..47c9c52a3902 100644 > > --- a/drivers/cxl/core/region_dax.c > > +++ b/drivers/cxl/core/region_dax.c > > @@ -84,6 +84,12 @@ int devm_cxl_add_dax_region(struct cxl_region *cxlr) > > struct device *dev; > > int rc; > > > > + if (cxlr->mode == CXL_PARTMODE_DYNAMIC_RAM && > > + cxlr->params.interleave_ways != 1) { > > + dev_dbg(&cxlr->dev, "Interleaving DC not supported\n"); > > + return -EINVAL; > > + } > > + > > Not sure probe is the right place to refuse an interleaved auto region? > Look at if refusing for ways != 1 for a DC partition in construct_region(). > IIUC that would refuse before anything is assembled. > Agreed, v2 now checks interleave_ways != 1 in construct_region() instead of here. Thanks, Anisa > snip to end > > -- Alison >