From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: [PATCH 02/11] cgroup: relocate setting of CGRP_DEAD Date: Thu, 13 Mar 2014 15:50:04 -0400 Message-ID: <1394740213-17626-3-git-send-email-tj@kernel.org> References: <1394740213-17626-1-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=UOAGBxhAEttLjSOBnXndREZzR0nS6slIwl9oRiMtstk=; b=FrS3g4uYvDh93Z2a23ZfkHoAs8X/6FDIdLqwL8/+41VOEvuBy4y9fbyMIS/lfh0Qvl RKcHdHLrclVxhvPMJVkgR89PU3mg+1mccDbLvEIPLhWMDZNtKlEmviwlOEh4o2a91iBe +aDxvAlKGdLGsH5f29DFLAPVrA3tCQ2EmZJBKQUlGIU2nAixAy9O6haDIOsS6rfw/+L+ Rej0b0JvTGlXvD9CIWIG5UDUxw/UPEjwWFrT2oPXvPo5ce9qLaIloab/YGyQmbNv8/Ca SjgoD8j7XQjGH/UWWsv0xtU9Ew8/0YaxHVuZ25LYyawnAd4YlApn0GLIo+nGj5z6bBof fJ8Q== In-Reply-To: <1394740213-17626-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@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 To: lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org Cc: Tejun Heo , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org In cgroup_destroy_locked(), move setting of CGRP_DEAD above invocations of kill_css(). This doesn't make any visible behavior difference now but will be used to inhibit manipulating controller enable states of a dying cgroup on the unified hierarchy. Signed-off-by: Tejun Heo --- kernel/cgroup.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index ca19735..7bf1459 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -3868,6 +3868,15 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) return -EBUSY; /* + * Mark @cgrp dead. This prevents further task migration and child + * creation by disabling cgroup_lock_live_group(). Note that + * CGRP_DEAD assertion is depended upon by css_next_child() to + * resume iteration after dropping RCU read lock. See + * css_next_child() for details. + */ + set_bit(CGRP_DEAD, &cgrp->flags); + + /* * Initiate massacre of all css's. cgroup_destroy_css_killed() * will be invoked to perform the rest of destruction once the * percpu refs of all css's are confirmed to be killed. This @@ -3878,15 +3887,6 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) kill_css(css); mutex_lock(&cgroup_mutex); - /* - * Mark @cgrp dead. This prevents further task migration and child - * creation by disabling cgroup_lock_live_group(). Note that - * CGRP_DEAD assertion is depended upon by css_next_child() to - * resume iteration after dropping RCU read lock. See - * css_next_child() for details. - */ - set_bit(CGRP_DEAD, &cgrp->flags); - /* CGRP_DEAD is set, remove from ->release_list for the last time */ raw_spin_lock(&release_list_lock); if (!list_empty(&cgrp->release_list)) -- 1.8.5.3