Re: [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
Hi Peter, On 16/08/15 21:35, Peter Zijlstra wrote: > On Tue, Jul 07, 2015 at 07:24:28PM +0100, Morten Rasmussen wrote: >> From: Juri Lelli >> >> Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, >> as the thing can be called remotely (e.g., from load balacing code). >> >> cc: Ingo Molnar >> cc: Peter Zijlstra >> >> Signed-off-by: Juri Lelli >> --- >> kernel/sched/cpufreq_sched.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c >> index 06ff183..b81ac779 100644 >> --- a/kernel/sched/cpufreq_sched.c >> +++ b/kernel/sched/cpufreq_sched.c >> @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long >> capacity) >> unsigned long capacity_max = 0; >> >> /* update per-cpu capacity request */ >> -__this_cpu_write(pcpu_capacity, capacity); >> +per_cpu(pcpu_capacity, cpu) = capacity; >> >> policy = cpufreq_cpu_get(cpu); >> if (IS_ERR_OR_NULL(policy)) { > > Uhm,.. this function seems to hard assume its called for the local CPU. > It will only use the irq_queue_work_on() if the cpufreq thing requires > the thread, otherwise it will call the method directly on the calling > cpu. > True, but we still retrieve policy from cpu passed as argument; and then we use policy to request a freq transition, that should end up updating the right cpu. Thanks, - Juri -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
Hi Peter, On 16/08/15 21:35, Peter Zijlstra wrote: On Tue, Jul 07, 2015 at 07:24:28PM +0100, Morten Rasmussen wrote: From: Juri Lelli juri.le...@arm.com Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, as the thing can be called remotely (e.g., from load balacing code). cc: Ingo Molnar mi...@redhat.com cc: Peter Zijlstra pet...@infradead.org Signed-off-by: Juri Lelli juri.le...@arm.com --- kernel/sched/cpufreq_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c index 06ff183..b81ac779 100644 --- a/kernel/sched/cpufreq_sched.c +++ b/kernel/sched/cpufreq_sched.c @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long capacity) unsigned long capacity_max = 0; /* update per-cpu capacity request */ -__this_cpu_write(pcpu_capacity, capacity); +per_cpu(pcpu_capacity, cpu) = capacity; policy = cpufreq_cpu_get(cpu); if (IS_ERR_OR_NULL(policy)) { Uhm,.. this function seems to hard assume its called for the local CPU. It will only use the irq_queue_work_on() if the cpufreq thing requires the thread, otherwise it will call the method directly on the calling cpu. True, but we still retrieve policy from cpu passed as argument; and then we use policy to request a freq transition, that should end up updating the right cpu. Thanks, - Juri -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
On Tue, Jul 07, 2015 at 07:24:28PM +0100, Morten Rasmussen wrote: > From: Juri Lelli > > Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, > as the thing can be called remotely (e.g., from load balacing code). > > cc: Ingo Molnar > cc: Peter Zijlstra > > Signed-off-by: Juri Lelli > --- > kernel/sched/cpufreq_sched.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c > index 06ff183..b81ac779 100644 > --- a/kernel/sched/cpufreq_sched.c > +++ b/kernel/sched/cpufreq_sched.c > @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long > capacity) > unsigned long capacity_max = 0; > > /* update per-cpu capacity request */ > - __this_cpu_write(pcpu_capacity, capacity); > + per_cpu(pcpu_capacity, cpu) = capacity; > > policy = cpufreq_cpu_get(cpu); > if (IS_ERR_OR_NULL(policy)) { Uhm,.. this function seems to hard assume its called for the local CPU. It will only use the irq_queue_work_on() if the cpufreq thing requires the thread, otherwise it will call the method directly on the calling cpu. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
On Tue, Jul 07, 2015 at 07:24:28PM +0100, Morten Rasmussen wrote: From: Juri Lelli juri.le...@arm.com Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, as the thing can be called remotely (e.g., from load balacing code). cc: Ingo Molnar mi...@redhat.com cc: Peter Zijlstra pet...@infradead.org Signed-off-by: Juri Lelli juri.le...@arm.com --- kernel/sched/cpufreq_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c index 06ff183..b81ac779 100644 --- a/kernel/sched/cpufreq_sched.c +++ b/kernel/sched/cpufreq_sched.c @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long capacity) unsigned long capacity_max = 0; /* update per-cpu capacity request */ - __this_cpu_write(pcpu_capacity, capacity); + per_cpu(pcpu_capacity, cpu) = capacity; policy = cpufreq_cpu_get(cpu); if (IS_ERR_OR_NULL(policy)) { Uhm,.. this function seems to hard assume its called for the local CPU. It will only use the irq_queue_work_on() if the cpufreq thing requires the thread, otherwise it will call the method directly on the calling cpu. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
Hi Mike, On 08/07/15 17:42, Michael Turquette wrote: > Quoting Morten Rasmussen (2015-07-07 11:24:28) >> From: Juri Lelli >> >> Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, >> as the thing can be called remotely (e.g., from load balacing code). >> >> cc: Ingo Molnar >> cc: Peter Zijlstra >> >> Signed-off-by: Juri Lelli > > Looks good to me. Feel free to add my Reviewed-by or Acked-by as > appropriate. > Thanks for reviewing it! :) Best, - Juri > Regards, > Mike > >> --- >> kernel/sched/cpufreq_sched.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c >> index 06ff183..b81ac779 100644 >> --- a/kernel/sched/cpufreq_sched.c >> +++ b/kernel/sched/cpufreq_sched.c >> @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long >> capacity) >> unsigned long capacity_max = 0; >> >> /* update per-cpu capacity request */ >> - __this_cpu_write(pcpu_capacity, capacity); >> + per_cpu(pcpu_capacity, cpu) = capacity; >> >> policy = cpufreq_cpu_get(cpu); >> if (IS_ERR_OR_NULL(policy)) { >> -- >> 1.9.1 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> Please read the FAQ at http://www.tux.org/lkml/ > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
Hi Mike, On 08/07/15 17:42, Michael Turquette wrote: Quoting Morten Rasmussen (2015-07-07 11:24:28) From: Juri Lelli juri.le...@arm.com Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, as the thing can be called remotely (e.g., from load balacing code). cc: Ingo Molnar mi...@redhat.com cc: Peter Zijlstra pet...@infradead.org Signed-off-by: Juri Lelli juri.le...@arm.com Looks good to me. Feel free to add my Reviewed-by or Acked-by as appropriate. Thanks for reviewing it! :) Best, - Juri Regards, Mike --- kernel/sched/cpufreq_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c index 06ff183..b81ac779 100644 --- a/kernel/sched/cpufreq_sched.c +++ b/kernel/sched/cpufreq_sched.c @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long capacity) unsigned long capacity_max = 0; /* update per-cpu capacity request */ - __this_cpu_write(pcpu_capacity, capacity); + per_cpu(pcpu_capacity, cpu) = capacity; policy = cpufreq_cpu_get(cpu); if (IS_ERR_OR_NULL(policy)) { -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
Quoting Morten Rasmussen (2015-07-07 11:24:28) > From: Juri Lelli > > Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, > as the thing can be called remotely (e.g., from load balacing code). > > cc: Ingo Molnar > cc: Peter Zijlstra > > Signed-off-by: Juri Lelli Looks good to me. Feel free to add my Reviewed-by or Acked-by as appropriate. Regards, Mike > --- > kernel/sched/cpufreq_sched.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c > index 06ff183..b81ac779 100644 > --- a/kernel/sched/cpufreq_sched.c > +++ b/kernel/sched/cpufreq_sched.c > @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long > capacity) > unsigned long capacity_max = 0; > > /* update per-cpu capacity request */ > - __this_cpu_write(pcpu_capacity, capacity); > + per_cpu(pcpu_capacity, cpu) = capacity; > > policy = cpufreq_cpu_get(cpu); > if (IS_ERR_OR_NULL(policy)) { > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
Quoting Morten Rasmussen (2015-07-07 11:24:28) From: Juri Lelli juri.le...@arm.com Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, as the thing can be called remotely (e.g., from load balacing code). cc: Ingo Molnar mi...@redhat.com cc: Peter Zijlstra pet...@infradead.org Signed-off-by: Juri Lelli juri.le...@arm.com Looks good to me. Feel free to add my Reviewed-by or Acked-by as appropriate. Regards, Mike --- kernel/sched/cpufreq_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c index 06ff183..b81ac779 100644 --- a/kernel/sched/cpufreq_sched.c +++ b/kernel/sched/cpufreq_sched.c @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long capacity) unsigned long capacity_max = 0; /* update per-cpu capacity request */ - __this_cpu_write(pcpu_capacity, capacity); + per_cpu(pcpu_capacity, cpu) = capacity; policy = cpufreq_cpu_get(cpu); if (IS_ERR_OR_NULL(policy)) { -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
From: Juri Lelli Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, as the thing can be called remotely (e.g., from load balacing code). cc: Ingo Molnar cc: Peter Zijlstra Signed-off-by: Juri Lelli --- kernel/sched/cpufreq_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c index 06ff183..b81ac779 100644 --- a/kernel/sched/cpufreq_sched.c +++ b/kernel/sched/cpufreq_sched.c @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long capacity) unsigned long capacity_max = 0; /* update per-cpu capacity request */ - __this_cpu_write(pcpu_capacity, capacity); + per_cpu(pcpu_capacity, cpu) = capacity; policy = cpufreq_cpu_get(cpu); if (IS_ERR_OR_NULL(policy)) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling
From: Juri Lelli juri.le...@arm.com Use the cpu argument of cpufreq_sched_set_cap() to handle per_cpu writes, as the thing can be called remotely (e.g., from load balacing code). cc: Ingo Molnar mi...@redhat.com cc: Peter Zijlstra pet...@infradead.org Signed-off-by: Juri Lelli juri.le...@arm.com --- kernel/sched/cpufreq_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c index 06ff183..b81ac779 100644 --- a/kernel/sched/cpufreq_sched.c +++ b/kernel/sched/cpufreq_sched.c @@ -151,7 +151,7 @@ void cpufreq_sched_set_cap(int cpu, unsigned long capacity) unsigned long capacity_max = 0; /* update per-cpu capacity request */ - __this_cpu_write(pcpu_capacity, capacity); + per_cpu(pcpu_capacity, cpu) = capacity; policy = cpufreq_cpu_get(cpu); if (IS_ERR_OR_NULL(policy)) { -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/