You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is because thread migration is a little fucked when it comes to locking. sched_lock definitely needs a
for (;;)
{
unsigned int cpu = READ_ONCE(thread->cpu);
spin_lock(/*cpu->scheduler_lock*/);
spin_lock(&thread->lock);
if (thread->cpu == cpu)
break;
/* unlock locks, retry */
}
As to making sure a thread doesn't get migrated twice... Dunno. Is it an issue? Probably not? As long as we assume thread->cpu can change at any point in time (aka READ_ONCE)
The text was updated successfully, but these errors were encountered: