From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frederic Weisbecker Subject: Re: [PATCH 06/10] cgroup: improve old cgroup handling in cgroup_attach_proc() Date: Mon, 14 Nov 2011 21:37:51 +0100 Message-ID: <20111114203744.GH9446@somewhere> References: <1320191193-8110-1-git-send-email-tj@kernel.org> <1320191193-8110-7-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1320191193-8110-7-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> 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: Tejun Heo Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, rjw-KKrjLPT3xs0@public.gmane.org, linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, paul-inf54ven1CmVyaH7bEyXVA@public.gmane.org List-Id: containers.vger.kernel.org On Tue, Nov 01, 2011 at 04:46:29PM -0700, Tejun Heo wrote: > cgroup_attach_proc() behaves differently from cgroup_attach_task() in > the following aspects. > > * All hooks are invoked even if no task is actually being moved. > > * ->can_attach_task() is called for all tasks in the group whether the > new cgrp is different from the current cgrp or not; however, > ->attach_task() is skipped if new equals new. This makes the calls > asymmetric. > > This patch improves old cgroup handling in cgroup_attach_proc() by > looking up the current cgroup at the head, recording it in the flex > array along with the task itself, and using it to remove the above two > differences. This will also ease further changes. > > -v2: nr_todo renamed to nr_migrating_tasks as per Paul Menage's > suggestion. > > Signed-off-by: Tejun Heo > Acked-by: Paul Menage > Reviewed-by: KAMEZAWA Hiroyuki > Cc: Li Zefan Reviewed-by: Frederic Weisbecker