RE: Any standard kernel API to dynamically allocate/free per-cpu vectors on x86?

From: Dexuan Cui
Date: Thu Apr 05 2018 - 13:52:54 EST


> From: Thomas Gleixner
> > Can you please give a little more guidance? e.g. is there any similar driver,
> > any pointer to the required APIs, etc.
> > Your quick pointer would help a lot!
> >
> > BTW, so far, Hyper-V doesn't support CPU hotplug, but it supports dynamic
> > CPU online/offline . I guess I must also consider CPU online/offline here.
>
> Yes, that's all covered. The trick is to use the affinity managed interrupt
> facility for these per cpu interrupts and then the cpu online/offline case
> including physical(virtual) hotplug is dealt with automagically. You
> request the irqs once with request_irq() and they stay requested for the
> life time. No action required on the driver side for CPU online/offline
> events vs. the interrupt.

Thanks for the guidance!

> Find below a hastily cobbled together minimal starting point. You need to
> fill in the gaps by looking at similar implementations: ioapic for some
> stuff and the way simpler UV code in x86/platform/uv/uv_irq.c for most of
> it.
>
> Hope that helps. If you have questions or run into limitations, feel free
> to ask.

This definitely helps a lot!!! I didn't expect you would write a lot of sample
Code here! I think I have a very good starting point now. :-)

Thanks again!

Thanks,
-- Dexuan