linux-uconsole/arch/parisc/kernel
Helge Deller b00a56e647 parisc: Optimize per-pagetable spinlocks
[ Upstream commit b7795074a0 ]

On parisc a spinlock is stored in the next page behind the pgd which
protects against parallel accesses to the pgd. That's why one additional
page (PGD_ALLOC_ORDER) is allocated for the pgd.

Matthew Wilcox suggested that we instead should use a pointer in the
struct page table for this spinlock and noted, that the comments for the
PGD_ORDER and PMD_ORDER defines were wrong.

Both suggestions are addressed with this patch. Instead of having an own
spinlock to protect the pgd, we now switch to use the existing
page_table_lock.  Additionally, beside loading the pgd into cr25 in
switch_mm_irqs_off(), the physical address of this lock is loaded into
cr28 (tr4), so that we can avoid implementing a complicated lookup in
assembly for this lock in the TLB fault handlers.

The existing Hybrid L2/L3 page table scheme (where the pmd is adjacent
to the pgd) has been dropped with this patch.

Remove the locking in set_pte() and the huge-page pte functions too.
They trigger a spinlock recursion on 32bit machines and seem unnecessary.

Suggested-by: Matthew Wilcox <willy@infradead.org>
Fixes: b37d1c1898 ("parisc: Use per-pagetable spinlock")
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Stable-dep-of: 38860b2c8b ("parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-09-23 14:16:56 +02:00
..
syscalls parisc: io_pgetevents_time64() needs compat syscall in 32-bit compat mode 2022-08-21 15:15:23 +02:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
alternative.c parisc: Refactor alternative code to accept multiple conditions 2020-04-05 22:50:40 +02:00
asm-offsets.c parisc: Optimize per-pagetable spinlocks 2022-09-23 14:16:56 +02:00
audit.c
cache.c parisc: Rewrite tlb flush threshold calculation 2020-10-15 08:10:39 +02:00
compat_audit.c
drivers.c parisc: Fix device names in /proc/iomem 2022-08-21 15:15:23 +02:00
entry.S parisc: Optimize per-pagetable spinlocks 2022-09-23 14:16:56 +02:00
firmware.c parisc: firmware: Update references to parisc website 2020-06-01 23:02:11 +02:00
ftrace.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
hardware.c parisc: hardware: Update references to parisc website 2020-06-01 23:02:39 +02:00
head.S parisc: Add runtime check to prevent PA2.0 kernels on PA1.x machines 2022-09-15 11:32:03 +02:00
hpmc.S
inventory.c parisc: Add qemu fw_cfg interface 2020-10-15 08:10:37 +02:00
irq.c parisc: Bump 64-bit IRQ stack size to 64 KB 2021-03-07 12:34:13 +01:00
jump_label.c
kexec.c parisc: add support for kexec_file_load() syscall 2019-09-08 15:41:46 +02:00
kexec_file.c parisc: add support for kexec_file_load() syscall 2019-09-08 15:41:46 +02:00
kgdb.c maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2020-06-17 10:57:41 -07:00
kprobes.c parisc: kprobes: Use generic kretprobe trampoline handler 2020-09-08 11:52:33 +02:00
Makefile parisc: fix compilation when KEXEC=n and KEXEC_FILE=y 2019-12-15 21:05:38 +01:00
module.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
pa7300lc.c
pacache.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
parisc_ksyms.c Revert "parisc: Add assembly implementations for memset, strlen, strcpy, strncpy and strcat" 2021-09-03 10:09:31 +02:00
patch.c parisc: Fix patch code locking and flushing 2022-04-13 21:01:03 +02:00
pci-dma.c dma-mapping: merge <linux/dma-noncoherent.h> into <linux/dma-map-ops.h> 2020-10-06 07:07:06 +02:00
pci.c parisc: Drop comments which are already in pci.h 2019-09-05 16:41:11 +02:00
pdc_chassis.c
pdc_cons.c
pdt.c parisc: Report bad pages as HardwareCorrupted 2020-07-28 11:19:17 +02:00
perf.c parisc/perf: open access for CAP_PERFMON privileged process 2020-04-16 12:19:08 -03:00
perf_asm.S
perf_images.h
process.c sched/idle: Fix arch_cpu_idle() vs tracing 2020-11-24 16:47:35 +01:00
processor.c parisc: Merge model and model name into one line in /proc/cpuinfo 2022-05-12 12:25:29 +02:00
ptrace.c parisc: switch to ->regset_get() 2020-07-27 14:31:12 -04:00
real2.S
relocate_kernel.S parisc: add kexec syscall support 2019-09-08 15:37:04 +02:00
setup.c arch/parisc/setup: Drop dummy_con initialization 2020-01-14 15:29:17 +01:00
signal.c parisc: fix crash with signals and alloca 2021-09-18 13:40:35 +02:00
signal32.c
signal32.h
smp.c parisc/kgdb: add kgdb_roundup() to make kgdb work with idle polling 2021-11-18 14:04:01 +01:00
stacktrace.c
sys_parisc.c parisc: Add wrapper syscalls to fix O_NONBLOCK flag usage 2020-10-23 20:14:07 +02:00
sys_parisc32.c
syscall.S parisc: Correct completer in lws start 2021-12-29 12:26:02 +01:00
time.c parisc: Mark cr16 CPU clocksource unstable on all SMP machines 2021-12-08 09:03:29 +01:00
topology.c
traps.c parisc: Fix handling off probe non-access faults 2022-04-08 14:40:32 +02:00
unaligned.c parisc: Fix exception handler for fldw and fstw instructions 2022-08-31 17:15:13 +02:00
unwind.c parisc/unwind: fix unwinder when CONFIG_64BIT is enabled 2021-11-18 14:04:01 +01:00
vmlinux.lds.S Revert "parisc: Fix backtrace to always include init funtion names" 2021-12-01 09:19:00 +01:00