Re: [RFC/RFT PATCH] sched: automated per tty task groups
From: Mathieu Desnoyers
Date: Thu Oct 21 2010 - 06:51:23 EST
* Mike Galbraith (efault@xxxxxx) wrote:
[...]
> +static void
> +autogroup_attach_tty(struct task_struct *p, struct task_group **tg)
> +{
> + struct tty_struct *tty = p->signal->tty;
> +
> + if (!tty)
> + return;
> +
> + *tg = p->signal->tty->tg;
> +}
> +
> +static inline void
> +autogroup_check_attach(struct task_struct *p, struct task_group **tg)
> +{
> + if (!sysctl_sched_autogroup_enabled || *tg != &root_task_group ||
> + p->sched_class != &fair_sched_class)
> + return;
> +
> + rcu_read_lock();
> +
> + autogroup_attach_tty(p, tg);
> +
> + rcu_read_unlock();
> +}
> +
Hi Mike,
This per-tty task grouping approach looks very promising. I'll give it a spin
when I find the time. Meanwhile, a little question about locking here: how is
the read lock supposed to protect from p->signal (and p->signal->tty)
modifications ? What's the locking scheme here ? So maybe just simple
rcu_dereference are missing, or maybe the tsk->sighand->siglock might be
required. In all cases, I feel something is missing there.
Thanks!
Mathieu
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/