linux-stable/tools
Liam R. Howlett 11bc9f5c70 maple_tree: add GFP_KERNEL to allocations in mas_expected_entries()
commit 099d7439ce upstream.

Users complained about OOM errors during fork without triggering
compaction.  This can be fixed by modifying the flags used in
mas_expected_entries() so that the compaction will be triggered in low
memory situations.  Since mas_expected_entries() is only used during fork,
the extra argument does not need to be passed through.

Additionally, the two test_maple_tree test cases and one benchmark test
were altered to use the correct locking type so that allocations would not
trigger sleeping and thus fail.  Testing was completed with lockdep atomic
sleep detection.

The additional locking change requires rwsem support additions to the
tools/ directory through the use of pthreads pthread_rwlock_t.  With this
change test_maple_tree works in userspace, as a module, and in-kernel.

Users may notice that the system gave up early on attempting to start new
processes instead of attempting to reclaim memory.

Link: https://lkml.kernel.org/r/20230915093243epcms1p46fa00bbac1ab7b7dca94acb66c44c456@epcms1p4
Link: https://lkml.kernel.org/r/20231012155233.2272446-1-Liam.Howlett@oracle.com
Fixes: 54a611b605 ("Maple Tree: add new data structure")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: <jason.sim@samsung.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-02 09:36:48 +01:00
..
accounting
arch asm-generic: regression fix for 6.5 2023-08-18 18:13:36 +02:00
bootconfig
bpf bpftool: Use a local bpf_perf_event_value to fix accessing its fields 2023-09-13 09:53:02 +02:00
build perf build: Update build rule for generated files 2023-09-19 12:30:26 +02:00
certs
cgroup
counter tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure 2023-07-24 10:29:52 -04:00
debugging
edid
firewire
firmware
gpio
hv vmbus_testing: fix wrong python syntax for integer value comparison 2023-07-23 23:19:30 +00:00
iio tools: iio: iio_generic_buffer: Fix some integer type and calculation 2023-09-23 11:14:28 +02:00
include maple_tree: add GFP_KERNEL to allocations in mas_expected_entries() 2023-11-02 09:36:48 +01:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Free btf_vmlinux when closing bpf_object 2023-09-23 11:14:22 +02:00
memory-model
mm tools/mm: fix undefined reference to pthread_once 2023-09-19 12:30:13 +02:00
net/ynl tools: ynl-gen: fix parse multi-attr enum attribute 2023-07-26 13:38:23 -07:00
objtool objtool: Fix _THIS_IP_ detection for cold functions 2023-10-06 13:16:12 +02:00
pci
pcmcia
perf perf dlfilter: Fix use of addr_location__exit() in dlfilter__object_code() 2023-10-25 12:16:22 +02:00
power platform-drivers-x86 for v6.5-1 2023-06-30 14:50:00 -07:00
rcu
scripts
spi
testing selftests/mm: include mman header to access MREMAP_DONTUNMAP identifier 2023-11-02 09:36:48 +01:00
thermal
time
tracing rtla/timerlat: Do not stop user-space if a cpu is offline 2023-10-10 22:03:00 +02:00
usb
verification
virtio tools/virtio: fix build break for aarch64 2023-06-27 10:47:08 -04:00
wmi
workqueue
Makefile