lkml.org 
[lkml]   [2008]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] introduce task cgroup (#task restrictioon for prevent fork bomb by cgroup)
> +static int task_cgroup_max_tasks_write(struct cgroup *cgrp,
> + struct cftype *cftype,
> + s64 max_tasks)
> +{
> + struct task_cgroup *taskcg;
> +
> + if ((max_tasks > INT_MAX) ||
> + (max_tasks < INT_MIN))

It should be < -1 I think.

> + return -EINVAL;
> +
> + taskcg = task_cgroup_from_cgrp(cgrp);
> +
> + spin_lock(&taskcg->lock);
> + if (max_tasks < taskcg->nr_tasks)
> + return -EBUSY;

Shouldn't you drop the lock here?

> + taskcg->max_tasks = max_tasks;
> + spin_unlock(&taskcg->lock);
> +
> + return 0;
> +}

How does this controller affect performance? Do you have some numbers?

Thanks,
--
regards,
Dhaval


\
 
 \ /
  Last update: 2008-06-05 11:31    [W:0.930 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site