All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <theo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Fengguang Wu
	<fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH cgroup/for-3.11 2/3] cgroup: fix RCU accesses around task->cgroups
Date: Tue, 25 Jun 2013 10:02:38 +0800	[thread overview]
Message-ID: <51C8FA3E.9020104@huawei.com> (raw)
In-Reply-To: <20130621225204.GD3949-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>

> @@ -5046,8 +5049,8 @@ static const struct file_operations proc
>  void cgroup_fork(struct task_struct *child)
>  {
>  	task_lock(current);
> +	get_css_set(task_css_set(current));
>  	child->cgroups = current->cgroups;

While we use RCU_INIT_POINTER() in cgroup_exit(), we don't need to use it here?

> -	get_css_set(child->cgroups);
>  	task_unlock(current);
>  	INIT_LIST_HEAD(&child->cg_list);
>  }
> @@ -5081,7 +5084,7 @@ void cgroup_post_fork(struct task_struct
>  		write_lock(&css_set_lock);
>  		task_lock(child);
>  		if (list_empty(&child->cg_list))
> -			list_add(&child->cg_list, &child->cgroups->tasks);
> +			list_add(&child->cg_list, &task_css_set(child)->tasks);
>  		task_unlock(child);
>  		write_unlock(&css_set_lock);
>  	}
> @@ -5163,8 +5166,8 @@ void cgroup_exit(struct task_struct *tsk
>  
>  	/* Reassign the task to the init_css_set. */
>  	task_lock(tsk);
> -	cset = tsk->cgroups;
> -	tsk->cgroups = &init_css_set;
> +	cset = task_css_set(tsk);
> +	RCU_INIT_POINTER(tsk->cgroups, &init_css_set);
>  
>  	if (run_callbacks && need_forkexit_callback) {
>  		/*

  parent reply	other threads:[~2013-06-25  2:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21 22:51 [PATCH cgroup/for-3.11 1/3] cgroup: fix RCU accesses to task->cgroups Tejun Heo
     [not found] ` <20130621225116.GC3949-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-06-21 22:52   ` [PATCH cgroup/for-3.11 2/3] cgroup: fix RCU accesses around task->cgroups Tejun Heo
     [not found]     ` <20130621225204.GD3949-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-06-21 22:52       ` [PATCH cgroup/for-3.11 3/3] cgroup: always use RCU accessors for protected accesses Tejun Heo
     [not found]         ` <20130621225233.GE3949-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-06-25  2:04           ` Li Zefan
2013-06-21 22:52       ` Tejun Heo
2013-06-25  2:02       ` Li Zefan [this message]
     [not found]         ` <51C8FA3E.9020104-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-06-25 18:50           ` [PATCH cgroup/for-3.11 2/3] cgroup: fix RCU accesses around task->cgroups Tejun Heo
2013-06-26  3:29       ` Li Zefan
2013-06-25  1:55   ` [PATCH cgroup/for-3.11 1/3] cgroup: fix RCU accesses to task->cgroups Li Zefan
2013-06-25 18:48   ` [PATCH v2 " Tejun Heo
     [not found]     ` <20130625184832.GC20051-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-06-26  3:28       ` Li Zefan
2013-06-26 17:49   ` [PATCH " Tejun Heo

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=51C8FA3E.9020104@huawei.com \
    --to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=theo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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.