OpenVZ Forum


Home » Mailing lists » Devel » [RFC][PATCH] introduce task cgroup (#task restrictioon for prevent fork bomb by cgroup)
Re: [RFC][PATCH] introduce task cgroup (#task restrictioon for prevent fork bomb by cgroup) [message #30739 is a reply to message #30724] Thu, 05 June 2008 09:27 Go to previous messageGo to previous message
Dhaval Giani is currently offline  Dhaval Giani
Messages: 37
Registered: June 2007
Member
> +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
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH] cgroup: anotate two variables with __read_mostly
Next Topic: Re: restarting tests/sleep
Goto Forum:
  


Current Time: Thu Aug 08 14:23:40 GMT 2024

Total time taken to generate the page: 0.03074 seconds