[PATCH -v2 7/7] locking/percpu-rwsem: Add might_sleep() for writer locking

From: Peter Zijlstra
Date: Fri Jan 31 2020 - 10:18:29 EST


From: Davidlohr Bueso <dave@xxxxxxxxxxxx>

We are missing this annotation in percpu_down_write(). Correct
this.

Signed-off-by: Davidlohr Bueso <dbueso@xxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Link: https://lkml.kernel.org/r/20200108013305.7732-1-dave@xxxxxxxxxxxx
---
kernel/locking/percpu-rwsem.c | 1 +
1 file changed, 1 insertion(+)

--- a/kernel/locking/percpu-rwsem.c
+++ b/kernel/locking/percpu-rwsem.c
@@ -212,6 +212,7 @@ static bool readers_active_check(struct

void percpu_down_write(struct percpu_rw_semaphore *sem)
{
+ might_sleep();
rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);

/* Notify readers to take the slow path. */