android_kernel_msm-6.1_noth.../tools/include/linux
Liam R. Howlett 3262ff5826 maple_tree: add GFP_KERNEL to allocations in mas_expected_entries()
commit 099d7439ce03d0e7bc8f0c3d7878b562f3a48d3d 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:35:24 +01:00
..
sched XArray: Add calls to might_alloc() 2022-07-10 21:17:30 -04:00
unaligned
arm-smccc.h tools: Import ARM SMCCC definitions 2022-05-03 21:30:19 +01:00
atomic.h
bitmap.h Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
bitops.h bitops: wrap non-atomic bitops with a transparent macro 2022-06-30 19:52:41 -07:00
bits.h
btf_ids.h bpf: Fix BTF_ID symbol generation collision in tools/ 2023-10-06 14:57:04 +02:00
bug.h
build_bug.h
cache.h
compiler-gcc.h
compiler.h tools compiler.h: Remove duplicate #ifndef noinline block 2022-03-12 11:00:57 -03:00
compiler_types.h perf tools: Fix compile error for x86 2022-08-22 09:44:19 -07:00
const.h
coresight-pmu.h
ctype.h
debugfs.h tools/include: Add debugfs.h stub 2022-02-20 08:44:37 +02:00
delay.h
err.h
export.h
filter.h
find.h tools: sync find_bit() implementation 2022-09-21 12:21:44 -07:00
ftrace.h
gfp.h tools: fix compilation after gfp_types.h split 2022-09-11 16:22:31 -07:00
gfp_types.h tools: fix compilation after gfp_types.h split 2022-09-11 16:22:31 -07:00
hash.h
hashtable.h
interrupt.h
io.h
jhash.h
kallsyms.h kallsyms: increase maximum kernel symbol length to 512 2022-09-28 08:56:25 +02:00
kconfig.h
kern_levels.h
kernel.h
linkage.h
list.h tools lib: Add list_last_entry_or_null() 2022-07-26 16:02:13 -03:00
list_sort.h
log2.h
math.h
math64.h
mm.h memblock tests: fix warning: "__ALIGN_KERNEL" redefined 2023-10-06 14:56:56 +02:00
module.h
mutex.h
nmi.h
numa.h
objtool.h This was a moderately busy cycle for documentation, but nothing all that 2022-08-02 19:24:24 -07:00
overflow.h
pfn.h tools/include: Add pfn.h stub 2022-02-20 08:44:37 +02:00
poison.h
rbtree.h
rbtree_augmented.h
rcu.h
refcount.h
ring_buffer.h
rwsem.h maple_tree: add GFP_KERNEL to allocations in mas_expected_entries() 2023-11-02 09:35:24 +01:00
seq_file.h memblock tests: fix warning ‘struct seq_file’ declared inside parameter list 2023-10-06 14:56:56 +02:00
sizes.h
slab.h radix tree test suite: add support for slab bulk APIs 2022-09-26 19:46:14 -07:00
spinlock.h
static_call_types.h
string.h
stringify.h
time64.h
types.h memblock: test suite and a small cleanup 2022-03-27 13:36:06 -07:00
zalloc.h