From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933164Ab2JWQNJ (ORCPT ); Tue, 23 Oct 2012 12:13:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13546 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754198Ab2JWQNI (ORCPT ); Tue, 23 Oct 2012 12:13:08 -0400 Date: Tue, 23 Oct 2012 18:14:14 +0200 From: Oleg Nesterov To: Tejun Heo Cc: rjw@sisk.pl, linux-kernel@vger.kernel.org, lizefan@huawei.com, containers@lists.linux-foundation.org, cgroups@vger.kernel.org Subject: Re: [PATCH 5/7] cgroup_freezer: allow moving tasks in and out of a frozen cgroup Message-ID: <20121023161414.GA18138@redhat.com> References: <1350426526-14254-1-git-send-email-tj@kernel.org> <1350426526-14254-6-git-send-email-tj@kernel.org> <20121022192506.GA27163@redhat.com> <20121022212505.GG5951@atj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121022212505.GG5951@atj.dyndns.org> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/22, Tejun Heo wrote: > > Hello, > > On Mon, Oct 22, 2012 at 09:25:06PM +0200, Oleg Nesterov wrote: > > > @@ -190,12 +201,12 @@ static void freezer_fork(struct task_struct *task) > > > goto out; > > > > > > spin_lock_irq(&freezer->lock); > > > - BUG_ON(freezer->state == CGROUP_FROZEN); > > > - > > > - /* Locking avoids race with FREEZING -> THAWED transitions. */ > > > - if (freezer->state == CGROUP_FREEZING) > > > + /* > > > + * @task might have been just migrated into a FROZEN cgroup. > > > > Confused. If it was migrated, then freezer_attach() should take care > > do freeze_task? > > Hmmm... there's a window where a task is migrated but ->attach() > hasn't completed yet, so freezer_attach() might not have kicked in > yet. Yes, I see. Indeed, cgroup_task_migrate() is called before ->attach(). Thanks! Oleg. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH 5/7] cgroup_freezer: allow moving tasks in and out of a frozen cgroup Date: Tue, 23 Oct 2012 18:14:14 +0200 Message-ID: <20121023161414.GA18138@redhat.com> References: <1350426526-14254-1-git-send-email-tj@kernel.org> <1350426526-14254-6-git-send-email-tj@kernel.org> <20121022192506.GA27163@redhat.com> <20121022212505.GG5951@atj.dyndns.org> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20121022212505.GG5951-OlzNCW9NnSVy/B6EtB590w@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tejun Heo Cc: rjw-KKrjLPT3xs0@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 10/22, Tejun Heo wrote: > > Hello, > > On Mon, Oct 22, 2012 at 09:25:06PM +0200, Oleg Nesterov wrote: > > > @@ -190,12 +201,12 @@ static void freezer_fork(struct task_struct *task) > > > goto out; > > > > > > spin_lock_irq(&freezer->lock); > > > - BUG_ON(freezer->state == CGROUP_FROZEN); > > > - > > > - /* Locking avoids race with FREEZING -> THAWED transitions. */ > > > - if (freezer->state == CGROUP_FREEZING) > > > + /* > > > + * @task might have been just migrated into a FROZEN cgroup. > > > > Confused. If it was migrated, then freezer_attach() should take care > > do freeze_task? > > Hmmm... there's a window where a task is migrated but ->attach() > hasn't completed yet, so freezer_attach() might not have kicked in > yet. Yes, I see. Indeed, cgroup_task_migrate() is called before ->attach(). Thanks! Oleg.