linux/include
David Hildenbrand dc9e6f7053 mm: read page_type using READ_ONCE
KCSAN complains about possible data races: while we check for a page_type
-- for example for sanity checks -- we might concurrently modify the
mapcount that overlays page_type.

Let's use READ_ONCE to avoid load tearing (shouldn't make a difference)
and to make KCSAN happy.

Likely, we might also want to use WRITE_ONCE for the writer side of
page_type, if KCSAN ever complains about that.  But we'll not mess with
that for now.

Note: nothing should really be broken besides wrong KCSAN complaints.  The
sanity check that triggers this was added in commit 68f0320824
("mm/rmap: convert folio_add_file_rmap_range() into
folio_add_file_rmap_[pte|ptes|pmd]()").  Even before that similar races
likely where possible, ever since we added page_type in commit
6e292b9be7 ("mm: split page_type out from _mapcount").

Link: https://lkml.kernel.org/r/20240531125616.2850153-1-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202405281431.c46a3be9-lkp@intel.com
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-07-03 19:30:20 -07:00
..
acpi ACPI: EC: Evaluate orphan _REG under EC device 2024-06-13 11:28:54 +02:00
asm-generic syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
clocksource
crypto This push fixes a bug in the new ecc P521 code as well as a buggy 2024-05-20 08:47:54 -07:00
drm Short summary of fixes pull: 2024-05-27 13:47:14 +10:00
dt-bindings dt-bindings: net: dp8386x: Add MIT license along with GPL-2.0 2024-06-07 12:16:22 +01:00
keys
kunit
kvm
linux mm: read page_type using READ_ONCE 2024-07-03 19:30:20 -07:00
math-emu
media
memory
misc
net netfilter pull request 24-06-27 2024-06-27 13:00:50 +02:00
pcmcia
ras mm/memory-failure: remove MF_MSG_SLAB 2024-07-03 19:30:10 -07:00
rdma The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
rv
scsi scsi: core: Introduce the BLIST_SKIP_IO_HINTS flag 2024-06-13 21:03:13 -04:00
soc I'm actually surprised this time. There aren't any new Qualcomm SoC clk 2024-05-18 12:48:37 -07:00
sound ALSA: dmaengine: Synchronize dma channel after drop() 2024-06-11 17:13:31 +01:00
target
trace mm/migrate: add MR_DAMON to migrate_reason 2024-07-03 19:30:12 -07:00
uapi syscalls: fix compat_sys_io_pgetevents_time64 usage 2024-06-25 15:57:20 +02:00
ufs
vdso
video
xen