APIC errors resulting from too early set_timer()
Keir,
in c/s 17422 you moved the alloc_pdata scheduler callout into the CPU_UP_PREPARE notifier handler, but the credit scheduler uses set_timer() for a timer bound to the to be brought up CPU from sched_alloc_pdata(), with the resulting send_IPI_mask() targeting the not yet started CPU, thus (on my AMD systems at least) resulting in APIC send accept errors.
I see three possible fixes, neither really nice imo: Either a second callout (from CPU_ONLINE), or a credit scheduler specific notifier (handling CPU_ONLINE), or binding the timer initially to the current CPU, and migrate it to the target CPU as soon as that one's online.
Do you favor any one of these, or do you see any alternative?
Jan
Quoted 7 lines · Jan Beulich
in c/s 17422 you moved the
alloc_pdatascheduler callout into theCPU_UP_PREPAREnotifier handler, but the credit scheduler usesset_timer()for a timer bound to the to be brought up CPU fromsched_alloc_pdata(), with the resultingsend_IPI_mask()targeting the not yet started CPU, thus (on my AMD systems at least) resulting in APIC send accept errors.
Quoted 6 lines
I see three possible fixes, neither really nice imo: Either a second callout (from
CPU_ONLINE), or a credit scheduler specific notifier (handlingCPU_ONLINE), or binding the timer initially to the current CPU, and migrate it to the target CPU as soon as that one's online.Do you favor any one of these, or do you see any alternative?
The IPI is needless since the CPU will check for pending softirqs when it is brought up, from its idle loop or before entering guest context for the first time.
I suggest that we mask the given cpumap against cpu_online_map, and smp_processor_id() while we're at it, in arch/x86/smp.c:smp_send_event_check_mask(). If you agree that this makes sense I will make the patch myself.
Thanks,
Keir
Quoted 5 lines
Quoted 1 line
Quoted 1 line · Keir Fraser
I suggest that we mask the given cpumap against
cpu_online_map, andsmp_processor_id()while we're at it, in arch/x86/smp.c:smp_send_event_check_mask(). If you agree that this makes sense I will make the patch myself.
Yes, this sounds appropriate to me.
Thanks, Jan
Quoted 7 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · Keir Fraser
I suggest that we mask the given cpumap against
cpu_online_map, andsmp_processor_id()while we're at it, in arch/x86/smp.c:smp_send_event_check_mask(). If you agree that this makes sense I will make the patch myself.Yes, this sounds appropriate to me.
xen-unstable:21690, although I ended up pushing the logic into the send_IPI_mask variants.
-- Keir
Quoted 2 lines
Thanks, Jan