From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: Salman Qazi <sqazi-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] cgroup: make sure that decisions in __css_put are atomic
Date: Thu, 7 Jun 2012 10:54:30 +0900 [thread overview]
Message-ID: <20120607015430.GG21357@google.com> (raw)
In-Reply-To: <4FCF0747.7050000-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
On Wed, Jun 06, 2012 at 03:31:19PM +0800, Li Zefan wrote:
> Salman Qazi wrote:
>
> > __css_put is using atomic_dec on the ref count, and then
> > looking at the ref count to make decisions. This is prone
> > to races, as someone else may decrement ref count between
> > our decrement and our decision. Instead, we should base our
> > decisions on the value that we decremented the ref count to.
> >
> > (This results in an actual race on Google's kernel which I
> > haven't been able to reproduce on the upstream kernel. Having
> > said that, it's still incorrect by inspection).
> >
> > Signed-off-by: Salman Qazi <sqazi-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
>
>
> Acked-by: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>
> Good catch! This patch should be backported for 3.4.
Applied to for-3.5-fixes w/ stable@ added.
Thanks.
--
tejun
prev parent reply other threads:[~2012-06-07 1:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 21:50 [PATCH] cgroup: make sure that decisions in __css_put are atomic Salman Qazi
[not found] ` <20120605215019.4722.31817.stgit-Oz2bD8w/QAX+Wsei8lUk51LMcqb5oVE02SarAXORi/o@public.gmane.org>
2012-06-06 7:31 ` Li Zefan
[not found] ` <4FCF0747.7050000-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-06-07 1:54 ` Tejun Heo [this message]
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=20120607015430.GG21357@google.com \
--to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=sqazi-hpIqsD4AKlfQT0dZR+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.