[Devel] Re: [PATCH 2/2] [RFC] Enable non-blocking writes to the cgroup freezer.state file
Matt Helsley
matthltc at us.ibm.com
Mon Oct 26 08:57:43 PDT 2009
On Mon, Oct 26, 2009 at 08:15:30AM -0700, Matt Helsley wrote:
<snip>
> The change to the num_cant_freeze_now count enables blocking
> while the test of dont_block outside of all the locks re-enables
> non-blocking operations when O_NONBLOCK is set.
nit:
Oops, forgot to update the portion of the description above. Should
read:
The change to the num_cant_freeze_now count enables blocking
while the test of f_flags & O_NONBLOCK outside of all the locks ...
<snip>
> @@ -356,10 +354,22 @@ static int freezer_write(struct cgroup *cgroup, struct cftype *cft,
> else
> return -EINVAL;
>
> +retry:
> if (!cgroup_lock_live_group(cgroup))
> return -ENODEV;
> retval = freezer_change_state(cgroup, goal_state);
> cgroup_unlock();
> +
> + if ((f_flags & O_NONBLOCK) || (retval != -EAGAIN))
> + return retval;
> +
> + /* block while we haven't changed the state to the goal state */
> + set_current_state(TASK_INTERRUPTIBLE);
> + schedule();
> + __set_current_state(TASK_RUNNING);
> + if (!signal_pending(current))
> + goto retry;
> + retval = -EINTR;
> return retval;
> }
Cheers,
-Matt Helsley
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list