aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorShakeel Butt <[email protected]>2025-04-10 02:57:52 +0000
committerAndrew Morton <[email protected]>2025-05-12 00:48:29 +0000
commit60cada258dfe3694e15c4539259173c37bd5f1fe (patch)
tree7ef3182c77476b51813979d6fce4c215e008b73f /mm/hugetlb.c
parentselftests/mm: restore default nr_hugepages value during cleanup in hugetlb_re... (diff)
downloadkernel-60cada258dfe3694e15c4539259173c37bd5f1fe.tar.gz
kernel-60cada258dfe3694e15c4539259173c37bd5f1fe.zip
memcg: optimize memcg_rstat_updated
Currently the kernel maintains the stats updates per-memcg which is needed to implement stats flushing threshold. On the update side, the update is added to the per-cpu per-memcg update of the given memcg and all of its ancestors. However when the given memcg has passed the flushing threshold, all of its ancestors should have passed the threshold as well. There is no need to traverse up the memcg tree to maintain the stats updates. Perf profile collected from our fleet shows that memcg_rstat_updated is one of the most expensive memcg function i.e. a lot of cumulative CPU is being spent on it. So, even small micro optimizations matter a lot. This patch is microbenchmarked with multiple instances of netperf on a single machine with locally running netserver and we see couple of percentage of improvement. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Shakeel Butt <[email protected]> Acked-by: Roman Gushchin <[email protected]> Reviewed-by: Yosry Ahmed <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Muchun Song <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/hugetlb.c')
0 files changed, 0 insertions, 0 deletions