* [PATCH] locking: add missing __sched attributes
@ 2022-01-15 23:16 Minchan Kim
2022-02-01 22:33 ` Minchan Kim
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Minchan Kim @ 2022-01-15 23:16 UTC (permalink / raw)
To: LKML; +Cc: Tim Murray, Peter Zijlstra, Waiman Long, Minchan Kim
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>
---
kernel/locking/percpu-rwsem.c | 5 +++--
kernel/locking/rwsem.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
index 70a32a576f3f..c9fdae94e098 100644
--- a/kernel/locking/percpu-rwsem.c
+++ b/kernel/locking/percpu-rwsem.c
@@ -7,6 +7,7 @@
#include <linux/rcupdate.h>
#include <linux/sched.h>
#include <linux/sched/task.h>
+#include <linux/sched/debug.h>
#include <linux/errno.h>
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)
__set_current_state(TASK_RUNNING);
}
-bool __percpu_down_read(struct percpu_rw_semaphore *sem, bool try)
+bool __sched __percpu_down_read(struct percpu_rw_semaphore *sem, bool try)
{
if (__percpu_down_read_trylock(sem))
return true;
@@ -211,7 +212,7 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
return true;
}
-void percpu_down_write(struct percpu_rw_semaphore *sem)
+void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
{
might_sleep();
rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
index 69aba4abe104..acde5d6f1254 100644
--- a/kernel/locking/rwsem.c
+++ b/kernel/locking/rwsem.c
@@ -1048,7 +1048,7 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, long count, unsigned int stat
/*
* Wait until we successfully acquire the write lock
*/
-static struct rw_semaphore *
+static struct rw_semaphore __sched *
rwsem_down_write_slowpath(struct rw_semaphore *sem, int state)
{
long count;
--
2.34.1.703.g22d0c6ccf7-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] locking: add missing __sched attributes
2022-01-15 23:16 [PATCH] locking: add missing __sched attributes Minchan Kim
@ 2022-02-01 22:33 ` Minchan Kim
2022-02-02 14:45 ` Peter Zijlstra
2022-02-11 11:17 ` [tip: locking/core] locking: Add " tip-bot2 for Minchan Kim
2 siblings, 0 replies; 4+ messages in thread
From: Minchan Kim @ 2022-02-01 22:33 UTC (permalink / raw)
To: LKML, Peter Zijlstra, Waiman Long; +Cc: Tim Murray
On Sat, Jan 15, 2022 at 03:16:57PM -0800, Minchan Kim wrote:
Bumping up.
> 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>
> ---
> kernel/locking/percpu-rwsem.c | 5 +++--
> kernel/locking/rwsem.c | 2 +-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
> index 70a32a576f3f..c9fdae94e098 100644
> --- a/kernel/locking/percpu-rwsem.c
> +++ b/kernel/locking/percpu-rwsem.c
> @@ -7,6 +7,7 @@
> #include <linux/rcupdate.h>
> #include <linux/sched.h>
> #include <linux/sched/task.h>
> +#include <linux/sched/debug.h>
> #include <linux/errno.h>
>
> 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)
> __set_current_state(TASK_RUNNING);
> }
>
> -bool __percpu_down_read(struct percpu_rw_semaphore *sem, bool try)
> +bool __sched __percpu_down_read(struct percpu_rw_semaphore *sem, bool try)
> {
> if (__percpu_down_read_trylock(sem))
> return true;
> @@ -211,7 +212,7 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
> return true;
> }
>
> -void percpu_down_write(struct percpu_rw_semaphore *sem)
> +void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
> {
> might_sleep();
> rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
> diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
> index 69aba4abe104..acde5d6f1254 100644
> --- a/kernel/locking/rwsem.c
> +++ b/kernel/locking/rwsem.c
> @@ -1048,7 +1048,7 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, long count, unsigned int stat
> /*
> * Wait until we successfully acquire the write lock
> */
> -static struct rw_semaphore *
> +static struct rw_semaphore __sched *
> rwsem_down_write_slowpath(struct rw_semaphore *sem, int state)
> {
> long count;
> --
> 2.34.1.703.g22d0c6ccf7-goog
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] locking: add missing __sched attributes
2022-01-15 23:16 [PATCH] locking: add missing __sched attributes Minchan Kim
2022-02-01 22:33 ` Minchan Kim
@ 2022-02-02 14:45 ` Peter Zijlstra
2022-02-11 11:17 ` [tip: locking/core] locking: Add " tip-bot2 for Minchan Kim
2 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2022-02-02 14:45 UTC (permalink / raw)
To: Minchan Kim; +Cc: LKML, Tim Murray, Waiman Long
On Sat, Jan 15, 2022 at 03:16:57PM -0800, Minchan Kim wrote:
> 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>
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip: locking/core] locking: Add missing __sched attributes
2022-01-15 23:16 [PATCH] locking: add missing __sched attributes Minchan Kim
2022-02-01 22:33 ` Minchan Kim
2022-02-02 14:45 ` Peter Zijlstra
@ 2022-02-11 11:17 ` tip-bot2 for Minchan Kim
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Minchan Kim @ 2022-02-11 11:17 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Minchan Kim, Peter Zijlstra (Intel), x86, linux-kernel
The following commit has been merged into the locking/core branch of tip:
Commit-ID: c441e934b604a3b5f350a9104124cf6a3ba07a34
Gitweb: https://git.kernel.org/tip/c441e934b604a3b5f350a9104124cf6a3ba07a34
Author: Minchan Kim <minchan@kernel.org>
AuthorDate: Sat, 15 Jan 2022 15:16:57 -08:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 11 Feb 2022 12:13:55 +01:00
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
---
kernel/locking/percpu-rwsem.c | 5 +++--
kernel/locking/rwsem.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c
index 70a32a5..c9fdae9 100644
--- a/kernel/locking/percpu-rwsem.c
+++ b/kernel/locking/percpu-rwsem.c
@@ -7,6 +7,7 @@
#include <linux/rcupdate.h>
#include <linux/sched.h>
#include <linux/sched/task.h>
+#include <linux/sched/debug.h>
#include <linux/errno.h>
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)
__set_current_state(TASK_RUNNING);
}
-bool __percpu_down_read(struct percpu_rw_semaphore *sem, bool try)
+bool __sched __percpu_down_read(struct percpu_rw_semaphore *sem, bool try)
{
if (__percpu_down_read_trylock(sem))
return true;
@@ -211,7 +212,7 @@ static bool readers_active_check(struct percpu_rw_semaphore *sem)
return true;
}
-void percpu_down_write(struct percpu_rw_semaphore *sem)
+void __sched percpu_down_write(struct percpu_rw_semaphore *sem)
{
might_sleep();
rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
index 69aba4a..acde5d6 100644
--- a/kernel/locking/rwsem.c
+++ b/kernel/locking/rwsem.c
@@ -1048,7 +1048,7 @@ out_nolock:
/*
* Wait until we successfully acquire the write lock
*/
-static struct rw_semaphore *
+static struct rw_semaphore __sched *
rwsem_down_write_slowpath(struct rw_semaphore *sem, int state)
{
long count;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-02-11 11:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 23:16 [PATCH] locking: add missing __sched attributes Minchan Kim
2022-02-01 22:33 ` Minchan Kim
2022-02-02 14:45 ` Peter Zijlstra
2022-02-11 11:17 ` [tip: locking/core] locking: Add " tip-bot2 for Minchan Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).