From: Oleg Nesterov <oleg@redhat.com>
To: madhuparnabhowmik10@gmail.com
Cc: juri.lelli@redhat.com, vincent.guittot@linaro.org,
paulmck@kernel.org, peterz@infradead.org,
linux-kernel@vger.kernel.org, rcu@vger.kernel.org,
mingo@redhat.com, ebiederm@xmission.com, joel@joelfernandes.org,
christian.brauner@ubuntu.com,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [Linux-kernel-mentees] [PATCH] sched.h: Annotate sighand_struct with __rcu
Date: Mon, 27 Jan 2020 10:29:52 +0100 [thread overview]
Message-ID: <20200127092951.GA1116@redhat.com> (raw)
In-Reply-To: <20200124045908.26389-1-madhuparnabhowmik10@gmail.com>
On 01/24, madhuparnabhowmik10@gmail.com wrote:
>
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -918,7 +918,7 @@ struct task_struct {
>
> /* Signal handlers: */
> struct signal_struct *signal;
> - struct sighand_struct *sighand;
> + struct sighand_struct __rcu *sighand;
> sigset_t blocked;
> sigset_t real_blocked;
> /* Restored if set_restore_sigmask() was used: */
> diff --git a/kernel/signal.c b/kernel/signal.c
> index bcd46f547db3..9ad8dea93dbb 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1383,7 +1383,7 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
> * must see ->sighand == NULL.
> */
> spin_lock_irqsave(&sighand->siglock, *flags);
> - if (likely(sighand == tsk->sighand))
> + if (likely(sighand == rcu_access_pointer(tsk->sighand)))
> break;
> spin_unlock_irqrestore(&sighand->siglock, *flags);
> }
ACK,
perhaps you can also cleanup copy_sighand(). rcu_assign_pointer() makes no
sense, we should either move it down or simply use RCU_INIT_POINTER().
Oleg.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
WARNING: multiple messages have this Message-ID (diff)
From: Oleg Nesterov <oleg@redhat.com>
To: madhuparnabhowmik10@gmail.com
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, ebiederm@xmission.com,
christian.brauner@ubuntu.com, paulmck@kernel.org,
joel@joelfernandes.org, linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
frextrite@gmail.com, rcu@vger.kernel.org
Subject: Re: [PATCH] sched.h: Annotate sighand_struct with __rcu
Date: Mon, 27 Jan 2020 10:29:52 +0100 [thread overview]
Message-ID: <20200127092951.GA1116@redhat.com> (raw)
In-Reply-To: <20200124045908.26389-1-madhuparnabhowmik10@gmail.com>
On 01/24, madhuparnabhowmik10@gmail.com wrote:
>
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -918,7 +918,7 @@ struct task_struct {
>
> /* Signal handlers: */
> struct signal_struct *signal;
> - struct sighand_struct *sighand;
> + struct sighand_struct __rcu *sighand;
> sigset_t blocked;
> sigset_t real_blocked;
> /* Restored if set_restore_sigmask() was used: */
> diff --git a/kernel/signal.c b/kernel/signal.c
> index bcd46f547db3..9ad8dea93dbb 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1383,7 +1383,7 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
> * must see ->sighand == NULL.
> */
> spin_lock_irqsave(&sighand->siglock, *flags);
> - if (likely(sighand == tsk->sighand))
> + if (likely(sighand == rcu_access_pointer(tsk->sighand)))
> break;
> spin_unlock_irqrestore(&sighand->siglock, *flags);
> }
ACK,
perhaps you can also cleanup copy_sighand(). rcu_assign_pointer() makes no
sense, we should either move it down or simply use RCU_INIT_POINTER().
Oleg.
next prev parent reply other threads:[~2020-01-27 9:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 4:59 [Linux-kernel-mentees] [PATCH] sched.h: Annotate sighand_struct with __rcu madhuparnabhowmik10
2020-01-24 4:59 ` madhuparnabhowmik10
2020-01-25 21:41 ` [Linux-kernel-mentees] " Christian Brauner
2020-01-25 21:41 ` Christian Brauner
2020-01-26 1:23 ` [Linux-kernel-mentees] " Paul E. McKenney
2020-01-26 1:23 ` Paul E. McKenney
2020-01-27 9:29 ` Oleg Nesterov [this message]
2020-01-27 9:29 ` Oleg Nesterov
2020-01-27 12:23 ` [Linux-kernel-mentees] " Christian Brauner
2020-01-27 12:23 ` Christian Brauner
2020-01-27 17:14 ` [Linux-kernel-mentees] " Madhuparna Bhowmik
2020-01-27 17:14 ` Madhuparna Bhowmik
-- strict thread matches above, loose matches on Subject: below --
2020-01-23 14:53 [Linux-kernel-mentees] " madhuparnabhowmik10
2020-01-23 16:41 ` Paul E. McKenney
2020-01-24 4:28 ` Madhuparna Bhowmik
2020-01-22 18:11 madhuparnabhowmik10
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200127092951.GA1116@redhat.com \
--to=oleg@redhat.com \
--cc=christian.brauner@ubuntu.com \
--cc=ebiederm@xmission.com \
--cc=joel@joelfernandes.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=madhuparnabhowmik10@gmail.com \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.