linux-stable/drivers
Matthew Wilcox (Oracle) f9bff0e318 minmax: add in_range() macro
Patch series "New page table range API", v6.

This patchset changes the API used by the MM to set up page table entries.
The four APIs are:

    set_ptes(mm, addr, ptep, pte, nr)
    update_mmu_cache_range(vma, addr, ptep, nr)
    flush_dcache_folio(folio) 
    flush_icache_pages(vma, page, nr)

flush_dcache_folio() isn't technically new, but no architecture
implemented it, so I've done that for them.  The old APIs remain around
but are mostly implemented by calling the new interfaces.

The new APIs are based around setting up N page table entries at once. 
The N entries belong to the same PMD, the same folio and the same VMA, so
ptep++ is a legitimate operation, and locking is taken care of for you. 
Some architectures can do a better job of it than just a loop, but I have
hesitated to make too deep a change to architectures I don't understand
well.

One thing I have changed in every architecture is that PG_arch_1 is now a
per-folio bit instead of a per-page bit when used for dcache clean/dirty
tracking.  This was something that would have to happen eventually, and it
makes sense to do it now rather than iterate over every page involved in a
cache flush and figure out if it needs to happen.

The point of all this is better performance, and Fengwei Yin has measured
improvement on x86.  I suspect you'll see improvement on your architecture
too.  Try the new will-it-scale test mentioned here:
https://lore.kernel.org/linux-mm/20230206140639.538867-5-fengwei.yin@intel.com/
You'll need to run it on an XFS filesystem and have
CONFIG_TRANSPARENT_HUGEPAGE set.

This patchset is the basis for much of the anonymous large folio work
being done by Ryan, so it's received quite a lot of testing over the last
few months.


This patch (of 38):

Determine if a value lies within a range more efficiently (subtraction +
comparison vs two comparisons and an AND).  It also has useful (under some
circumstances) behaviour if the range exceeds the maximum value of the
type.  Convert all the conflicting definitions of in_range() within the
kernel; some can use the generic definition while others need their own
definition.

Link: https://lkml.kernel.org/r/20230802151406.3735276-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20230802151406.3735276-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-08-24 16:20:18 -07:00
..
accel Memory leak fixes in drm/client, memory access/leak fixes for 2023-07-21 12:14:05 +10:00
accessibility
acpi mm/memory_hotplug: allow memmap on memory hotplug request to fallback 2023-08-21 13:37:48 -07:00
amba
android
ata ata: libata-core: fix when to fetch sense data for successful commands 2023-07-28 11:30:34 +09:00
atm
auxdisplay drm changes for 6.5-rc1: 2023-06-29 11:00:17 -07:00
base mm,thp: fix nodeN/meminfo output alignment 2023-08-21 13:38:01 -07:00
bcma
block A patch to reduce the potential for erroneous RBD exclusive lock 2023-07-28 10:47:24 -07:00
bluetooth Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014 2023-07-20 11:26:56 -07:00
bus SoC fixes for 6.5, part 1 2023-07-06 09:56:53 -07:00
cdrom cdrom/gdrom: Fix build error 2023-06-29 08:09:31 -06:00
cdx cdx: Replace custom mcdi logging with print_hex_dump_debug() 2023-06-15 13:42:16 +02:00
char tpm_tis: Explicitly check for error code 2023-07-28 18:13:39 +00:00
clk Another set of clk driver updates and fixes for the merge window. The 2023-07-04 11:07:45 -07:00
clocksource RISC-V Patches for the 6.5 Merge Window, Part 1 2023-06-30 09:37:26 -07:00
comedi comedi: make all 'class' structures const 2023-06-23 10:29:02 +02:00
connector
counter First set of Counter updates for the 6.5 cycle 2023-06-15 13:07:59 +02:00
cpufreq cpufreq: sparc: Don't mark cpufreq callbacks with __init 2023-07-12 12:45:18 +02:00
cpuidle
crypto s390 updates for 6.5 merge window part 2 2023-07-06 13:18:30 -07:00
cxl cxl/acpi: Return 'rc' instead of '0' in cxl_parse_cfmws() 2023-07-18 11:55:09 -06:00
dax memory tier: rename destroy_memory_type() to put_memory_type() 2023-08-18 10:12:11 -07:00
dca
devfreq
dio
dma dmaengine updates for v6.5 2023-07-06 09:48:31 -07:00
dma-buf dma-buf/dma-resv: Stop leaking on krealloc() failure 2023-07-15 13:57:30 +02:00
edac - Add initial support for RAS hardware found on AMD server GPUs (MI200). 2023-06-26 15:09:18 -07:00
eisa
extcon
firewire firewire: net: fix use after free in fwnet_finish_incoming_packet() 2023-06-24 14:03:46 +09:00
firmware Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
fpga Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
fsi
gnss
gpio gpio: mvebu: fix irq domain leak 2023-07-20 14:38:36 +02:00
gpu minmax: add in_range() macro 2023-08-24 16:20:18 -07:00
greybus
hid for-linus-2023071101 2023-07-12 11:56:22 -07:00
hsi
hte
hv x86/hyperv: Fix hyperv_pcpu_input_arg handling when CPUs go online/offline 2023-06-17 23:09:47 +00:00
hwmon hwmon: (k10temp) Enable AMD3255 Proc to show negative temperature 2023-07-27 09:41:07 -07:00
hwspinlock hwspinlock: omap: drop of_match_ptr for ID table 2023-06-14 08:15:24 -07:00
hwtracing Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
i2c Part 2 of I2C patches for 6.5 2023-07-08 12:28:00 -07:00
i3c
idle Revert "intel_idle: Add support for using intel_idle in a VM guest using just hlt" 2023-07-19 20:10:03 +02:00
iio driver core changes for 6.5-rc1 2023-07-03 12:56:23 -07:00
infiniband RDMA/irdma: Report correct WC error 2023-07-26 14:58:42 +03:00
input ARM: SoC changes for 6.5 2023-06-29 15:28:33 -07:00
interconnect Merge branch 'icc-qos' into icc-next 2023-06-10 10:43:50 +03:00
iommu mmu_notifiers: rename invalidate_range notifier 2023-08-18 10:12:41 -07:00
ipack
irqchip - Work around an erratum on GIC700, where a race between a CPU 2023-07-30 10:59:19 -07:00
isdn
leds - New Drivers 2023-07-03 11:26:05 -07:00
macintosh macintosh: Use of_property_read_reg() to parse "reg" 2023-06-21 14:08:54 +10:00
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-06-30 17:35:45 -05:00
mcb
md dm cache policy smq: ensure IO doesn't prevent cleaner policy progress 2023-07-25 11:55:50 -04:00
media media: verisilicon: change confusingly named relaxed register access 2023-07-14 09:14:10 +02:00
memory asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-06-12 15:16:19 +02:00
message
mfd - New Drivers 2023-07-03 10:55:04 -07:00
misc mmu_notifiers: rename invalidate_range notifier 2023-08-18 10:12:41 -07:00
mmc mmc: Revert "mmc: core: Allow mmc_start_host() synchronously detect a card" 2023-06-30 14:06:51 +02:00
most
mtd Core MTD changes: 2023-06-28 14:02:03 -07:00
mux mux: adg792a: Switch back to use i2c_driver's .probe() 2023-06-15 13:42:18 +02:00
net minmax: add in_range() macro 2023-08-24 16:20:18 -07:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-22 18:40:38 -07:00
ntb ntb: hw: amd: Fix debugfs_create_dir error checking 2023-07-08 13:55:44 -04:00
nubus
nvdimm mm/hugepage pud: allow arch-specific helper function to check huge page pud support 2023-08-18 10:12:53 -07:00
nvme SCSI fixes on 20230714 2023-07-14 19:57:29 -07:00
nvmem nvmem: rmem: Use NVMEM_DEVID_AUTO 2023-06-15 13:42:18 +02:00
of of: Preserve "of-display" device name for compatibility 2023-07-11 16:33:01 -06:00
opp OPP: Properly propagate error along when failing to get icc_path 2023-06-27 07:35:14 +05:30
parisc parisc: Move init function declarations into header file 2023-06-30 17:14:15 +02:00
parport Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
pci Fixes for pci_clean_master, error handling in driver inits, and various 2023-07-09 09:35:51 -07:00
pcmcia pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-06-15 13:42:18 +02:00
peci
perf perf: RISC-V: Remove PERF_HES_STOPPED flag checking in riscv_pmu_start() 2023-07-12 07:41:23 -07:00
phy phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() 2023-07-24 16:23:37 +05:30
pinctrl pinctrl: renesas: Fixes for v6.5 2023-07-13 00:05:52 +02:00
platform platform/x86: huawei-wmi: Silence ambient light sensor 2023-07-25 16:38:03 +02:00
pnp
power power supply and reset changes for the 6.5 series 2023-07-03 17:23:16 -07:00
powercap ARM: SoC drivers for 6.5 2023-06-29 15:22:19 -07:00
pps
ps3
ptp ptp: Make max_phase_adjustment sysfs device attribute invisible when not supported 2023-07-03 13:17:25 -07:00
pwm pwm: Changes for v6.5-rc1 2023-07-05 12:55:06 -07:00
rapidio
ras
regulator regulator: mt6358: Fix incorrect VCN33 sync error message 2023-07-23 23:40:09 +01:00
remoteproc remoteproc updates for v6.5 2023-07-03 17:03:05 -07:00
reset ARM: SoC drivers for 6.5 2023-06-29 15:22:19 -07:00
rpmsg
rtc RTC for 6.5 2023-07-03 10:43:10 -07:00
s390 block-6.5-2023-07-28 2023-07-28 10:23:41 -07:00
sbus oradax: make 'cl' a static const structure 2023-06-23 10:27:02 +02:00
scsi scsi: sg: Fix checking return value of blk_get_queue() 2023-07-19 23:12:13 -04:00
sh
siox
slimbus
soc USB / Thunderbolt driver updates for 6.5-rc1 2023-07-03 13:23:10 -07:00
soundwire soundwire: amd: Fix a check for errors in probe() 2023-07-13 11:09:07 +05:30
spi spi: spi-qcom-qspi: Add mem_ops to avoid PIO for badly sized reads 2023-07-26 12:47:20 +01:00
spmi
ssb
staging Staging driver fixes for 6.5-rc4 2023-07-30 11:47:56 -07:00
target SCSI misc on 20230708 2023-07-08 12:35:18 -07:00
tc
tee ARM: SoC drivers for 6.5 2023-06-29 15:22:19 -07:00
thermal thermal: of: fix double-free on unregistration 2023-07-24 09:51:31 +02:00
thunderbolt thunderbolt: Add test case for 3 DisplayPort tunnels 2023-06-16 09:53:29 +03:00
tty mm: remove arguments of show_mem() 2023-08-18 10:12:02 -07:00
ufs Merge branch '6.5/scsi-staging' into 6.5/scsi-fixes 2023-07-11 12:15:15 -04:00
uio
usb usb: misc: ehset: fix wrong if condition 2023-07-27 10:37:30 +02:00
vdpa virtio: features, fixes, cleanups 2023-07-03 15:38:26 -07:00
vfio VFIO updates for v6.5-rc1 2023-06-30 15:22:09 -07:00
vhost virtio: features, fixes, cleanups 2023-07-03 15:38:26 -07:00
video fbdev: Explicitly include correct DT includes 2023-07-20 07:56:30 +02:00
virt minmax: add in_range() macro 2023-08-24 16:20:18 -07:00
virtio virtio: allow caller to override device DMA mask in vp_modern 2023-06-27 10:47:08 -04:00
vlynq
w1
watchdog watchdog: sp5100_tco: support Hygon FCH/SCH (Server Controller Hub) 2023-06-26 14:30:07 +02:00
xen xen: speed up grant-table reclaim 2023-07-27 07:53:12 +02:00
zorro
Kconfig
Makefile