Sorry my mistake. I got confused with the online state ordering.I think we can come here when hotplug thread is scheduled during online, butI don't see how that is possible. Because the cpuhp threads run during the
mask is not yet updated. Probably can add it with this comment as well.
CPU onlining process, the boot thread for the CPU coming online would have
already updated the mask.
I was trying to keep the ideas consistent. The requirement of core_pickAnother unrelated, but related note :-)Then don't keep the core_pick set then. If you don't send it IPI and if
Besides this, I think we need to retain on more change from the previous
patch. We would need to make core_pick_seq per sibling instead of per
core. Having it per core might lead to unfairness. For eg: When a cpu
sees that its sibling's core_pick is the one which is already running, it
will not send IPI. but core_pick remains set and core->core_pick_seq is
incremented. Now if the sibling is preempted due to a high priority task
core_pick is already running, then NULL it already. I don't know why we add
to more corner cases by making assumptions. We have enough open issues that
are not hotplug related. Here's my suggestion :
1. Keep the ideas consistent, forget about the exact code currently written
and just understand the pick_seq is for siblings knowing that something was
picked for the whole core. So if their pick_seq != sched_seq, then they have
to pick what was selected.
2. If core_pick should be NULL, then NULL it in some path. If you keep some
core_pick and you increment pick_seq, then you are automatically asking the
sibling to pick that task up then next time it enters schedule(). See if [1]
will work?
Note that, we have added logic in this patch that does a full selection if
rq->core_pick == NULL.
Agree. Sorry for the confusion, my intention was to not have the logic inor its time slice expired, it enters schedule. But it goes to fast path andThat can be a separate patch IMHO. It has nothing to do with
selects the running task there by starving the high priority task. Having
the core_pick_seq per sibling will avoid this. It might also help in some
hotplug corner cases as well.
stability/crashing of concurrent and rather infrequent CPU hotplug
operations.
Also, Peter said pick_seq is for core-wide picking. If you want to addI think just one counter is enough. Unless, there is a need to keep the counter
another semantic, then maybe add another counter which has a separate
meaning and justify why you are adding it.