Re: [PATCH v2 0/9] Remove spin_unlock_wait()
From: Ingo Molnar
Date: Fri Jul 07 2017 - 06:34:16 EST
* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> You missed the one in do_exit(), which I thought was the original one.
Indeed, it's raw_spin_unlock_wait() which my git grep pattern missed.
But it's not the original spin_unlock_wait(): the pi_lock and priority inheritance
is a newfangled invention that Linus (rightfully) resisted for years.
The original spin_unlock_wait() was for the global scheduler_lock, long gone.
Here's the full history of the original spin_unlock_wait() usecase in the
do_exit() path, for the historically interested:
the spin_unlock_wait() primitive gets introduced as part of release()
the release() usecase gets converted to an open coded spin_lock()+unlock()
poll loop over scheduler_lock
open coded loop is changed over to poll p->has_cpu
->has_cpu loop poll loop is converted to a spin_lock()+unlock()
poll loop over runqueue_lock
combined open coded p->has_cpu poll loop is added back, in addition to the
lock+unlock loop is changed from scheduler_lock to task_lock
->has_cpu gets renamed to ->cpus_runnable
poll loop is factored out from exit()'s release() function
to the scheduler's new wait_task_inactive() function
wait_task_inactive() is still alive and kicking. Its poll loop has
increased in complexity, but it still does not use spin_unlock_wait()
So it was always a mess, and we relatively early flipped from the clever
spin_unlock_wait() implementation to an open coded lock+unlock poll loop.
TL;DR: The original do_exit() usecase is gone, it does not use spin_unlock_wait(),