linux_dsm_epyc7002/arch/powerpc
Mathieu Desnoyers 3ccfebedd8 powerpc, membarrier: Skip memory barrier in switch_mm()
Allow PowerPC to skip the full memory barrier in switch_mm(), and
only issue the barrier when scheduling into a task belonging to a
process that has registered to use expedited private.

Threads targeting the same VM but which belong to different thread
groups is a tricky case. It has a few consequences:

It turns out that we cannot rely on get_nr_threads(p) to count the
number of threads using a VM. We can use
(atomic_read(&mm->mm_users) == 1 && get_nr_threads(p) == 1)
instead to skip the synchronize_sched() for cases where the VM only has
a single user, and that user only has a single thread.

It also turns out that we cannot use for_each_thread() to set
thread flags in all threads using a VM, as it only iterates on the
thread group.

Therefore, test the membarrier state variable directly rather than
relying on thread flags. This means
membarrier_register_private_expedited() needs to set the
MEMBARRIER_STATE_PRIVATE_EXPEDITED flag, issue synchronize_sched(), and
only then set MEMBARRIER_STATE_PRIVATE_EXPEDITED_READY which allows
private expedited membarrier commands to succeed.
membarrier_arch_switch_mm() now tests for the
MEMBARRIER_STATE_PRIVATE_EXPEDITED flag.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andrea Parri <parri.andrea@gmail.com>
Cc: Andrew Hunter <ahh@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Avi Kivity <avi@scylladb.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Dave Watson <davejwatson@fb.com>
Cc: David Sehr <sehr@google.com>
Cc: Greg Hackmann <ghackmann@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Maged Michael <maged.michael@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-api@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20180129202020.8515-3-mathieu.desnoyers@efficios.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-02-05 21:34:02 +01:00
..
boot powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
configs irqdomain: Kill CONFIG_IRQ_DOMAIN_DEBUG 2018-01-24 12:32:58 +01:00
crypto
include powerpc, membarrier: Skip memory barrier in switch_mm() 2018-02-05 21:34:02 +01:00
kernel powerpc/64s: Allow control of RFI flush via debugfs 2018-01-17 23:30:21 +11:00
kvm KVM: PPC: Book3S: Provide information about hardware/firmware CVE workarounds 2018-01-19 15:17:01 +11:00
lib powerpc/64s: Add support for RFI flush of L1-D cache 2018-01-10 21:27:06 +11:00
math-emu
mm powerpc, membarrier: Skip memory barrier in switch_mm() 2018-02-05 21:34:02 +01:00
net bpf, ppc64: do not reload skb pointers in non-skb context 2017-12-15 09:19:35 -08:00
oprofile treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
perf powerpc/perf: Fix kfree memory allocated for nest pmus 2017-12-13 20:51:22 +11:00
platforms powerpc/powernv: Check device-tree for RFI flush settings 2018-01-10 21:27:16 +11:00
purgatory
sysdev kernel/irq: Extend lockdep class for request mutex 2017-12-28 12:26:35 +01:00
tools
xmon powerpc/xmon: Don't print hashed pointers in paca dump 2018-01-11 01:17:24 +11:00
Kconfig powerpc, membarrier: Skip memory barrier in switch_mm() 2018-02-05 21:34:02 +01:00
Kconfig.debug powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
Makefile
Makefile.postlink