Re: [PATCH 1/2] SCHED: Generic hooks for trapping task preemption

From: Rusty Russell
Date: Wed Jul 11 2007 - 22:57:26 EST


On Wed, 2007-07-11 at 18:55 +0300, Avi Kivity wrote:
> +config PREEMPT_HOOKS
> + bool
> + depends on X86
> + default y

Hmm, I would have thought that having CONFIG_KVM "select PREEMPT_HOOKS"
would be a little clearer.

> +static void fire_sched_in_preempt_hooks(struct task_struct *tsk)
> +{
> + struct preempt_hook *hook;
> + struct hlist_node *node;
> +
> + hlist_for_each_entry(hook, node, &tsk->preempt_hooks, link)
> + hook->ops->sched_in(hook, raw_smp_processor_id());
> +}

The old current/tsk conflation. You hand in "tsk" here, but since
that's not handed through to the sched_in, it must be "current". It's
just unfortunate that this generates better code...

But patch looks good.

Cheers,
Rusty.

-
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/