-
Notifications
You must be signed in to change notification settings - Fork 5
barrier: Add smp_cond_load_*_timewait() #5857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
barrier: Add smp_cond_load_*_timewait() #5857
Conversation
|
Upstream branch: 98857d1 |
|
Upstream branch: 98857d1 |
a252aa5 to
8be8582
Compare
|
Upstream branch: 98857d1 |
8be8582 to
7b65f7f
Compare
27199db to
bed149f
Compare
|
Upstream branch: 6417ca8 |
7b65f7f to
a790911
Compare
bed149f to
c32e265
Compare
|
Upstream branch: e4980fa |
a790911 to
513ee26
Compare
c32e265 to
0e26bd3
Compare
|
Upstream branch: c9110e6 |
513ee26 to
9f64dcd
Compare
0e26bd3 to
4e70ac0
Compare
|
Upstream branch: abc8a95 |
9f64dcd to
84c2eb1
Compare
4e70ac0 to
c04dd5a
Compare
|
Upstream branch: 929adf8 |
84c2eb1 to
ac90392
Compare
c04dd5a to
4754b79
Compare
|
Upstream branch: 2d92ef7 |
ac90392 to
84caeb9
Compare
4754b79 to
af15c58
Compare
|
Upstream branch: b338cf8 |
84caeb9 to
01d7740
Compare
af15c58 to
c979e9f
Compare
Add smp_cond_load_relaxed_timewait(), which extends smp_cond_load_relaxed() to allow waiting for a finite duration. The additional parameter allows for the timeout check. The waiting is done via the usual cpu_relax() spin-wait around the condition variable with periodic evaluation of the time-check. The number of times we spin is defined by SMP_TIMEWAIT_SPIN_COUNT (chosen to be 200 by default) which, assuming each cpu_relax() iteration takes around 20-30 cycles (measured on a variety of x86 platforms), amounts to around 4000-6000 cycles. Cc: Arnd Bergmann <[email protected]> Cc: Will Deacon <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: [email protected] Signed-off-by: Ankur Arora <[email protected]> Reviewed-by: Catalin Marinas <[email protected]>
Add smp_cond_load_relaxed_timewait(), a timed variant of smp_cond_load_relaxed(). This uses __cmpwait_relaxed() to do the actual waiting, with the event-stream guaranteeing that we wake up from WFE periodically and not block forever in case there are no stores to the cacheline. For cases when the event-stream is unavailable, fallback to spin-waiting. Cc: Will Deacon <[email protected]> Cc: [email protected] Suggested-by: Catalin Marinas <[email protected]> Signed-off-by: Ankur Arora <[email protected]> Reviewed-by: Catalin Marinas <[email protected]>
In preparation for defining smp_cond_load_acquire_timewait(), remove the private copy. Lacking this, the rqspinlock code falls back to using smp_cond_load_acquire(). Cc: Kumar Kartikeya Dwivedi <[email protected]> Cc: Alexei Starovoitov <[email protected]> Signed-off-by: Ankur Arora <[email protected]> Reviewed-by: Catalin Marinas <[email protected]>
Add the acquire variant of smp_cond_load_relaxed_timewait(). This reuses the relaxed variant, with an additional LOAD->LOAD ordering. Cc: Arnd Bergmann <[email protected]> Cc: Will Deacon <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: [email protected] Signed-off-by: Ankur Arora <[email protected]> Reviewed-by: Catalin Marinas <[email protected]>
Use smp_cond_load_acquire_timewait() to define res_atomic_cond_read_acquire() and res_smp_cond_load_acquire_timewait(). The timeout check for both is done via RES_CHECK_TIMEOUT(). Define res_smp_cond_load_acquire_waiting() to allow it to amortize the check for spin-wait implementations. Cc: Kumar Kartikeya Dwivedi <[email protected]> Cc: Alexei Starovoitov <[email protected]> Signed-off-by: Ankur Arora <[email protected]>
|
Upstream branch: 9621eb6 |
01d7740 to
0a6e06f
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=996802 irrelevant now. Closing PR. |
Pull request for series with
subject: barrier: Add smp_cond_load_*_timewait()
version: 4
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=996802