[RFC PATCH 7/8] dax/kmem: add the ltpin opt-in (CAP_LTPIN) for private nodes

Gregory Price <[email protected]>
Newsgroups org.kernel.vger.linux-cxl,dev.linux.lists.nvdimm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Add "ltpin" opt-in setting for NODE_PRIVATE_CAP_LTPIN so long-term GUP
pins (FOLL_LONGTERM) may target the node's folios.

Long-term pins block migration and hot-unplug indefinitely, so they are
refused on a private node unless it explicitly opts in.

Signed-off-by: Gregory Price <[email protected]>
---
 drivers/dax/kmem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c
index 1cb3384c003e3..c33dac5939edd 100644
--- a/drivers/dax/kmem.c
+++ b/drivers/dax/kmem.c
@@ -633,6 +633,7 @@ KMEM_PRIVATE_CAP_ATTR(user_numa, NODE_PRIVATE_CAP_USER_NUMA);
 KMEM_PRIVATE_CAP_ATTR(hotunplug, NODE_PRIVATE_CAP_HOTUNPLUG);
 KMEM_PRIVATE_CAP_ATTR(demotion, NODE_PRIVATE_CAP_DEMOTION);
 KMEM_PRIVATE_CAP_ATTR(numa_balancing, NODE_PRIVATE_CAP_NUMA_BALANCING);
+KMEM_PRIVATE_CAP_ATTR(ltpin, NODE_PRIVATE_CAP_LTPIN);
 
 /* Per-service opt-ins. Visibility toggled by 'private' control */
 static struct attribute *dax_kmem_private_attrs[] = {
@@ -641,6 +642,7 @@ static struct attribute *dax_kmem_private_attrs[] = {
 	&dev_attr_hotunplug.attr,
 	&dev_attr_demotion.attr,
 	&dev_attr_numa_balancing.attr,
+	&dev_attr_ltpin.attr,
 	NULL,
 };
 static const struct attribute_group dax_kmem_private_group = {
-- 
2.53.0-Meta
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.