mirror-linux/include
Thomas Gleixner ec45783fce memcg: optimize exit to user space
memcg uses TIF_NOTIFY_RESUME to handle reclaiming on exit to user space. 
TIF_NOTIFY_RESUME is a multiplexing TIF bit, which is utilized by other
entities as well.

This results in a unconditional mem_cgroup_handle_over_high() call for
every invocation of resume_user_mode_work(), which is a pointless exercise
as most of the time there is no reclaim work to do.

Especially since RSEQ is used by glibc, TIF_NOTIFY_RESUME is raised quite
frequently and the empty calls show up in exit path profiling.

Optimize this by doing a quick check of the reclaim condition before
invoking it.

[akpm@linux-foundation.org: remove now-unneeded test of memcg_nr_pages_over_high==0, per Shakeel]
Link: https://lkml.kernel.org/r/87tt2b6zgs.ffs@tglx
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-09-13 16:55:01 -07:00
..
acpi mailbox/pcc: support mailbox management of the shared buffer 2025-08-07 23:49:56 -05:00
asm-generic Deferred unwind changes for 6.17 2025-08-01 09:46:24 -07:00
clocksource
crypto This push fixes a regression that breaks hmac(sha3-224-s390). 2025-08-09 07:26:19 +03:00
cxl
drm drm/gpuvm: fix various typos in .c and .h gpuvm file 2025-08-25 21:48:50 +02:00
dt-bindings Pin control changes for v6.17 2025-08-02 12:07:09 -07:00
hyperv
keys
kunit
kvm
linux memcg: optimize exit to user space 2025-09-13 16:55:01 -07:00
math-emu
media
memory
misc
net net: rose: convert 'use' field to refcount_t 2025-08-27 07:43:08 -07:00
pcmcia
ras
rdma
rv
scsi
soc
sound ASoC: Fixes for v6.17 2025-08-21 09:02:28 +02:00
target
trace tracing changes for 6.17 2025-08-01 10:29:36 -07:00
uapi mempolicy: clarify what zone reclaim means 2025-09-13 16:54:41 -07:00
ufs
vdso
video
xen Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
Kbuild