Re: [RFC][PATCH 02/22] sched: add extended scheduling interface

From: Peter Zijlstra
Date: Wed Nov 10 2010 - 13:50:50 EST


On Fri, 2010-10-29 at 08:27 +0200, Raistlin wrote:
> static int __sched_setscheduler(struct task_struct *p, int policy,
> - const struct sched_param *param, bool user)
> + const struct sched_param *param,
> + const struct sched_param_ex *param_ex,
> + bool user)
> {
> int retval, oldprio, oldpolicy = -1, on_rq, running;
> unsigned long flags;
> @@ -4861,10 +4863,18 @@ recheck:
> int sched_setscheduler(struct task_struct *p, int policy,
> const struct sched_param *param)
> {
> - return __sched_setscheduler(p, policy, param, true);
> + return __sched_setscheduler(p, policy, param, NULL, true);
> }
> EXPORT_SYMBOL_GPL(sched_setscheduler);
>
> +int sched_setscheduler_ex(struct task_struct *p, int policy,
> + const struct sched_param *param,
> + const struct sched_param_ex *param_ex)
> +{
> + return __sched_setscheduler(p, policy, param, param_ex, true);
> +}
> +EXPORT_SYMBOL_GPL(sched_setscheduler_ex);

Do we really need to pass both params? Can't we simply create a struct
sched_param_ex new_param = { .sched_priority = param->sched_priority };
on stack and pass that?


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