linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] scheduler changes for v5.3
@ 2019-07-08 11:53 Ingo Molnar
  2019-07-09  1:45 ` pr-tracker-bot
  2019-07-10  5:48 ` John Stultz
  0 siblings, 2 replies; 7+ messages in thread
From: Ingo Molnar @ 2019-07-08 11:53 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Peter Zijlstra, Thomas Gleixner, Andrew Morton

Linus,

Please pull the latest sched-core-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-core-for-linus

   # HEAD: af24bde8df2029f067dc46aff0393c8f18ff6e2f sched/uclamp: Add uclamp support to energy_compute()

The main changes in this cycle were:

 - Remove the unused per rq load array and all its infrastructure,
   by Dietmar Eggemann.

 - Add utilization clamping support by Patrick Bellasi. This is a 
   refinement of the energy aware scheduling framework with support for 
   boosting of interactive and capping of background workloads: to make 
   sure critical GUI threads get maximum frequency ASAP, and to make sure 
   background processing doesn't unnecessarily move to cpufreq governor 
   to higher frequencies and less energy efficient CPU modes.

 - Add the bare minimum of tracepoints required for LISA EAS regression 
   testing, by Qais Yousef - which allows automated testing of various 
   power management features, including energy aware scheduling.

 - Restructure the former tsk_nr_cpus_allowed() facility that the -rt 
   kernel used to modify the scheduler's CPU affinity logic such as 
   migrate_disable() - introduce the task->cpus_ptr value instead of 
   taking the address of &task->cpus_allowed directly - by Sebastian
   Andrzej Siewior.

 - Misc optimizations, fixes, cleanups and small enhancements - see the 
   Git log for details.

 Thanks,

	Ingo

------------------>
Dietmar Eggemann (8):
      sched/fair: Remove rq->load
      sched/fair: Remove the rq->cpu_load[] update code
      sched/fair: Replace source_load() & target_load() with weighted_cpuload()
      sched/debug: Remove sd->*_idx range on sysctl
      sched/core: Remove rq->cpu_load[]
      sched/core: Remove sd->*_idx
      sched/fair: Remove sgs->sum_weighted_load
      sched/fair: Rename weighted_cpuload() to cpu_runnable_load()

Gao Xiang (1):
      sched/core: Add __sched tag for io_schedule()

Patrick Bellasi (11):
      sched/uclamp: Add CPU's clamp buckets refcounting
      sched/uclamp: Add bucket local max tracking
      sched/uclamp: Enforce last task's UCLAMP_MAX
      sched/uclamp: Add system default clamps
      sched/core: Allow sched_setattr() to use the current policy
      sched/uclamp: Extend sched_setattr() to support utilization clamping
      sched/uclamp: Reset uclamp values on RESET_ON_FORK
      sched/uclamp: Set default clamps for RT tasks
      sched/cpufreq, sched/uclamp: Add clamps for FAIR and RT tasks
      sched/uclamp: Add uclamp_util_with()
      sched/uclamp: Add uclamp support to energy_compute()

Pavel Begunkov (1):
      sched/wait: Deduplicate code with do-while

Peter Zijlstra (1):
      sched/core: Optimize try_to_wake_up() for local wakeups

Qais Yousef (6):
      sched/autogroup: Make autogroup_path() always available
      sched/debug: Add a new sched_trace_*() helper functions
      sched/debug: Add new tracepoints to track PELT at rq level
      sched/debug: Add new tracepoint to track PELT at se level
      sched/debug: Add sched_overutilized tracepoint
      sched/debug: Export the newly added tracepoints

Qian Cai (1):
      sched/fair: Fix "runnable_avg_yN_inv" not used warnings

Sebastian Andrzej Siewior (1):
      sched/core: Provide a pointer to the valid CPU mask

Valentin Schneider (1):
      sched/fair: Clean up definition of NOHZ blocked load functions

Vincent Guittot (1):
      sched/topology: Remove unused 'sd' parameter from arch_scale_cpu_capacity()

bsegall@google.com (1):
      sched/fair: Don't push cfs_bandwith slack timers forward


 Documentation/scheduler/sched-pelt.c       |   3 +-
 arch/arm/kernel/topology.c                 |   2 +-
 arch/ia64/kernel/mca.c                     |   2 +-
 arch/mips/include/asm/switch_to.h          |   4 +-
 arch/mips/kernel/mips-mt-fpaff.c           |   2 +-
 arch/mips/kernel/traps.c                   |   6 +-
 arch/powerpc/platforms/cell/spufs/sched.c  |   2 +-
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c  |   2 +-
 drivers/base/arch_topology.c               |   6 +-
 drivers/infiniband/hw/hfi1/affinity.c      |   6 +-
 drivers/infiniband/hw/hfi1/sdma.c          |   3 +-
 drivers/infiniband/hw/qib/qib_file_ops.c   |   7 +-
 fs/proc/array.c                            |   4 +-
 include/linux/arch_topology.h              |   2 +-
 include/linux/energy_model.h               |   2 +-
 include/linux/log2.h                       |  34 ++
 include/linux/sched.h                      |  79 +++-
 include/linux/sched/nohz.h                 |   8 -
 include/linux/sched/sysctl.h               |  11 +
 include/linux/sched/topology.h             |  25 +-
 include/trace/events/sched.h               |  31 ++
 include/uapi/linux/sched.h                 |  14 +-
 include/uapi/linux/sched/types.h           |  66 ++-
 init/Kconfig                               |  53 +++
 init/init_task.c                           |   3 +-
 kernel/cgroup/cpuset.c                     |   2 +-
 kernel/fork.c                              |   2 +
 kernel/power/energy_model.c                |   2 +-
 kernel/sched/autogroup.c                   |   2 -
 kernel/sched/core.c                        | 533 ++++++++++++++++++++++--
 kernel/sched/cpudeadline.c                 |   4 +-
 kernel/sched/cpufreq_schedutil.c           |  24 +-
 kernel/sched/cpupri.c                      |   4 +-
 kernel/sched/deadline.c                    |   8 +-
 kernel/sched/debug.c                       |  43 +-
 kernel/sched/fair.c                        | 623 ++++++++++-------------------
 kernel/sched/features.h                    |   1 -
 kernel/sched/pelt.c                        |  13 +-
 kernel/sched/pelt.h                        |   2 +-
 kernel/sched/rt.c                          |   8 +-
 kernel/sched/sched-pelt.h                  |   2 +-
 kernel/sched/sched.h                       | 134 +++++--
 kernel/sched/topology.c                    |  18 +-
 kernel/sched/wait.c                        |   8 +-
 kernel/sysctl.c                            |  16 +
 kernel/time/tick-sched.c                   |   2 -
 kernel/trace/trace_hwlat.c                 |   2 +-
 lib/smp_processor_id.c                     |   2 +-
 samples/trace_events/trace-events-sample.c |   2 +-
 49 files changed, 1216 insertions(+), 618 deletions(-)

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

* Re: [GIT PULL] scheduler changes for v5.3
  2019-07-08 11:53 [GIT PULL] scheduler changes for v5.3 Ingo Molnar
@ 2019-07-09  1:45 ` pr-tracker-bot
  2019-07-10  5:48 ` John Stultz
  1 sibling, 0 replies; 7+ messages in thread
From: pr-tracker-bot @ 2019-07-09  1:45 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, linux-kernel, Peter Zijlstra, Thomas Gleixner,
	Andrew Morton

The pull request you sent on Mon, 8 Jul 2019 13:53:49 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-core-for-linus

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/dad1c12ed831a7a89cc01e5582cd0b81a4be7f19

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker

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

* Re: [GIT PULL] scheduler changes for v5.3
  2019-07-08 11:53 [GIT PULL] scheduler changes for v5.3 Ingo Molnar
  2019-07-09  1:45 ` pr-tracker-bot
@ 2019-07-10  5:48 ` John Stultz
  2019-07-10 10:57   ` Peter Zijlstra
  1 sibling, 1 reply; 7+ messages in thread
From: John Stultz @ 2019-07-10  5:48 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Linux Kernel Mailing List, Peter Zijlstra,
	Thomas Gleixner, Andrew Morton

On Mon, Jul 8, 2019 at 9:33 AM Ingo Molnar <mingo@kernel.org> wrote:
> Please pull the latest sched-core-for-linus git tree from:
>
>    git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-core-for-linus
....
> Peter Zijlstra (1):
>       sched/core: Optimize try_to_wake_up() for local wakeups

Hey Peter, Ingo,
   Since this change landed in Linus' tree, I've been seeing a lot of
the following dmesg noise when running AOSP on the HiKey960 board.

[  173.162712] CPU: 2 PID: 731 Comm: ndroid.systemui Tainted: G S
          5.2.0-rc5-00110-g6751c43d94d6 #447
[  173.162721] Hardware name: HiKey960 (DT)
[  173.171194] caller is try_to_wake_up+0x3e4/0x788
[  173.179605] Call trace:
[  173.179617]  dump_backtrace+0x0/0x140
[  173.179626]  show_stack+0x14/0x20
[  173.179638]  dump_stack+0x9c/0xc4
[  173.179649]  debug_smp_processor_id+0x148/0x150
[  173.179659]  try_to_wake_up+0x3e4/0x788
[  173.179669]  wake_up_q+0x5c/0x98
[  173.179681]  futex_wake+0x170/0x1a8
[  173.179696]  do_futex+0x560/0xf30
[  173.284541]  __arm64_sys_futex+0xfc/0x148
[  173.288570]  el0_svc_common.constprop.0+0x64/0x188
[  173.293371]  el0_svc_handler+0x28/0x78
[  173.297131]  el0_svc+0x8/0xc
[  173.300045] CPU: 0 PID: 1258 Comm: Binder:363_5 Tainted: G S
        5.2.0-rc5-00110-g6751c43d94d6 #447
[  173.301130] BUG: using smp_processor_id() in preemptible [00000000]
code: ndroid.systemui/731
[  173.310074] Hardware name: HiKey960 (DT)
[  173.310084] Call trace:
[  173.310112]  dump_backtrace+0x0/0x140
[  173.310131]  show_stack+0x14/0x20
[  173.318685] caller is try_to_wake_up+0x3e4/0x788
[  173.322583]  dump_stack+0x9c/0xc4
[  173.322595]  debug_smp_processor_id+0x148/0x150
[  173.322605]  try_to_wake_up+0x3e4/0x788
[  173.322615]  wake_up_q+0x5c/0x98
[  173.322628]  futex_wake+0x170/0x1a8
[  173.322641]  do_futex+0x560/0xf30
[  173.358367]  __arm64_sys_futex+0xfc/0x148
[  173.362397]  el0_svc_common.constprop.0+0x64/0x188
[  173.367199]  el0_svc_handler+0x28/0x78
[  173.370956]  el0_svc+0x8/0xc

Reverting aacedf26fb76 ("sched/core: Optimize try_to_wake_up() for
local wakeups") seems to quiet down these warnings.

I've just bisected this down (and am about to crash for the night), so
I've not had much time to look at what a fix might be, but I wanted to
raise it with you.

If you have suggestions for patches to try, I'll happily do so in the morning!

thanks
-john

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

* Re: [GIT PULL] scheduler changes for v5.3
  2019-07-10  5:48 ` John Stultz
@ 2019-07-10 10:57   ` Peter Zijlstra
  2019-07-10 15:45     ` John Stultz
  2019-07-13 11:13     ` [tip:sched/urgent] sched/core: Fix preempt warning in ttwu tip-bot for Peter Zijlstra
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Zijlstra @ 2019-07-10 10:57 UTC (permalink / raw)
  To: John Stultz
  Cc: Ingo Molnar, Linus Torvalds, Linux Kernel Mailing List,
	Thomas Gleixner, Andrew Morton

On Tue, Jul 09, 2019 at 10:48:49PM -0700, John Stultz wrote:
> On Mon, Jul 8, 2019 at 9:33 AM Ingo Molnar <mingo@kernel.org> wrote:
> > Please pull the latest sched-core-for-linus git tree from:
> >
> >    git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-core-for-linus
> ....
> > Peter Zijlstra (1):
> >       sched/core: Optimize try_to_wake_up() for local wakeups
> 
> Hey Peter, Ingo,
>    Since this change landed in Linus' tree, I've been seeing a lot of
> the following dmesg noise when running AOSP on the HiKey960 board.
> 
> [  173.162712] CPU: 2 PID: 731 Comm: ndroid.systemui Tainted: G S
>           5.2.0-rc5-00110-g6751c43d94d6 #447
> [  173.162721] Hardware name: HiKey960 (DT)
> [  173.171194] caller is try_to_wake_up+0x3e4/0x788
> [  173.179605] Call trace:
> [  173.179617]  dump_backtrace+0x0/0x140
> [  173.179626]  show_stack+0x14/0x20
> [  173.179638]  dump_stack+0x9c/0xc4
> [  173.179649]  debug_smp_processor_id+0x148/0x150
> [  173.179659]  try_to_wake_up+0x3e4/0x788
> [  173.179669]  wake_up_q+0x5c/0x98
> [  173.179681]  futex_wake+0x170/0x1a8
> [  173.179696]  do_futex+0x560/0xf30
> [  173.284541]  __arm64_sys_futex+0xfc/0x148
> [  173.288570]  el0_svc_common.constprop.0+0x64/0x188
> [  173.293371]  el0_svc_handler+0x28/0x78
> [  173.297131]  el0_svc+0x8/0xc
> [  173.300045] CPU: 0 PID: 1258 Comm: Binder:363_5 Tainted: G S
>         5.2.0-rc5-00110-g6751c43d94d6 #447
> [  173.301130] BUG: using smp_processor_id() in preemptible [00000000]
> code: ndroid.systemui/731
> [  173.310074] Hardware name: HiKey960 (DT)
> [  173.310084] Call trace:
> [  173.310112]  dump_backtrace+0x0/0x140
> [  173.310131]  show_stack+0x14/0x20
> [  173.318685] caller is try_to_wake_up+0x3e4/0x788
> [  173.322583]  dump_stack+0x9c/0xc4
> [  173.322595]  debug_smp_processor_id+0x148/0x150
> [  173.322605]  try_to_wake_up+0x3e4/0x788
> [  173.322615]  wake_up_q+0x5c/0x98
> [  173.322628]  futex_wake+0x170/0x1a8
> [  173.322641]  do_futex+0x560/0xf30
> [  173.358367]  __arm64_sys_futex+0xfc/0x148
> [  173.362397]  el0_svc_common.constprop.0+0x64/0x188
> [  173.367199]  el0_svc_handler+0x28/0x78
> [  173.370956]  el0_svc+0x8/0xc
> 

Urgh.. however didn't we find that before :/ stupid stats.

Something like the below ought to fix, but let me see if I can come up
with something saner...

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 108449526f11..0b22e55cebe8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2399,6 +2399,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 	unsigned long flags;
 	int cpu, success = 0;
 
+	preempt_disable();
 	if (p == current) {
 		/*
 		 * We're waking current, this means 'p->on_rq' and 'task_cpu(p)
@@ -2412,7 +2413,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 		 *    it disabling IRQs (this allows not taking ->pi_lock).
 		 */
 		if (!(p->state & state))
-			return false;
+			goto out;
 
 		success = 1;
 		cpu = task_cpu(p);
@@ -2526,6 +2527,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 out:
 	if (success)
 		ttwu_stat(p, cpu, wake_flags);
+	preempt_enable();
 
 	return success;
 }

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

* Re: [GIT PULL] scheduler changes for v5.3
  2019-07-10 10:57   ` Peter Zijlstra
@ 2019-07-10 15:45     ` John Stultz
  2019-07-13  9:22       ` Ingo Molnar
  2019-07-13 11:13     ` [tip:sched/urgent] sched/core: Fix preempt warning in ttwu tip-bot for Peter Zijlstra
  1 sibling, 1 reply; 7+ messages in thread
From: John Stultz @ 2019-07-10 15:45 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Linus Torvalds, Linux Kernel Mailing List,
	Thomas Gleixner, Andrew Morton

On Wed, Jul 10, 2019 at 3:57 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> Urgh.. however didn't we find that before :/ stupid stats.
>
> Something like the below ought to fix, but let me see if I can come up
> with something saner...

Yep. This works for me, but let me know if you have anything else you
want me to test as well.

thanks again!
-john

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

* Re: [GIT PULL] scheduler changes for v5.3
  2019-07-10 15:45     ` John Stultz
@ 2019-07-13  9:22       ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2019-07-13  9:22 UTC (permalink / raw)
  To: John Stultz
  Cc: Peter Zijlstra, Linus Torvalds, Linux Kernel Mailing List,
	Thomas Gleixner, Andrew Morton


* John Stultz <john.stultz@linaro.org> wrote:

> On Wed, Jul 10, 2019 at 3:57 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > Urgh.. however didn't we find that before :/ stupid stats.
> >
> > Something like the below ought to fix, but let me see if I can come up
> > with something saner...
> 
> Yep. This works for me, but let me know if you have anything else you
> want me to test as well.

No, that's perfect, will get this fix to Linus ASAP, thanks for the help!

	Ingo

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

* [tip:sched/urgent] sched/core: Fix preempt warning in ttwu
  2019-07-10 10:57   ` Peter Zijlstra
  2019-07-10 15:45     ` John Stultz
@ 2019-07-13 11:13     ` tip-bot for Peter Zijlstra
  1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Peter Zijlstra @ 2019-07-13 11:13 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, peterz, hpa, john.stultz, akpm, torvalds, mingo, linux-kernel

Commit-ID:  e3d85487fba42206024bc3ed32e4b581c7cb46db
Gitweb:     https://git.kernel.org/tip/e3d85487fba42206024bc3ed32e4b581c7cb46db
Author:     Peter Zijlstra <peterz@infradead.org>
AuthorDate: Wed, 10 Jul 2019 12:57:36 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 13 Jul 2019 11:23:27 +0200

sched/core: Fix preempt warning in ttwu

John reported a DEBUG_PREEMPT warning caused by commit:

  aacedf26fb76 ("sched/core: Optimize try_to_wake_up() for local wakeups")

I overlooked that ttwu_stat() requires preemption disabled.

Reported-by: John Stultz <john.stultz@linaro.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: aacedf26fb76 ("sched/core: Optimize try_to_wake_up() for local wakeups")
Link: https://lkml.kernel.org/r/20190710105736.GK3402@hirez.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index fa43ce3962e7..2b037f195473 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2399,6 +2399,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 	unsigned long flags;
 	int cpu, success = 0;
 
+	preempt_disable();
 	if (p == current) {
 		/*
 		 * We're waking current, this means 'p->on_rq' and 'task_cpu(p)
@@ -2412,7 +2413,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 		 *    it disabling IRQs (this allows not taking ->pi_lock).
 		 */
 		if (!(p->state & state))
-			return false;
+			goto out;
 
 		success = 1;
 		cpu = task_cpu(p);
@@ -2526,6 +2527,7 @@ unlock:
 out:
 	if (success)
 		ttwu_stat(p, cpu, wake_flags);
+	preempt_enable();
 
 	return success;
 }

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

end of thread, other threads:[~2019-07-13 11:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 11:53 [GIT PULL] scheduler changes for v5.3 Ingo Molnar
2019-07-09  1:45 ` pr-tracker-bot
2019-07-10  5:48 ` John Stultz
2019-07-10 10:57   ` Peter Zijlstra
2019-07-10 15:45     ` John Stultz
2019-07-13  9:22       ` Ingo Molnar
2019-07-13 11:13     ` [tip:sched/urgent] sched/core: Fix preempt warning in ttwu tip-bot for Peter Zijlstra

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).