linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] smp: don't kick CPUs running idle or nohz_full tasks
@ 2018-04-05 17:17 Yury Norov
  2018-04-05 17:17 ` [PATCH 1/5] arm64: entry: isb in el1_irq Yury Norov
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Yury Norov @ 2018-04-05 17:17 UTC (permalink / raw)
  To: Paul E. McKenney, Mark Rutland, Will Deacon, Chris Metcalf,
	Christopher Lameter, Russell King - ARM Linux, Steven Rostedt,
	Mathieu Desnoyers, Catalin Marinas, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Andrew Morton, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Alexey Klimov
  Cc: Yury Norov, linux-arm-kernel, linuxppc-dev, kvm-ppc, linux-mm,
	linux-kernel

kick_all_cpus_sync() is used to broadcast IPIs to all online CPUs to force
them synchronize caches, TLB etc. It is called only 3 times - from mm/slab
arm64 and powerpc code.

We can delay synchronization work for CPUs in extended quiescent state
(idle or nohz_full userspace). 

As Paul E. McKenney wrote: 

--

Currently, IPIs are used to force other CPUs to invalidate their TLBs
in response to a kernel virtual-memory mapping change.  This works, but 
degrades both battery lifetime (for idle CPUs) and real-time response
(for nohz_full CPUs), and in addition results in unnecessary IPIs due to
the fact that CPUs executing in usermode are unaffected by stale kernel
mappings.  It would be better to cause a CPU executing in usermode to
wait until it is entering kernel mode to do the flush, first to avoid
interrupting usemode tasks and second to handle multiple flush requests
with a single flush in the case of a long-running user task.

--

v2 is big rework to address comments in v1:
 - rcu_eqs_special() declaration in public header is dropped, it is not
   used in new implementation. Though, I hope Paul will pick it in his
   tree;
 - for arm64, few isb() added to ensure kernel text synchronization
   (patches 1-4);
 - rcu_get_eqs_cpus() introduced and used to mask EQS CPUs before 
   generating broadcast IPIs;
 - RCU_DYNTICK_CTRL_MASK is not touched because memory barrier is
   implicitly issued in EQS exit path;
 - powerpc is not an exception anymore. I think it's safe to delay
   synchronization for it as well, and I didn't get comments from ppc
   community.
v1:
  https://lkml.org/lkml/2018/3/25/109

Based on next-20180405

Yury Norov (5):
  arm64: entry: isb in el1_irq
  arm64: entry: introduce restore_syscall_args macro
  arm64: ISB early at exit from extended quiescent state
  rcu: arm64: add rcu_dynticks_eqs_exit_sync()
  smp: Lazy synchronization for EQS CPUs in kick_all_cpus_sync()

 arch/arm64/kernel/Makefile  |  2 ++
 arch/arm64/kernel/entry.S   | 52 +++++++++++++++++++++++++++++++--------------
 arch/arm64/kernel/process.c |  7 ++++++
 arch/arm64/kernel/rcu.c     |  8 +++++++
 include/linux/rcutiny.h     |  2 ++
 include/linux/rcutree.h     |  1 +
 kernel/rcu/tiny.c           |  9 ++++++++
 kernel/rcu/tree.c           | 27 +++++++++++++++++++++++
 kernel/smp.c                | 21 +++++++++++-------
 9 files changed, 105 insertions(+), 24 deletions(-)
 create mode 100644 arch/arm64/kernel/rcu.c

-- 
2.14.1

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

end of thread, other threads:[~2018-04-06 17:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 17:17 [PATCH v2 0/2] smp: don't kick CPUs running idle or nohz_full tasks Yury Norov
2018-04-05 17:17 ` [PATCH 1/5] arm64: entry: isb in el1_irq Yury Norov
2018-04-06 10:02   ` James Morse
2018-04-06 16:54     ` Yury Norov
2018-04-06 17:22       ` Mark Rutland
2018-04-06 17:30         ` James Morse
2018-04-06 17:34           ` Mark Rutland
2018-04-06 17:50         ` Mark Rutland
2018-04-06 10:57   ` Mark Rutland
2018-04-05 17:17 ` [PATCH 2/5] arm64: entry: introduce restore_syscall_args macro Yury Norov
2018-04-05 17:17 ` [PATCH 3/5] arm64: early ISB at exit from extended quiescent state Yury Norov
2018-04-06 10:06   ` James Morse
2018-04-06 11:07   ` Mark Rutland
2018-04-05 17:17 ` [PATCH 4/5] rcu: arm64: add rcu_dynticks_eqs_exit_sync() Yury Norov
2018-04-05 17:18 ` [PATCH 5/5] smp: Lazy synchronization for EQS CPUs in kick_all_cpus_sync() Yury Norov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox