* [PATCH] x86/hyperv: Consider NUMA affinity when allocating memory for per-CPU vmsa
@ 2024-04-15 8:57 Li RongQing
2024-04-22 22:28 ` Wei Liu
0 siblings, 1 reply; 2+ messages in thread
From: Li RongQing @ 2024-04-15 8:57 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, tglx, mingo, bp, x86, linux-hyperv
Cc: Li RongQing
per-CPU vmsa are dominantly accessed from their own local CPUs,
so allocate them node-local to improve performance.
And reorganized variables to be reverse christmas tree order
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
arch/x86/hyperv/ivm.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c
index 768d73d..5bc2430 100644
--- a/arch/x86/hyperv/ivm.c
+++ b/arch/x86/hyperv/ivm.c
@@ -291,16 +291,18 @@ static void snp_cleanup_vmsa(struct sev_es_save_area *vmsa)
int hv_snp_boot_ap(u32 cpu, unsigned long start_ip)
{
- struct sev_es_save_area *vmsa = (struct sev_es_save_area *)
- __get_free_page(GFP_KERNEL | __GFP_ZERO);
+ struct hv_enable_vp_vtl *start_vp_input;
struct sev_es_save_area *cur_vmsa;
+ struct sev_es_save_area *vmsa;
struct desc_ptr gdtr;
- u64 ret, retry = 5;
- struct hv_enable_vp_vtl *start_vp_input;
unsigned long flags;
+ u64 ret, retry = 5;
+ struct page *p;
- if (!vmsa)
+ p = alloc_pages_node(cpu_to_node(cpu), GFP_KERNEL | __GFP_ZERO, 0);
+ if (!p)
return -ENOMEM;
+ vmsa = (struct sev_es_save_area *)page_address(p);
native_store_gdt(&gdtr);
--
2.9.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/hyperv: Consider NUMA affinity when allocating memory for per-CPU vmsa
2024-04-15 8:57 [PATCH] x86/hyperv: Consider NUMA affinity when allocating memory for per-CPU vmsa Li RongQing
@ 2024-04-22 22:28 ` Wei Liu
0 siblings, 0 replies; 2+ messages in thread
From: Wei Liu @ 2024-04-22 22:28 UTC (permalink / raw)
To: Li RongQing
Cc: kys, haiyangz, wei.liu, decui, tglx, mingo, bp, x86, linux-hyperv
On Mon, Apr 15, 2024 at 04:57:12PM +0800, Li RongQing wrote:
> per-CPU vmsa are dominantly accessed from their own local CPUs,
> so allocate them node-local to improve performance.
>
> And reorganized variables to be reverse christmas tree order
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
Applied. Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-22 22:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-15 8:57 [PATCH] x86/hyperv: Consider NUMA affinity when allocating memory for per-CPU vmsa Li RongQing
2024-04-22 22:28 ` Wei Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox