From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (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 A507C3B42D0 for ; Thu, 9 Jul 2026 22:08:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783634933; cv=none; b=R5rZQM3Y/JSeekxaVdzdXPorLPV8wGDSoGNwKbeNGCXKYsckBm/+pRe+mEoXPkHsrSf/7BXGJIayu9nt/4KvdGmazdQtjBMUfIfhpFAqKn3voqQWPW1GmHuRlCPW6VhU/gSpkBVJr1xUcdNqa338reYEH8VXyFcnTnpVXxCOSFg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783634933; c=relaxed/simple; bh=6RBF0jp09O3guB5Q86RDVYGXWp7JXTcPagL5/X5HeO0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ucA83JSM47m5nKXm7VCS8egKpApjX44H7RYJQA/65E1z8XYI0zU2oXxHykWapxLsKsHFoQRUpxEX8QTD/YUYg7QWtFRyeSaIwkjqCRXfi10G+6rVjj1HEUrPtSTArMvMqBcEdYeDahV5k+Ok2EpHQDxEt7/R122qwQgzVN991VE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=DWqIjK+w; arc=none smtp.client-ip=209.85.219.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="DWqIjK+w" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-8ef1dc934d1so3560696d6.0 for ; Thu, 09 Jul 2026 15:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1783634931; x=1784239731; 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=y5hy/40qOWrDje+rO1HwX24k6GcjiBFx+d8whX1kHrQ=; b=DWqIjK+wQP2S9P9eDvz+eifCekOeL5ICmp8XDSO63D9iIeJ9bpo31x+iZ4b9X9mtJm qw91+Xp9U0JYB4q+7pZprbMLRJhqqvcuJzoeCzrkLF8T6FkhJ2sULWx04ZQWrYt+QzSQ IGTG2hxZjb8YFa6rBwoC2yILH/XaS1Rvd/OWfhMj5pn8cWfKAKJJA9JciEuaTEDeUGBj HCd/FoUkjV/qVzg52zrPYFM2b3JEkp2xBOPu15zpY9VMz2qPDG5xPaDDhcpdIX9NYxNM 0jfW455Ec5bew/JtVTztslE2bH7jkqL7XCli0x819iGHCFfxJ5EEYcmFydhwLVUAsnbq 3YFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783634931; x=1784239731; 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=y5hy/40qOWrDje+rO1HwX24k6GcjiBFx+d8whX1kHrQ=; b=hx29tX0TkGfsYOk4MDsBomYwZPAZYTYPj8uZx05rtRRyPsb4xWRv44oKbLSN8+YC5m FAVdTPIQ0M9pTBIV01JWEG2WRc7hSz06sPlxxPteZIVr7L0W3Q5r48ov9z/GU8s6MG48 iU0lGjrT5E91/ImdIUMIxGyewMw1zyimETuXUw9AXd5HQOt5PStC6w95dc5kzEVyJlI8 Ulg13M9nH51Sqa1IPcRMzbXtgT3B/oomRMTwN21rH8hnK32k1GEYhVdZ+NaXgvkc8qRd SccS8YO+YcsOygvpyapyLEKr2p6VUF1l1vgZTv8eFSqhZhvbcZvUlp9Jup3/ZMhrOw+S Ovqw== X-Forwarded-Encrypted: i=1; AHgh+RoiC7+HZ2MeyZ4y+62ocxwIr6QKEjHXgJk4OBX/ua4mucDV/NV8UuI5Wl1y6l1wo0TMAOfFAeq2HOQ83nQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxOvlaXJHkvFMk2irpzValyLswNbxgzlRkbmfCk/6arYYO9WV13 Y0VZX8doRj1GZDGAVQlAvnpPD0ZXK+TVk9YJ0/04qNQy4o2B3pt5+lgtDPqHaDQ9k0U= X-Gm-Gg: AfdE7cl5LsHmeI5AvBQMtMavL+kBZ2RLJLXAPKTBNm54sQmbRtG7NRp7Y9jg63Hzr7K 6e2mpjdvdbTpaRriy+3LvRkTwp+eMjCkpzaP+IBaclqEECj9EdoVzqiselh2D5U9VJ71NZmga8L trseHfWgoYaeFziPUJNCseywBa57quekejyu8/+bFVcgwB8P4aOCblXDTNOk16iWmc9IxKi9Y2+ pNg+pCLXZgd+uci3q19kCKWcLl7p56BHcUs0nt4yy8SSeNa9F8gu6W2zpxEieBaVA/ciGK6Ar5w EBOOuD1vkPULXQiI713RTponxdes9JzkjBQtO5XSY0y8eU/h1ECBsUZuHZt+r1Ck5QVmCboLYwU yPyCnYtoCRT4IIbT20m5ygx++YPG8tGEoa8wBbFDKHhF0g09O/OwOeuGSXivysfrSR8vMw/yFwJ B8egm6Z9UGqREMuA6bWmeIju1bd7hi5SBsvT73Ub6SG98XrsJ7i6fkulEKJN1l9yBwkMZ6 X-Received: by 2002:a05:6214:1306:b0:8ef:1840:2bd8 with SMTP id 6a1803df08f44-9024204ca5cmr14984856d6.33.1783634930620; Thu, 09 Jul 2026 15:08:50 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8ffd87cacb8sm26797256d6.49.2026.07.09.15.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 15:08:49 -0700 (PDT) Date: Thu, 9 Jul 2026 18:08:45 -0400 From: Gregory Price To: "Dan Williams (nvidia)" Cc: linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, driver-core@lists.linux.dev, linux-kselftest@vger.kernel.org, kernel-team@meta.com, david@kernel.org, osalvador@suse.de, gregkh@linuxfoundation.org, rafael@kernel.org, dakr@kernel.org, vishal.l.verma@intel.com, dave.jiang@intel.com, alison.schofield@intel.com, akpm@linux-foundation.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, shuah@kernel.org, iweiny@kernel.org, Smita.KoralahalliChannabasappa@amd.com, apopple@nvidia.com Subject: Re: [PATCH v6 07/10] dax: plumb hotplug online_type through dax Message-ID: References: <20260630211842.2252800-1-gourry@gourry.net> <20260630211842.2252800-8-gourry@gourry.net> <6a5016bf71df4_3b7ee5100b3@djbw-dev.notmuch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a5016bf71df4_3b7ee5100b3@djbw-dev.notmuch> On Thu, Jul 09, 2026 at 02:46:39PM -0700, Dan Williams (nvidia) wrote: > Gregory Price wrote: > > There is no way for drivers leveraging dax_kmem to plumb through a > > preferred auto-online policy - the system default policy is forced. > > > > Add 'enum mmop' field to DAX device creation path to allow drivers > > to specify an auto-online policy when using the kmem driver. > > > > Capturing the system default would otherwise break the ABI, because > > the system default can change - but we would be statically assigning > > the value at device creation time. > > > > To resolve this we add DAX_ONLINE_DEFAULT, which defaults devices to > > the current behavior, while providing a clean way to override it. > > > > No behavioural change for existing callers (still the system default). > > So I know you have some future usage for this ability, but it is not > present in this set. The only piece that *is* used is that the > online-type from the new sysfs interface gets plumbed through to > __add_memory_driver_managed(). > Correct. I didn't want to cross three subsystems in one go, I do intend to follow this up with at least a CXL build option to override the global hotplug policy by plumbing it through to the existing cxl auto-probe process. Some of the accelerator stuff is still a bit up in the air but the base driver can still benefit from this as well. > Are these touches: > > > drivers/dax/cxl.c | 1 + > > drivers/dax/hmem/hmem.c | 1 + > > drivers/dax/pmem.c | 1 + > > ...premature until the first user arrives that with the background story > about how it knows to set the policy? > This was more a matter of having the DEFAULT set consistently across the dax driver variant probe() functions to make the behavior explicit. I didn't want an un-set value bug to creep in here somehow. Happy to drop them if you think that's unneeded. > If DAX_ONLINE_DEFAULT is a sentinel for "default" should > DAX_KMEM_UNPLUGGED be a different sentinel than (-1)? > They don't actually run into each other. DAX_ONLINE_DEFAULT is overwritten at probe time with the system default policy, so `dax/state` can never perceive it (even if the values are the same). But this is visually confusing i suppose, so I'll just swap it for -2. > Feel free to add: > > Reviewed-by: Dan Williams > > ...to this and the previous patches when that is fixed up. Thank you!