lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yfm1R6BDmlca7LJO@google.com>
Date:   Tue, 1 Feb 2022 14:33:43 -0800
From:   Minchan Kim <minchan@...nel.org>
To:     LKML <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Waiman Long <longman@...hat.com>
Cc:     Tim Murray <timmurray@...gle.com>
Subject: Re: [PATCH] locking: add missing __sched attributes

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@...nel.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ