Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1179811 > unrolled thread
| Started by | Srikar Dronamraju <srikar@linux.vnet.ibm.com> |
|---|---|
| First post | 2015-07-08 15:30 +0200 |
| Last post | 2015-07-11 11:00 +0200 |
| Articles | 6 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. Srikar Dronamraju <srikar@linux.vnet.ibm.com> - 2015-07-08 15:30 +0200
Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. Rik van Riel <riel@redhat.com> - 2015-07-08 16:00 +0200
Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. Ingo Molnar <mingo@kernel.org> - 2015-07-08 16:00 +0200
Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. Ingo Molnar <mingo@kernel.org> - 2015-07-09 10:10 +0200
Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. Srikar Dronamraju <srikar@linux.vnet.ibm.com> - 2015-07-10 19:30 +0200
Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. Ingo Molnar <mingo@kernel.org> - 2015-07-11 11:00 +0200
| From | Srikar Dronamraju <srikar@linux.vnet.ibm.com> |
|---|---|
| Date | 2015-07-08 15:30 +0200 |
| Subject | [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. |
| Message-ID | <pJXAd-3fG-17@gated-at.bofh.it> |
In commit:8a9e62a "sched/numa: Prefer NUMA hotness over cache hotness" sched feature NUMA was always set to true. However this sched feature was suppose to be enabled on NUMA boxes only thro set_numabalancing_state(). To get back to the above behaviour, bring back NUMA_FAVOUR_HIGHER feature. Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 587a2f6..aea72d5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5676,10 +5676,10 @@ static int migrate_degrades_locality(struct task_struct *p, struct lb_env *env) unsigned long src_faults, dst_faults; int src_nid, dst_nid; - if (!p->numa_faults || !(env->sd->flags & SD_NUMA)) + if (!sched_feat(NUMA) || !sched_feat(NUMA_FAVOUR_HIGHER)) return -1; - if (!sched_feat(NUMA)) + if (!p->numa_faults || !(env->sd->flags & SD_NUMA)) return -1; src_nid = cpu_to_node(env->src_cpu); diff --git a/kernel/sched/features.h b/kernel/sched/features.h index 83a50e7..d4d4726 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -79,12 +79,13 @@ SCHED_FEAT(LB_MIN, false) * numa_balancing= */ #ifdef CONFIG_NUMA_BALANCING +SCHED_FEAT(NUMA, false) /* - * NUMA will favor moving tasks towards nodes where a higher number of - * hinting faults are recorded during active load balancing. It will - * resist moving tasks towards nodes where a lower number of hinting - * faults have been recorded. + * NUMA_FAVOUR_HIGHER will favor moving tasks towards nodes where a + * higher number of hinting faults are recorded during active load + * balancing. It will resist moving tasks towards nodes where a lower + * number of hinting faults have been recorded. */ -SCHED_FEAT(NUMA, true) +SCHED_FEAT(NUMA_FAVOUR_HIGHER, true) #endif -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Rik van Riel <riel@redhat.com> |
|---|---|
| Date | 2015-07-08 16:00 +0200 |
| Subject | Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. |
| Message-ID | <pJY3g-3ql-3@gated-at.bofh.it> |
| In reply to | #1179811 |
On 07/08/2015 09:20 AM, Srikar Dronamraju wrote: > In commit:8a9e62a "sched/numa: Prefer NUMA hotness over cache hotness" > sched feature NUMA was always set to true. However this sched feature was > suppose to be enabled on NUMA boxes only thro set_numabalancing_state(). > > To get back to the above behaviour, bring back NUMA_FAVOUR_HIGHER feature. > Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Reviewed-by: Rik van Riel <riel@redhat.com> -- All rights reversed -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-07-08 16:00 +0200 |
| Subject | Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. |
| Message-ID | <pJY3g-3ql-5@gated-at.bofh.it> |
| In reply to | #1179811 |
* Srikar Dronamraju <srikar@linux.vnet.ibm.com> wrote: > In commit:8a9e62a "sched/numa: Prefer NUMA hotness over cache hotness" > sched feature NUMA was always set to true. However this sched feature was > suppose to be enabled on NUMA boxes only thro set_numabalancing_state(). > > To get back to the above behaviour, bring back NUMA_FAVOUR_HIGHER feature. Three typos and a non-standard commit ID reference. > /* > + * NUMA_FAVOUR_HIGHER will favor moving tasks towards nodes where a > + * higher number of hinting faults are recorded during active load > + * balancing. It will resist moving tasks towards nodes where a lower > + * number of hinting faults have been recorded. > */ > -SCHED_FEAT(NUMA, true) > +SCHED_FEAT(NUMA_FAVOUR_HIGHER, true) > #endif > So the comment spells 'favor' American, the constant you introduce is British spelling via 'FAVOUR'? Please use it consistently! Also, this name is totally non-intuitive. Make it something like NUMA_FAVOR_BUSY_NODES or so? Also, I'm wondering how this can schedule in a stable fashion: if a non-busy node is not favored, how can we end up there to start building up hinting faults? Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-07-09 10:10 +0200 |
| Subject | Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. |
| Message-ID | <pKf45-69s-7@gated-at.bofh.it> |
| In reply to | #1179851 |
* Srikar Dronamraju <srikar@linux.vnet.ibm.com> wrote:
> > So I find the patch, the description and the comments in the code conflicting and
> > confusing.
> >
> > The patch does this:
> >
> > @@ -5676,10 +5676,10 @@ static int migrate_degrades_locality(struct task_struct *p, struct lb_env *env)
> > unsigned long src_faults, dst_faults;
> > int src_nid, dst_nid;
> >
> > - if (!p->numa_faults || !(env->sd->flags & SD_NUMA))
> > + if (!sched_feat(NUMA) || !sched_feat(NUMA_FAVOUR_HIGHER))
> > return -1;
> >
> > - if (!sched_feat(NUMA))
> > + if (!p->numa_faults || !(env->sd->flags & SD_NUMA))
> > return -1;
> >
> > src_nid = cpu_to_node(env->src_cpu);
> >
> >
> > while the default for 'NUMA' is 0, 'NUMA_FAVOUR_HIGHER' is 1.
> >
> > Which in itself is confusing: WTH do we have a generic switch called 'NUMA' and
> > then have it disabled?
>
> NUMA feature gets enabled on multi-node boxes because of
>
> start_kernel() -> numa_policy_init() -> check_numabalancing_enable() ->
> set_numabalancing_state() -> sched_feat_set("NUMA");
Ugh, that is nonsensical!
If CONFIG_SCHED_DEBUG is disabled then sched_features is a constant value:
# define const_debug const
...
extern const_debug unsigned int sysctl_sched_features;
sched_features are _only_ meant for debugging. They turn into an unchangeable set
of features when SCHED_DEBUG is disabled - and that is very much by design.
The whole set_numabalancing_state() muck needs to be fixed.
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Srikar Dronamraju <srikar@linux.vnet.ibm.com> |
|---|---|
| Date | 2015-07-10 19:30 +0200 |
| Subject | Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. |
| Message-ID | <pKKhA-pQ-7@gated-at.bofh.it> |
| In reply to | #1180509 |
> > > Which in itself is confusing: WTH do we have a generic switch called 'NUMA' and
> > > then have it disabled?
> >
> > NUMA feature gets enabled on multi-node boxes because of
> >
> > start_kernel() -> numa_policy_init() -> check_numabalancing_enable() ->
> > set_numabalancing_state() -> sched_feat_set("NUMA");
>
> Ugh, that is nonsensical!
>
> If CONFIG_SCHED_DEBUG is disabled then sched_features is a constant value:
>
> # define const_debug const
>
> ...
>
> extern const_debug unsigned int sysctl_sched_features;
>
> sched_features are _only_ meant for debugging. They turn into an unchangeable set
> of features when SCHED_DEBUG is disabled - and that is very much by design.
>
> The whole set_numabalancing_state() muck needs to be fixed.
Would something like the below suffice. If yes I can send out a formal
patch for the same. Here we are moving numabalancing_enabled variable to
common i.e for both CONFIG_SCHED_DEBUG and !CONFIG_SCHED_DEBUG.
Also removing sched_feat_numa because its no more getting used.
numabalancing_enabled is already being used similarly in task_tick_fair
and task_numa_fault.
-------------->8------------------------------------------------------8<--------------
kernel/sched/core.c | 5 +++--
kernel/sched/fair.c | 2 +-
kernel/sched/sched.h | 6 ------
3 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 78b4bad10..69ccbda4 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2059,17 +2059,18 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
}
#ifdef CONFIG_NUMA_BALANCING
+__read_mostly bool numabalancing_enabled;
+
#ifdef CONFIG_SCHED_DEBUG
void set_numabalancing_state(bool enabled)
{
+ numabalancing_enabled = enabled;
if (enabled)
sched_feat_set("NUMA");
else
sched_feat_set("NO_NUMA");
}
#else
-__read_mostly bool numabalancing_enabled;
-
void set_numabalancing_state(bool enabled)
{
numabalancing_enabled = enabled;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 587a2f6..1b86455 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5679,7 +5679,7 @@ static int migrate_degrades_locality(struct task_struct *p, struct lb_env *env)
if (!p->numa_faults || !(env->sd->flags & SD_NUMA))
return -1;
- if (!sched_feat(NUMA))
+ if (!numabalancing_enabled)
return -1;
src_nid = cpu_to_node(env->src_cpu);
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 84d4879..d460fe3 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1014,14 +1014,8 @@ extern struct static_key sched_feat_keys[__SCHED_FEAT_NR];
#endif /* SCHED_DEBUG && HAVE_JUMP_LABEL */
#ifdef CONFIG_NUMA_BALANCING
-#define sched_feat_numa(x) sched_feat(x)
-#ifdef CONFIG_SCHED_DEBUG
-#define numabalancing_enabled sched_feat_numa(NUMA)
-#else
extern bool numabalancing_enabled;
-#endif /* CONFIG_SCHED_DEBUG */
#else
-#define sched_feat_numa(x) (0)
#define numabalancing_enabled (0)
#endif /* CONFIG_NUMA_BALANCING */
--
Thanks and Regards
Srikar Dronamraju
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-07-11 11:00 +0200 |
| Subject | Re: [PATCH] sched/numa: Restore sched feature NUMA to its earlier avatar. |
| Message-ID | <pKYNA-10X-7@gated-at.bofh.it> |
| In reply to | #1181781 |
* Srikar Dronamraju <srikar@linux.vnet.ibm.com> wrote:
> > > > Which in itself is confusing: WTH do we have a generic switch called 'NUMA' and
> > > > then have it disabled?
> > >
> > > NUMA feature gets enabled on multi-node boxes because of
> > >
> > > start_kernel() -> numa_policy_init() -> check_numabalancing_enable() ->
> > > set_numabalancing_state() -> sched_feat_set("NUMA");
> >
> > Ugh, that is nonsensical!
> >
> > If CONFIG_SCHED_DEBUG is disabled then sched_features is a constant value:
> >
> > # define const_debug const
> >
> > ...
> >
> > extern const_debug unsigned int sysctl_sched_features;
> >
> > sched_features are _only_ meant for debugging. They turn into an unchangeable set
> > of features when SCHED_DEBUG is disabled - and that is very much by design.
> >
> > The whole set_numabalancing_state() muck needs to be fixed.
>
> Would something like the below suffice. If yes I can send out a formal
> patch for the same. Here we are moving numabalancing_enabled variable to
> common i.e for both CONFIG_SCHED_DEBUG and !CONFIG_SCHED_DEBUG.
>
> Also removing sched_feat_numa because its no more getting used.
> numabalancing_enabled is already being used similarly in task_tick_fair
> and task_numa_fault.
>
> -------------->8------------------------------------------------------8<--------------
>
> kernel/sched/core.c | 5 +++--
> kernel/sched/fair.c | 2 +-
> kernel/sched/sched.h | 6 ------
> 3 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 78b4bad10..69ccbda4 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -2059,17 +2059,18 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
> }
>
> #ifdef CONFIG_NUMA_BALANCING
> +__read_mostly bool numabalancing_enabled;
s/numabalancing_enabled/sched_numa_balancing
Other than that this would be OK.
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web