From: Ingo Molnar on

* Suresh Jayaraman <sjayaraman(a)suse.de> wrote:

> The newly introduced GENTLE_FAIR_SLEEPERS does not seem to have any
> effect without FAIR_SLEEPERS. Fix sysctl.sched_features to reflect
> this. Without this change, a user who sets GENTLE_FAIR_SLEEPERS
> without FAIR_SLEEPERS would assume gentle sleeper fairness which
> is not guaranteed.
>
> Signed-off-by: Suresh Jayaraman <sjayaraman(a)suse.de>
> ---
>
> Index: linux-2.6/kernel/sched.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched.c
> +++ linux-2.6/kernel/sched.c
> @@ -761,10 +761,22 @@ sched_feat_write(struct file *filp, cons
> int len = strlen(sched_feat_names[i]);
>
> if (strncmp(cmp, sched_feat_names[i], len) == 0) {
> - if (neg)
> + if (neg) {
> sysctl_sched_features &= ~(1UL << i);
> - else
> + /*
> + * GENTLE_FAIR_SLEEPERS have no effect without
> + * FAIR_SLEEPERS.
> + */
> + if (strncmp(cmp, "FAIR_SLEEPERS",
> + strlen("FAIR_SLEEPERS")) == 0)
> + sysctl_sched_features &= ~(1UL << i+1);
> + } else {
> sysctl_sched_features |= (1UL << i);
> + if (strncmp(cmp, "GENTLE_FAIR_SLEEPERS",
> + strlen("GENTLE_FAIR_SLEEPERS"))
> + == 0)
> + sysctl_sched_features |= (1UL << i-1);
> + }
> break;
> }
> }

There's a lot of other dependencies between scheduler features so it's
possible to change it without it having an effect on the scheduler.

sched_features is really a development/debugging facility, you have to
know what you are doing.

Might be worth adding a comment to the feature definition place itself
in the source - explain what it does and how it makes sense (and how it
doesnt).

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Mike Galbraith on
On Fri, 2009-12-04 at 14:59 +0530, Suresh Jayaraman wrote:
> The newly introduced GENTLE_FAIR_SLEEPERS does not seem to have any
> effect without FAIR_SLEEPERS. Fix sysctl.sched_features to reflect
> this. Without this change, a user who sets GENTLE_FAIR_SLEEPERS
> without FAIR_SLEEPERS would assume gentle sleeper fairness which
> is not guaranteed.

IMHO, these dependencies belong in documentation, not enforcement code.

Same applies for LAST_BUDDY, meaningless without WAKEUP_PREEMPT.
SYNC_MORE, SYNC_LESS + AFFINE_WAKEUPS etc.

Bottom line for all button poking and knob turning is you'd better make
sure you know what button/knob does, and what other things may depend on
it before messing with it, lest you get a nasty surprise.

-Mike

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Suresh Jayaraman on
On 12/04/2009 03:24 PM, Ingo Molnar wrote:
>
> * Suresh Jayaraman <sjayaraman(a)suse.de> wrote:
>
>> The newly introduced GENTLE_FAIR_SLEEPERS does not seem to have any
>> effect without FAIR_SLEEPERS. Fix sysctl.sched_features to reflect
>> this. Without this change, a user who sets GENTLE_FAIR_SLEEPERS
>> without FAIR_SLEEPERS would assume gentle sleeper fairness which
>> is not guaranteed.
>>
>
> There's a lot of other dependencies between scheduler features so it's
> possible to change it without it having an effect on the scheduler.
>
> sched_features is really a development/debugging facility, you have to
> know what you are doing.

I think originally introduced as a development/debugging facility,
sched_features is slowly transforming into a viable tool for System
Administrators, by looking at the impact of turning on/off some of these
features on some workloads (especially non-desktop workloads). And I
think these benefits should be passed on to the end users perhaps in the
form of documentation.

> Might be worth adding a comment to the feature definition place itself
> in the source - explain what it does and how it makes sense (and how it
> doesnt).
>

Yes it make more sense to make such changes as part of documentation
than a code enforcement. I'll try and collect some of the useful tuning
information.


Thanks,

--
Suresh Jayaraman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on
On Fri, 2009-12-04 at 15:50 +0530, Suresh Jayaraman wrote:
>
> I think originally introduced as a development/debugging facility,
> sched_features is slowly transforming into a viable tool for System
> Administrators, by looking at the impact of turning on/off some of these
> features on some workloads (especially non-desktop workloads). And I
> think these benefits should be passed on to the end users perhaps in the
> form of documentation.

This is really not meant to be used in that context. Its purely a debug
feature, with knobs coming and going as we see fit.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on
On Fri, 2009-12-04 at 12:08 +0100, Peter Zijlstra wrote:
> On Fri, 2009-12-04 at 15:50 +0530, Suresh Jayaraman wrote:
> >
> > I think originally introduced as a development/debugging facility,
> > sched_features is slowly transforming into a viable tool for System
> > Administrators, by looking at the impact of turning on/off some of these
> > features on some workloads (especially non-desktop workloads). And I
> > think these benefits should be passed on to the end users perhaps in the
> > form of documentation.
>
> This is really not meant to be used in that context. Its purely a debug
> feature, with knobs coming and going as we see fit.

That is, if this is how people are using it, I'll actually consider
removing the whole interface and keep it as an out-of-tree debug patch.

If a workload isn't working with the defaults they need to report a bug,
after that we can ask them to twiddle with some knobs to see what it is
that is not working.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/