[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181203144906.GE31795@redhat.com>
Date: Mon, 3 Dec 2018 15:49:06 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Roman Gushchin <guroan@...il.com>
Cc: Tejun Heo <tj@...nel.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
cgroups@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-team@...com,
Roman Gushchin <guro@...com>
Subject: Re: [PATCH v4 4/7] cgroup: cgroup v2 freezer
On 11/30, Roman Gushchin wrote:
>
> +void cgroup_enter_frozen(void)
> +{
> + if (!current->frozen) {
> + struct cgroup *cgrp;
> +
> + spin_lock_irq(&css_set_lock);
> + current->frozen = true;
> + cgrp = task_dfl_cgroup(current);
> + cgrp->freezer.nr_frozen_tasks++;
> + WARN_ON_ONCE(cgrp->freezer.nr_frozen_tasks >
> + cgrp->freezer.nr_tasks_to_freeze);
> + cgroup_update_frozen(cgrp, true);
> + spin_unlock_irq(&css_set_lock);
> + }
> +
> + __set_current_state(TASK_INTERRUPTIBLE);
> + schedule();
> + __set_current_state(TASK_RUNNING);
forgot to mention, schedule() always returns in TASK_RUNNING, so the 2nd
__set_current_state() is pointless.
Oleg.
Powered by blists - more mailing lists