From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH] cgroup: missing rcu read lock around task_css_set Date: Mon, 03 Mar 2014 18:00:25 -0500 Message-ID: <53150989.70307@oracle.com> References: <1393729211-937-1-git-send-email-sasha.levin@oracle.com> <20140303223327.GB26523@mtj.dyndns.org> <5315057F.3030602@oracle.com> <20140303224505.GE26523@mtj.dyndns.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140303224505.GE26523-9pTldWuhBndy/B6EtB590w@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Tejun Heo Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 03/03/2014 05:45 PM, Tejun Heo wrote: > On Mon, Mar 03, 2014 at 05:43:11PM -0500, Sasha Levin wrote: >> On 03/03/2014 05:33 PM, Tejun Heo wrote: >>> On Sat, Mar 01, 2014 at 10:00:11PM -0500, Sasha Levin wrote: >>>> rcu read lock should be held when calling and working with task_css_set. >>>> >>>> This patch also fixes a related lockdep warning. >>> >>> Hmmm... PF_EXITING should be visible at that point and cset can't >>> change anymore. We prolly need to update lockdep annotation rather >>> than adding spurious rcu locking around it. Against which branch is >>> it? Can you please post the lockdep warning? >> >> I see it on -next. > > I think the right thing to do is using task_css_set_check() with > PF_EXITING check and add comment explaining that cset can no longer > change. Can you please write up a patch? Hrm... there is a PF_EXITING check there already: #define task_css_set_check(task, __c) \ rcu_dereference_check((task)->cgroups, \ lockdep_is_held(&cgroup_mutex) || \ lockdep_is_held(&css_set_rwsem) || \ ((task)->flags & PF_EXITING) || (__c)) I see it's not happening on Linus's master so I'll run a bisection to figure out what broke it. Thanks, Sasha