Re: 答复: [????] Re: [PATCH] KVM: irqchip: allocate routing entries in chunks

From: Yanfei Xu

Date: Thu Sep 10 2026 - 10:54:10 EST




On 2026/9/10 11:26, Li,Rongqing wrote:


Please look at Yanfei's series and help come to an agreement on how best to fix
this. I am trying to get to Yanfei's series, and normally would take a close look
at both, but I am extremely short on cycles at the moment.

https://lore.kernel.org/all/20260525035242.107264-1-yanfei.xu@bytedance.
com

Hi Sean,

Thanks for pointing me to Yanfei's series. I agree that both approaches
aim to reduce the allocation overhead in KVM_SET_GSI_ROUTING().

One main concern with using kvalloc() for the entire routing entry array is
that, under severe memory fragmentation, it may fall back to vmalloc().
The vmalloc() path can have relatively high and less predictable overhead,
especially when routing tables are updated frequently when guest OS is
running irqbalance.
Hi Rongqing,

You are right, fallbacking to vmalloc is not friendly to frequently
updating senarios. I assume Sean also noticed that and suggested to
introduce the patch2 at v2. It could avoid to allocate memory when
the rounded size of total entries is same with previous cached
allocation. I think irqblance could benefit from patch2.

Regards,
Yanfei


Thanks
[Li,Rongqing]