Skip to content

Commit c441e93

Browse files
minchankPeter Zijlstra
authored andcommitted
locking: Add missing __sched attributes
This patch adds __sched attributes to a few missing places to show blocked function rather than locking function in get_wchan. Signed-off-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20220115231657.84828-1-minchan@kernel.org
1 parent 1dc01ab commit c441e93

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

kernel/locking/percpu-rwsem.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/rcupdate.h>
88
#include <linux/sched.h>
99
#include <linux/sched/task.h>
10+
#include <linux/sched/debug.h>
1011
#include <linux/errno.h>
1112

1213
int __percpu_init_rwsem(struct percpu_rw_semaphore *sem,
@@ -162,7 +163,7 @@ static void percpu_rwsem_wait(struct percpu_rw_semaphore *sem, bool reader)
162163
__set_current_state(TASK_RUNNING);
163164
}
164165

165-
bool __percpu_down_read(struct percpu_rw_semaphore *sem, bool try)
166+
bool __sched __percpu_down_read(struct percpu_rw_semaphore *sem, bool try)
166167
{
167168
if (__percpu_down_read_trylock(sem))
168169
return true;
@@ -211,7 +212,7 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
211212
return true;
212213
}
213214

214-
void percpu_down_write(struct percpu_rw_semaphore *sem)
215+
void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
215216
{
216217
might_sleep();
217218
rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);

kernel/locking/rwsem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, long count, unsigned int stat
10481048
/*
10491049
* Wait until we successfully acquire the write lock
10501050
*/
1051-
static struct rw_semaphore *
1051+
static struct rw_semaphore __sched *
10521052
rwsem_down_write_slowpath(struct rw_semaphore *sem, int state)
10531053
{
10541054
long count;

0 commit comments

Comments
 (0)