From mboxrd@z Thu Jan 1 00:00:00 1970 From: KAMEZAWA Hiroyuki Subject: Re: [PATCH v2 3/5] change number_of_cpusets to an atomic Date: Tue, 24 Apr 2012 11:25:46 +0900 Message-ID: <4F960F2A.9020304@jp.fujitsu.com> References: <1335209867-1831-1-git-send-email-glommer@parallels.com> <1335209867-1831-4-git-send-email-glommer@parallels.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1335209867-1831-4-git-send-email-glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Glauber Costa Cc: Tejun Heo , netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Li Zefan , David Miller , devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org (2012/04/24 4:37), Glauber Costa wrote: > This will allow us to call destroy() without holding the > cgroup_mutex(). Other important updates inside update_flags() > are protected by the callback_mutex. > > We could protect this variable with the callback_mutex as well, > as suggested by Li Zefan, but we need to make sure we are protected > by that mutex at all times, and some of its updates happen inside the > cgroup_mutex - which means we would deadlock. > > An atomic variable is not expensive, since it is seldom updated, > and protect us well. > > Signed-off-by: Glauber Costa Reviewed-by: KAMEZAWA Hiroyuki