summaryrefslogtreecommitdiff
path: root/mm/userfaultfd.c
diff options
context:
space:
mode:
authorAlexander Halbuer <halbuer@sra.uni-hannover.de>2023-02-01 17:25:49 +0100
committerAndrew Morton <akpm@linux-foundation.org>2023-03-28 16:20:06 -0700
commit2ede3c13be889900f8f5c04b5dc6298201d835c4 (patch)
tree488e83a1d0a8e5cb9da1de43de60b2f03b95ea78 /mm/userfaultfd.c
parenta4a4659d86ec0395164dc346c1a7f4d2d1ff4db2 (diff)
mm: reduce lock contention of pcp buffer refill
rmqueue_bulk() batches the allocation of multiple elements to refill the per-CPU buffers into a single hold of the zone lock. Each element is allocated and checked using check_pcp_refill(). The check touches every related struct page which is especially expensive for higher order allocations (huge pages). This patch reduces the time holding the lock by moving the check out of the critical section similar to rmqueue_buddy() which allocates a single element. Measurements of parallel allocation-heavy workloads show a reduction of the average huge page allocation latency of 50 percent for two cores and nearly 90 percent for 24 cores. Link: https://lkml.kernel.org/r/20230201162549.68384-1-halbuer@sra.uni-hannover.de Signed-off-by: Alexander Halbuer <halbuer@sra.uni-hannover.de> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/userfaultfd.c')
0 files changed, 0 insertions, 0 deletions