linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Gregory Price <gourry@gourry.net>,
	linux-mm@kvack.org, vishal.l.verma@intel.com,
	dave.jiang@intel.com, akpm@linux-foundation.org,
	osalvador@suse.de
Cc: dan.j.williams@intel.com, ljs@kernel.org,
	Liam.Howlett@oracle.com, vbabka@kernel.org, rppt@kernel.org,
	surenb@google.com, mhocko@suse.com, linux-kernel@vger.kernel.org,
	nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH 6/8] dax: plumb hotplug online_type through dax
Date: Mon, 13 Apr 2026 17:23:11 +0200	[thread overview]
Message-ID: <3a4166db-fd04-4a9a-a25a-a7b6d149b97f@kernel.org> (raw)
In-Reply-To: <20260321150404.3288786-7-gourry@gourry.net>

On 3/21/26 16:04, 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.
> 
> Current callers initialize online_type to mhp_get_default_online_type()
> to retain backward compatibility and to make explicit to the drivers
> what is actually happening underneath.
> 
> No functional changes to existing callers.
> 
> Cc:David Hildenbrand <david@kernel.org>
> Signed-off-by: Gregory Price <gourry@gourry.net>
> ---

[...]

>  
>  	return PTR_ERR_OR_ZERO(devm_create_dev_dax(&data));
> diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c
> index 798f389df992..d4c34b2e3766 100644
> --- a/drivers/dax/kmem.c
> +++ b/drivers/dax/kmem.c
> @@ -16,6 +16,11 @@
>  #include "dax-private.h"
>  #include "bus.h"
>  
> +/* Internal function exported only to kmem module */
> +extern int __add_memory_driver_managed(int nid, u64 start, u64 size,
> +				       const char *resource_name,
> +				       mhp_t mhp_flags, enum mmop online_type);

This should just go to the memory_hotplug.h header.

The EXPORT will make sure that only supported modules can use this.

> +
>  /* Memory resource name used for add_memory_driver_managed(). */
>  static const char *kmem_name;
>  /* Set if any memory will remain added when the driver will be unloaded. */
> @@ -49,6 +54,7 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
>  	struct dax_kmem_data *data;
>  	struct memory_dev_type *mtype;
>  	int i, rc, mapped = 0;
> +	enum mmop online_type;
>  	mhp_t mhp_flags;
>  	int numa_node;
>  	int adist = MEMTIER_DEFAULT_LOWTIER_ADISTANCE;
> @@ -111,6 +117,8 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
>  		goto err_reg_mgid;
>  	data->mgid = rc;
>  
> +	online_type = dev_dax->online_type;

Do you need the temporary variable?



-- 
Cheers,

David


  reply	other threads:[~2026-04-13 15:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21 15:03 [PATCH 0/8] dax/kmem: atomic whole-device hotplug via sysfs Gregory Price
2026-03-21 15:03 ` [PATCH 1/8] mm/memory-tiers: consolidate memory type dedup into mt_get_memory_type() Gregory Price
2026-04-13 15:06   ` David Hildenbrand (Arm)
2026-03-21 15:03 ` [PATCH 2/8] mm/memory: add memory_block_align_range() helper Gregory Price
2026-04-13 15:12   ` David Hildenbrand (Arm)
2026-03-21 15:03 ` [PATCH 3/8] mm/memory_hotplug: pass online_type to online_memory_block() via arg Gregory Price
2026-03-21 15:04 ` [PATCH 4/8] mm/memory_hotplug: export mhp_get_default_online_type Gregory Price
2026-04-13 15:18   ` David Hildenbrand (Arm)
2026-03-21 15:04 ` [PATCH 5/8] mm/memory_hotplug: add __add_memory_driver_managed() with online_type arg Gregory Price
2026-04-13 15:21   ` David Hildenbrand (Arm)
2026-03-21 15:04 ` [PATCH 6/8] dax: plumb hotplug online_type through dax Gregory Price
2026-04-13 15:23   ` David Hildenbrand (Arm) [this message]
2026-03-21 15:04 ` [PATCH 7/8] dax/kmem: extract hotplug/hotremove helper functions Gregory Price
2026-03-21 15:04 ` [PATCH 8/8] dax/kmem: add sysfs interface for atomic whole-device hotplug Gregory Price
2026-03-21 17:40 ` [PATCH 0/8] dax/kmem: atomic whole-device hotplug via sysfs Andrew Morton
2026-03-21 20:26   ` Gregory Price
2026-04-13 15:47     ` David Hildenbrand (Arm)
2026-04-13 14:49 ` David Hildenbrand (Arm)
2026-04-13 14:53   ` David Hildenbrand (Arm)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a4166db-fd04-4a9a-a25a-a7b6d149b97f@kernel.org \
    --to=david@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=gourry@gourry.net \
    --cc=kernel-team@meta.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=osalvador@suse.de \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox