linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] sched: Make sched_feat_names const
@ 2012-05-25  6:41 Hiroshi Shimamoto
  2012-05-25  6:42 ` [PATCH 2/3] sched: Remove the last NULL entry from sched_feat_names Hiroshi Shimamoto
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hiroshi Shimamoto @ 2012-05-25  6:41 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, linux-kernel@vger.kernel.org

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

The strings sched_feat_names are never changed.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 kernel/sched/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index fdf8f98..e8e595a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -142,7 +142,7 @@ const_debug unsigned int sysctl_sched_features =
 #define SCHED_FEAT(name, enabled)	\
 	#name ,
 
-static __read_mostly char *sched_feat_names[] = {
+static const char * const sched_feat_names[] = {
 #include "features.h"
 	NULL
 };
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] sched: Remove the last NULL entry from sched_feat_names
  2012-05-25  6:41 [PATCH 1/3] sched: Make sched_feat_names const Hiroshi Shimamoto
@ 2012-05-25  6:42 ` Hiroshi Shimamoto
  2012-05-30 13:42   ` [tip:sched/urgent] " tip-bot for Hiroshi Shimamoto
  2012-05-25  6:43 ` [PATCH 3/3] sched/rt: Remove redundant check before push_rt_task() Hiroshi Shimamoto
  2012-05-30 13:41 ` [tip:sched/urgent] sched: Make sched_feat_names const tip-bot for Hiroshi Shimamoto
  2 siblings, 1 reply; 7+ messages in thread
From: Hiroshi Shimamoto @ 2012-05-25  6:42 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, linux-kernel@vger.kernel.org

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

No need to have the last NULL entry.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 kernel/sched/core.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index e8e595a..621b10c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -144,7 +144,6 @@ const_debug unsigned int sysctl_sched_features =
 
 static const char * const sched_feat_names[] = {
 #include "features.h"
-	NULL
 };
 
 #undef SCHED_FEAT
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] sched/rt: Remove redundant check before push_rt_task()
  2012-05-25  6:41 [PATCH 1/3] sched: Make sched_feat_names const Hiroshi Shimamoto
  2012-05-25  6:42 ` [PATCH 2/3] sched: Remove the last NULL entry from sched_feat_names Hiroshi Shimamoto
@ 2012-05-25  6:43 ` Hiroshi Shimamoto
  2012-05-25  9:39   ` Peter Zijlstra
  2012-05-30 13:41 ` [tip:sched/urgent] sched: Make sched_feat_names const tip-bot for Hiroshi Shimamoto
  2 siblings, 1 reply; 7+ messages in thread
From: Hiroshi Shimamoto @ 2012-05-25  6:43 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, linux-kernel@vger.kernel.org

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Currently rq->rt.overloaded is checked twice in switched_to_rt().
Remove the first one which out of push_rt_task().

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 kernel/sched/rt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index c5565c3..a601a70 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1907,7 +1907,7 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
 	 */
 	if (p->on_rq && rq->curr != p) {
 #ifdef CONFIG_SMP
-		if (rq->rt.overloaded && push_rt_task(rq) &&
+		if (push_rt_task(rq) &&
 		    /* Don't resched if we changed runqueues */
 		    rq != task_rq(p))
 			check_resched = 0;
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] sched/rt: Remove redundant check before push_rt_task()
  2012-05-25  6:43 ` [PATCH 3/3] sched/rt: Remove redundant check before push_rt_task() Hiroshi Shimamoto
@ 2012-05-25  9:39   ` Peter Zijlstra
  2012-05-25 13:08     ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Zijlstra @ 2012-05-25  9:39 UTC (permalink / raw)
  To: Hiroshi Shimamoto
  Cc: Ingo Molnar, linux-kernel@vger.kernel.org, Steven Rostedt

On Fri, 2012-05-25 at 15:43 +0900, Hiroshi Shimamoto wrote:
> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> 
> Currently rq->rt.overloaded is checked twice in switched_to_rt().
> Remove the first one which out of push_rt_task().

Steven was this on purpose to avoid the call or can I apply this thing?

> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> ---
>  kernel/sched/rt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index c5565c3..a601a70 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -1907,7 +1907,7 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
>  	 */
>  	if (p->on_rq && rq->curr != p) {
>  #ifdef CONFIG_SMP
> -		if (rq->rt.overloaded && push_rt_task(rq) &&
> +		if (push_rt_task(rq) &&
>  		    /* Don't resched if we changed runqueues */
>  		    rq != task_rq(p))
>  			check_resched = 0;




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] sched/rt: Remove redundant check before push_rt_task()
  2012-05-25  9:39   ` Peter Zijlstra
@ 2012-05-25 13:08     ` Steven Rostedt
  0 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2012-05-25 13:08 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Hiroshi Shimamoto, Ingo Molnar, linux-kernel@vger.kernel.org

On Fri, 2012-05-25 at 11:39 +0200, Peter Zijlstra wrote:
> On Fri, 2012-05-25 at 15:43 +0900, Hiroshi Shimamoto wrote:
> > From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> > 
> > Currently rq->rt.overloaded is checked twice in switched_to_rt().
> > Remove the first one which out of push_rt_task().
> 
> Steven was this on purpose to avoid the call or can I apply this thing?
> 

Yeah, I think I added that as a way to avoid the call, but I never did
any benchmarks to see if it was actually better (extra check to avoid
the call, or just do the call and remove the duplicate check).

It would be a good idea to see how ofter that check happens in the real
world. As two or more RT tasks on the same CPU is only something that
happens on a real RT system (as the common case that is).

It's a micro optimization, as a double duplicate check should be fast as
everything is nicely in the cache line. But an extra call may be
expensive. But it's not a big difference to me if you take the patch or
not.

> > Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> > ---
> >  kernel/sched/rt.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> > index c5565c3..a601a70 100644
> > --- a/kernel/sched/rt.c
> > +++ b/kernel/sched/rt.c
> > @@ -1907,7 +1907,7 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
> >  	 */
> >  	if (p->on_rq && rq->curr != p) {
> >  #ifdef CONFIG_SMP
> > -		if (rq->rt.overloaded && push_rt_task(rq) &&
> > +		if (push_rt_task(rq) &&
> >  		    /* Don't resched if we changed runqueues */
> >  		    rq != task_rq(p))

If you decide to take this patch, it may be better to switch it to:

		/* Don't resched if we changed runqueues */
		if (push_rt_task(rq) && rq != task_rq(p))

-- Steve



> >  			check_resched = 0;
> 
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip:sched/urgent] sched: Make sched_feat_names const
  2012-05-25  6:41 [PATCH 1/3] sched: Make sched_feat_names const Hiroshi Shimamoto
  2012-05-25  6:42 ` [PATCH 2/3] sched: Remove the last NULL entry from sched_feat_names Hiroshi Shimamoto
  2012-05-25  6:43 ` [PATCH 3/3] sched/rt: Remove redundant check before push_rt_task() Hiroshi Shimamoto
@ 2012-05-30 13:41 ` tip-bot for Hiroshi Shimamoto
  2 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Hiroshi Shimamoto @ 2012-05-30 13:41 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, h-shimamoto, hpa, mingo, a.p.zijlstra, tglx

Commit-ID:  1292531f6f27af909e713671dd9cc3bcab8114b7
Gitweb:     http://git.kernel.org/tip/1292531f6f27af909e713671dd9cc3bcab8114b7
Author:     Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
AuthorDate: Fri, 25 May 2012 15:41:54 +0900
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 30 May 2012 14:02:26 +0200

sched: Make sched_feat_names const

The strings sched_feat_names are never changed.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/4FBF29B2.9030904@ct.jp.nec.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 70cc36a..c1679a0 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -142,7 +142,7 @@ const_debug unsigned int sysctl_sched_features =
 #define SCHED_FEAT(name, enabled)	\
 	#name ,
 
-static __read_mostly char *sched_feat_names[] = {
+static const char * const sched_feat_names[] = {
 #include "features.h"
 	NULL
 };

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [tip:sched/urgent] sched: Remove the last NULL entry from sched_feat_names
  2012-05-25  6:42 ` [PATCH 2/3] sched: Remove the last NULL entry from sched_feat_names Hiroshi Shimamoto
@ 2012-05-30 13:42   ` tip-bot for Hiroshi Shimamoto
  0 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Hiroshi Shimamoto @ 2012-05-30 13:42 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, h-shimamoto, hpa, mingo, a.p.zijlstra, tglx

Commit-ID:  7997a456ef841bb78eb6f881d7cc2c17c2f9b35e
Gitweb:     http://git.kernel.org/tip/7997a456ef841bb78eb6f881d7cc2c17c2f9b35e
Author:     Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
AuthorDate: Fri, 25 May 2012 15:42:47 +0900
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 30 May 2012 14:02:27 +0200

sched: Remove the last NULL entry from sched_feat_names

No need to have the last NULL entry.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/4FBF29E7.5020805@ct.jp.nec.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/core.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index c1679a0..94d598a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -144,7 +144,6 @@ const_debug unsigned int sysctl_sched_features =
 
 static const char * const sched_feat_names[] = {
 #include "features.h"
-	NULL
 };
 
 #undef SCHED_FEAT

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-05-30 13:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-25  6:41 [PATCH 1/3] sched: Make sched_feat_names const Hiroshi Shimamoto
2012-05-25  6:42 ` [PATCH 2/3] sched: Remove the last NULL entry from sched_feat_names Hiroshi Shimamoto
2012-05-30 13:42   ` [tip:sched/urgent] " tip-bot for Hiroshi Shimamoto
2012-05-25  6:43 ` [PATCH 3/3] sched/rt: Remove redundant check before push_rt_task() Hiroshi Shimamoto
2012-05-25  9:39   ` Peter Zijlstra
2012-05-25 13:08     ` Steven Rostedt
2012-05-30 13:41 ` [tip:sched/urgent] sched: Make sched_feat_names const tip-bot for Hiroshi Shimamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).