linux/tools/include/linux
Liam R. Howlett 099d7439ce maple_tree: add GFP_KERNEL to allocations in mas_expected_entries()
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>
2023-10-18 12:12:41 -07: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 tools/include: Update atomic definitions 2022-02-20 08:44:37 +02:00
bitfield.h tools: Copy bitfield.h from the kernel sources 2022-11-10 19:10:27 +00:00
bitmap.h tools: Drop conflicting non-atomic test_and_{clear,set}_bit() helpers 2022-12-02 13:22:34 -05:00
bitops.h bitops: wrap non-atomic bitops with a transparent macro 2022-06-30 19:52:41 -07:00
bits.h tools headers: Synchronize {linux,vdso}/bits.h with the kernel sources 2023-03-03 22:34:15 -03:00
btf_ids.h bpf: Fix BTF_ID symbol generation collision in tools/ 2023-09-15 12:08:27 -07:00
bug.h
build_bug.h tools headers: Syncronize linux/build_bug.h with the kernel sources 2023-01-18 10:31:11 -03:00
cache.h tools/include: Add cache.h stub 2022-02-20 08:44:37 +02:00
compiler_types.h perf tools: Fix compile error for x86 2022-08-22 09:44:19 -07:00
compiler-gcc.h tools: Rename __fallthrough to fallthrough 2023-04-06 21:41:00 -03:00
compiler.h tools include: Add some common function attributes 2023-08-04 17:36:52 +01:00
const.h linux/bits.h: fix compilation error with GENMASK 2021-05-22 15:09:07 -10:00
coresight-pmu.h perf cs-etm: Copy kernel coresight-pmu.h header 2023-05-26 16:03:27 -03:00
ctype.h tools headers: Update linux/ctype.h with the kernel sources 2020-12-18 17:32:28 -03:00
debugfs.h tools/include: Add debugfs.h stub 2022-02-20 08:44:37 +02:00
delay.h
err.h docs: move x86 documentation into Documentation/arch/ 2023-03-30 12:58:51 -06:00
export.h module: remove EXPORT_UNUSED_SYMBOL* 2021-02-08 12:28:07 +01:00
filter.h bpf: Add bitwise atomic instructions 2021-01-14 18:34:29 -08:00
find.h tools: sync find_bit() implementation 2022-09-21 12:21:44 -07:00
ftrace.h
gfp_types.h tools: fix compilation after gfp_types.h split 2022-09-11 16:22:31 -07:00
gfp.h tools: fix compilation after gfp_types.h split 2022-09-11 16:22:31 -07:00
hash.h hash.h: remove unused define directive 2022-01-20 08:52:54 +02:00
hashtable.h
interrupt.h
interval_tree_generic.h objtool: Fix find_{symbol,func}_containing() 2022-10-17 16:41:08 +02:00
io.h tools/include: Add io.h stub 2022-02-20 08:44:37 +02:00
jhash.h tools/: replace HTTP links with HTTPS ones 2020-08-07 11:33:21 -07:00
kallsyms.h kallsyms: increase maximum kernel symbol length to 512 2022-09-28 08:56:25 +02:00
kconfig.h tools headers: Remove broken definition of __LITTLE_ENDIAN 2021-07-14 14:39:36 -03:00
kern_levels.h
kernel.h tools/include: Add _RET_IP_ and math definitions to kernel.h 2022-02-20 08:44:37 +02:00
linkage.h
list_sort.h tools lib: Adopt list_sort() from the kernel sources 2021-10-20 10:30:59 -03:00
list.h tools lib: Add list_last_entry_or_null() 2022-07-26 16:02:13 -03:00
log2.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
math64.h tools include: Add an initial math64.h 2021-04-15 16:38:02 -03:00
math.h tools: Fix math.h breakage 2021-11-30 09:14:42 -08:00
mm.h memblock tests: fix warning: "__ALIGN_KERNEL" redefined 2023-09-14 09:26:14 +03:00
module.h
mutex.h
nmi.h
numa.h tools/: replace open encodings for NUMA_NO_NODE 2019-03-05 21:07:14 -08:00
objtool_types.h x86,objtool: Split UNWIND_HINT_EMPTY in two 2023-03-23 23:18:58 +01:00
overflow.h compiler.h: drop fallback overflow checkers 2021-09-13 10:18:28 -07:00
pfn.h tools/include: Add pfn.h stub 2022-02-20 08:44:37 +02:00
poison.h mm, page_poison: remove CONFIG_PAGE_POISONING_ZERO 2020-12-15 12:13:46 -08:00
rbtree_augmented.h docs: Add rbtree documentation to the core-api 2020-04-21 10:29:19 -06:00
rbtree.h rbtree: Add generic add and find helpers 2021-02-17 14:07:31 +01:00
rcu.h rcu: Don't return a value from rcu_assign_pointer() 2019-06-13 15:38:34 -07:00
refcount.h
ring_buffer.h tools headers: Add missing perf_event.h include 2019-08-22 11:12:36 -03:00
rwsem.h maple_tree: add GFP_KERNEL to allocations in mas_expected_entries() 2023-10-18 12:12:41 -07:00
seq_file.h memblock tests: fix warning ‘struct seq_file’ declared inside parameter list 2023-09-14 10:51:28 +03:00
sizes.h tools: bpftool: add "prog run" subcommand to test-run programs 2019-07-05 23:48:07 +02:00
slab.h radix tree test suite: add support for slab bulk APIs 2022-09-26 19:46:14 -07:00
spinlock.h tools/lib/lockdep: drop leftover liblockdep headers 2021-12-09 09:37:49 -08:00
static_call_types.h static_call: Move struct static_call_key definition to static_call_types.h 2021-03-11 16:04:39 +01:00
string.h tools lib: Adopt memchr_inv() from kernel 2020-11-27 08:34:52 -03:00
stringify.h
time64.h
types.h tools/virtio: fix build caused by virtio_ring changes 2023-04-21 03:02:35 -04:00
zalloc.h tools lib: Adopt zalloc()/zfree() from tools/perf 2019-07-09 10:13:26 -03:00