RCU Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer()
@ 2020-01-27 17:58 madhuparnabhowmik10
  2020-01-28  9:04 ` Christian Brauner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: madhuparnabhowmik10 @ 2020-01-27 17:58 UTC (permalink / raw)
  To: oleg, christian.brauner, mingo
  Cc: linux-kernel, paulmck, joel, frextrite, rcu,
	linux-kernel-mentees, Madhuparna Bhowmik

From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>

Use RCU_INIT_POINTER() instead of rcu_access_pointer() in
copy_sighand().

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
---
 kernel/fork.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 2508a4f238a3..42b71d4a50cb 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
 		return 0;
 	}
 	sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL);
-	rcu_assign_pointer(tsk->sighand, sig);
+	RCU_INIT_POINTER(tsk->sighand, sig);
 	if (!sig)
 		return -ENOMEM;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer()
  2020-01-27 17:58 [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer() madhuparnabhowmik10
@ 2020-01-28  9:04 ` Christian Brauner
  2020-01-28 14:59 ` Oleg Nesterov
  2020-01-28 17:52 ` Christian Brauner
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Brauner @ 2020-01-28  9:04 UTC (permalink / raw)
  To: madhuparnabhowmik10
  Cc: oleg, mingo, linux-kernel, paulmck, joel, frextrite, rcu,
	linux-kernel-mentees

On Mon, Jan 27, 2020 at 11:28:21PM +0530, madhuparnabhowmik10@gmail.com wrote:
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> 
> Use RCU_INIT_POINTER() instead of rcu_access_pointer() in
> copy_sighand().
> 
> Suggested-by: Oleg Nesterov <oleg@redhat.com>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>

Thanks!
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer()
  2020-01-27 17:58 [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer() madhuparnabhowmik10
  2020-01-28  9:04 ` Christian Brauner
@ 2020-01-28 14:59 ` Oleg Nesterov
  2020-01-28 17:52 ` Christian Brauner
  2 siblings, 0 replies; 4+ messages in thread
From: Oleg Nesterov @ 2020-01-28 14:59 UTC (permalink / raw)
  To: madhuparnabhowmik10
  Cc: christian.brauner, mingo, linux-kernel, paulmck, joel, frextrite,
	rcu, linux-kernel-mentees

On 01/27, madhuparnabhowmik10@gmail.com wrote:
>
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
>  		return 0;
>  	}
>  	sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL);
> -	rcu_assign_pointer(tsk->sighand, sig);
> +	RCU_INIT_POINTER(tsk->sighand, sig);

Acked-by: Oleg Nesterov <oleg@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer()
  2020-01-27 17:58 [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer() madhuparnabhowmik10
  2020-01-28  9:04 ` Christian Brauner
  2020-01-28 14:59 ` Oleg Nesterov
@ 2020-01-28 17:52 ` Christian Brauner
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Brauner @ 2020-01-28 17:52 UTC (permalink / raw)
  To: madhuparnabhowmik10
  Cc: oleg, mingo, linux-kernel, paulmck, joel, frextrite, rcu,
	linux-kernel-mentees

On Mon, Jan 27, 2020 at 11:28:21PM +0530, madhuparnabhowmik10@gmail.com wrote:
> From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> 
> Use RCU_INIT_POINTER() instead of rcu_access_pointer() in
> copy_sighand().
> 
> Suggested-by: Oleg Nesterov <oleg@redhat.com>
> Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>

Applied, queued up for post rc1.

Thanks!
Christian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-27 17:58 [PATCH] fork.c: Use RCU_INIT_POINTER() instead of rcu_access_pointer() madhuparnabhowmik10
2020-01-28  9:04 ` Christian Brauner
2020-01-28 14:59 ` Oleg Nesterov
2020-01-28 17:52 ` Christian Brauner

RCU Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/rcu/0 rcu/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 rcu rcu/ https://lore.kernel.org/rcu \
		rcu@vger.kernel.org
	public-inbox-index rcu

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.rcu


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git