public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Suresh Jayaraman <sjayaraman@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] sched: fix GENTLE_FAIR_SLEEPERS dependency
Date: Fri, 4 Dec 2009 10:54:08 +0100	[thread overview]
Message-ID: <20091204095408.GA26118@elte.hu> (raw)
In-Reply-To: <4B18D66E.8020905@suse.de>


* Suresh Jayaraman <sjayaraman@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@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

  reply	other threads:[~2009-12-04  9:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04  9:29 [RFC][PATCH] sched: fix GENTLE_FAIR_SLEEPERS dependency Suresh Jayaraman
2009-12-04  9:54 ` Ingo Molnar [this message]
2009-12-04 10:20   ` Suresh Jayaraman
2009-12-04 11:08     ` Peter Zijlstra
2009-12-04 11:12       ` Peter Zijlstra
2009-12-04 11:42       ` Suresh Jayaraman
2009-12-04 12:08         ` Peter Zijlstra
2009-12-04 13:12           ` Suresh Jayaraman
2009-12-04 13:12         ` Mike Galbraith
2009-12-04 10:06 ` Mike Galbraith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091204095408.GA26118@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=sjayaraman@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox