Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Shivank Garg <shivankg@amd.com>
Tested-by: Ashish Kalra <ashish.kalra@amd.com>
Link: https://lore.kernel.org/r/20250827175247.83322-6-shivankg@amd.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

authored by

Shivank Garg and committed by
Sean Christopherson
f634f108 16a542e2

+6
+6
mm/mempolicy.c
··· 354 354 355 355 return &default_policy; 356 356 } 357 + EXPORT_SYMBOL_FOR_MODULES(get_task_policy, "kvm"); 357 358 358 359 static const struct mempolicy_operations { 359 360 int (*create)(struct mempolicy *pol, const nodemask_t *nodes); ··· 488 487 return; 489 488 kmem_cache_free(policy_cache, pol); 490 489 } 490 + EXPORT_SYMBOL_FOR_MODULES(__mpol_put, "kvm"); 491 491 492 492 static void mpol_rebind_default(struct mempolicy *pol, const nodemask_t *nodes) 493 493 { ··· 2887 2885 read_unlock(&sp->lock); 2888 2886 return pol; 2889 2887 } 2888 + EXPORT_SYMBOL_FOR_MODULES(mpol_shared_policy_lookup, "kvm"); 2890 2889 2891 2890 static void sp_free(struct sp_node *n) 2892 2891 { ··· 3173 3170 mpol_put(mpol); /* drop our incoming ref on sb mpol */ 3174 3171 } 3175 3172 } 3173 + EXPORT_SYMBOL_FOR_MODULES(mpol_shared_policy_init, "kvm"); 3176 3174 3177 3175 int mpol_set_shared_policy(struct shared_policy *sp, 3178 3176 struct vm_area_struct *vma, struct mempolicy *pol) ··· 3192 3188 sp_free(new); 3193 3189 return err; 3194 3190 } 3191 + EXPORT_SYMBOL_FOR_MODULES(mpol_set_shared_policy, "kvm"); 3195 3192 3196 3193 /* Free a backing policy store on inode delete. */ 3197 3194 void mpol_free_shared_policy(struct shared_policy *sp) ··· 3211 3206 } 3212 3207 write_unlock(&sp->lock); 3213 3208 } 3209 + EXPORT_SYMBOL_FOR_MODULES(mpol_free_shared_policy, "kvm"); 3214 3210 3215 3211 #ifdef CONFIG_NUMA_BALANCING 3216 3212 static int __initdata numabalancing_override;