[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250827175247.83322-6-shivankg@amd.com>
Date: Wed, 27 Aug 2025 17:52:45 +0000
From: Shivank Garg <shivankg@....com>
To: <willy@...radead.org>, <akpm@...ux-foundation.org>, <david@...hat.com>,
<pbonzini@...hat.com>, <shuah@...nel.org>, <seanjc@...gle.com>,
<vbabka@...e.cz>
CC: <brauner@...nel.org>, <viro@...iv.linux.org.uk>, <dsterba@...e.com>,
<xiang@...nel.org>, <chao@...nel.org>, <jaegeuk@...nel.org>, <clm@...com>,
<josef@...icpanda.com>, <kent.overstreet@...ux.dev>, <zbestahu@...il.com>,
<jefflexu@...ux.alibaba.com>, <dhavale@...gle.com>, <lihongbo22@...wei.com>,
<lorenzo.stoakes@...cle.com>, <Liam.Howlett@...cle.com>, <rppt@...nel.org>,
<surenb@...gle.com>, <mhocko@...e.com>, <ziy@...dia.com>,
<matthew.brost@...el.com>, <joshua.hahnjy@...il.com>, <rakie.kim@...com>,
<byungchul@...com>, <gourry@...rry.net>, <ying.huang@...ux.alibaba.com>,
<apopple@...dia.com>, <tabba@...gle.com>, <ackerleytng@...gle.com>,
<shivankg@....com>, <paul@...l-moore.com>, <jmorris@...ei.org>,
<serge@...lyn.com>, <pvorel@...e.cz>, <bfoster@...hat.com>,
<vannapurve@...gle.com>, <chao.gao@...el.com>, <bharata@....com>,
<nikunj@....com>, <michael.day@....com>, <shdhiman@....com>,
<yan.y.zhao@...el.com>, <Neeraj.Upadhyay@....com>, <thomas.lendacky@....com>,
<michael.roth@....com>, <aik@....com>, <jgg@...dia.com>,
<kalyazin@...zon.com>, <peterx@...hat.com>, <jack@...e.cz>,
<hch@...radead.org>, <cgzones@...glemail.com>, <ira.weiny@...el.com>,
<rientjes@...gle.com>, <roypat@...zon.co.uk>, <chao.p.peng@...el.com>,
<amit@...radead.org>, <ddutile@...hat.com>, <dan.j.williams@...el.com>,
<ashish.kalra@....com>, <gshan@...hat.com>, <jgowans@...zon.com>,
<pankaj.gupta@....com>, <papaluri@....com>, <yuzhao@...gle.com>,
<suzuki.poulose@....com>, <quic_eberman@...cinc.com>,
<linux-bcachefs@...r.kernel.org>, <linux-btrfs@...r.kernel.org>,
<linux-erofs@...ts.ozlabs.org>, <linux-f2fs-devel@...ts.sourceforge.net>,
<linux-fsdevel@...r.kernel.org>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>, <linux-security-module@...r.kernel.org>,
<kvm@...r.kernel.org>, <linux-kselftest@...r.kernel.org>,
<linux-coco@...ts.linux.dev>
Subject: [PATCH kvm-next V11 3/7] mm/mempolicy: Export memory policy symbols
KVM guest_memfd wants to implement support for NUMA policies just like
shmem already does using the shared policy infrastructure. As
guest_memfd currently resides in KVM module code, we have to export the
relevant symbols.
In the future, guest_memfd might be moved to core-mm, at which point the
symbols no longer would have to be exported. When/if that happens is
still unclear.
Acked-by: David Hildenbrand <david@...hat.com>
Acked-by: Vlastimil Babka <vbabka@...e.cz>
Signed-off-by: Shivank Garg <shivankg@....com>
---
mm/mempolicy.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index eb83cff7db8c..3d797d47a040 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -354,6 +354,7 @@ struct mempolicy *get_task_policy(struct task_struct *p)
return &default_policy;
}
+EXPORT_SYMBOL_FOR_MODULES(get_task_policy, "kvm");
static const struct mempolicy_operations {
int (*create)(struct mempolicy *pol, const nodemask_t *nodes);
@@ -487,6 +488,7 @@ void __mpol_put(struct mempolicy *pol)
return;
kmem_cache_free(policy_cache, pol);
}
+EXPORT_SYMBOL_FOR_MODULES(__mpol_put, "kvm");
static void mpol_rebind_default(struct mempolicy *pol, const nodemask_t *nodes)
{
@@ -2885,6 +2887,7 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
read_unlock(&sp->lock);
return pol;
}
+EXPORT_SYMBOL_FOR_MODULES(mpol_shared_policy_lookup, "kvm");
static void sp_free(struct sp_node *n)
{
@@ -3170,6 +3173,7 @@ void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol)
mpol_put(mpol); /* drop our incoming ref on sb mpol */
}
}
+EXPORT_SYMBOL_FOR_MODULES(mpol_shared_policy_init, "kvm");
int mpol_set_shared_policy(struct shared_policy *sp,
struct vm_area_struct *vma, struct mempolicy *pol)
@@ -3188,6 +3192,7 @@ int mpol_set_shared_policy(struct shared_policy *sp,
sp_free(new);
return err;
}
+EXPORT_SYMBOL_FOR_MODULES(mpol_set_shared_policy, "kvm");
/* Free a backing policy store on inode delete. */
void mpol_free_shared_policy(struct shared_policy *sp)
@@ -3206,6 +3211,7 @@ void mpol_free_shared_policy(struct shared_policy *sp)
}
write_unlock(&sp->lock);
}
+EXPORT_SYMBOL_FOR_MODULES(mpol_free_shared_policy, "kvm");
#ifdef CONFIG_NUMA_BALANCING
static int __initdata numabalancing_override;
--
2.43.0
Powered by blists - more mailing lists