From: Shivank Garg <shivankg@amd.com>
To: <akpm@linux-foundation.org>, <willy@infradead.org>,
<pbonzini@redhat.com>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
<linux-coco@lists.linux.dev>, <chao.gao@intel.com>,
<seanjc@google.com>, <ackerleytng@google.com>, <david@redhat.com>,
<vbabka@suse.cz>, <bharata@amd.com>, <nikunj@amd.com>,
<michael.day@amd.com>, <Neeraj.Upadhyay@amd.com>,
<thomas.lendacky@amd.com>, <michael.roth@amd.com>,
<shivankg@amd.com>, <tabba@google.com>
Subject: [PATCH v6 2/5] mm/mempolicy: export memory policy symbols
Date: Wed, 26 Feb 2025 08:25:46 +0000 [thread overview]
Message-ID: <20250226082549.6034-3-shivankg@amd.com> (raw)
In-Reply-To: <20250226082549.6034-1-shivankg@amd.com>
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>
Signed-off-by: Shivank Garg <shivankg@amd.com>
---
mm/mempolicy.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index bbaadbeeb291..d9c5dcdadcd0 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -214,6 +214,7 @@ struct mempolicy *get_task_policy(struct task_struct *p)
return &default_policy;
}
+EXPORT_SYMBOL_GPL(get_task_policy);
static const struct mempolicy_operations {
int (*create)(struct mempolicy *pol, const nodemask_t *nodes);
@@ -347,6 +348,7 @@ void __mpol_put(struct mempolicy *pol)
return;
kmem_cache_free(policy_cache, pol);
}
+EXPORT_SYMBOL_GPL(__mpol_put);
static void mpol_rebind_default(struct mempolicy *pol, const nodemask_t *nodes)
{
@@ -2736,6 +2738,7 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
read_unlock(&sp->lock);
return pol;
}
+EXPORT_SYMBOL_GPL(mpol_shared_policy_lookup);
static void sp_free(struct sp_node *n)
{
@@ -3021,6 +3024,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_GPL(mpol_shared_policy_init);
int mpol_set_shared_policy(struct shared_policy *sp,
struct vm_area_struct *vma, struct mempolicy *pol)
@@ -3039,6 +3043,7 @@ int mpol_set_shared_policy(struct shared_policy *sp,
sp_free(new);
return err;
}
+EXPORT_SYMBOL_GPL(mpol_set_shared_policy);
/* Free a backing policy store on inode delete. */
void mpol_free_shared_policy(struct shared_policy *sp)
@@ -3057,6 +3062,7 @@ void mpol_free_shared_policy(struct shared_policy *sp)
}
write_unlock(&sp->lock);
}
+EXPORT_SYMBOL_GPL(mpol_free_shared_policy);
#ifdef CONFIG_NUMA_BALANCING
static int __initdata numabalancing_override;
--
2.34.1
next prev parent reply other threads:[~2025-02-26 8:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 8:25 [PATCH v6 0/5] Add NUMA mempolicy support for KVM guest-memfd Shivank Garg
2025-02-26 8:25 ` [PATCH v6 1/5] mm/filemap: add mempolicy support to the filemap layer Shivank Garg
2025-02-28 14:17 ` Vlastimil Babka
2025-02-28 17:51 ` Ackerley Tng
2025-03-05 6:10 ` Shivank Garg
2025-02-26 8:25 ` Shivank Garg [this message]
2025-02-26 13:59 ` [PATCH v6 2/5] mm/mempolicy: export memory policy symbols Vlastimil Babka
2025-02-26 8:25 ` [PATCH v6 3/5] KVM: guest_memfd: Pass file pointer instead of inode pointer Shivank Garg
2025-02-26 8:25 ` [PATCH v6 4/5] KVM: guest_memfd: Enforce NUMA mempolicy using shared policy Shivank Garg
2025-02-28 17:25 ` Ackerley Tng
2025-03-03 8:58 ` Vlastimil Babka
2025-03-04 0:19 ` Ackerley Tng
2025-03-04 15:30 ` Sean Christopherson
2025-03-04 15:51 ` David Hildenbrand
2025-03-04 16:59 ` Sean Christopherson
2025-03-05 6:02 ` Shivank Garg
2025-02-26 8:25 ` [PATCH v6 5/5] KVM: guest_memfd: selftests: add tests for mmap and NUMA policy support Shivank Garg
2025-03-09 1:09 ` [PATCH v6 0/5] Add NUMA mempolicy support for KVM guest-memfd Vishal Annapurve
2025-03-09 18:52 ` Vishal Annapurve
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=20250226082549.6034-3-shivankg@amd.com \
--to=shivankg@amd.com \
--cc=Neeraj.Upadhyay@amd.com \
--cc=ackerleytng@google.com \
--cc=akpm@linux-foundation.org \
--cc=bharata@amd.com \
--cc=chao.gao@intel.com \
--cc=david@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=michael.day@amd.com \
--cc=michael.roth@amd.com \
--cc=nikunj@amd.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=tabba@google.com \
--cc=thomas.lendacky@amd.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.