summaryrefslogtreecommitdiff
path: root/include/linux/folio_queue.h
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2026-01-17 20:52:51 +0300
committerAndrew Morton <akpm@linux-foundation.org>2026-02-01 01:22:46 +0300
commitebc4734ad2219aaf76c497a6c94a98a2bcdaebc1 (patch)
tree9f375893b597d4f92cbe139ca183a24c3769112f /include/linux/folio_queue.h
parent69714a74c19f5ae8b21e25558d62d893d48a3f18 (diff)
downloadlinux-ebc4734ad2219aaf76c497a6c94a98a2bcdaebc1.tar.xz
mm/damon/core: process damon_call_control requests on a local list
kdamond_call() handles damon_call() requests on the ->call_controls list of damon_ctx, which is shared with damon_call() callers. To protect the list from concurrent accesses while letting the callback function independent of the call_controls_lock, the function does complicated locking operations. For each damon_call_control object on the list, the function removes the control object from the list under locking, invoke the callback of the control object without locking, and then puts the control object back to the list if needed, under locking. It is complicated, and can contend the locks more frequently with other DAMON API caller threads as the number of concurrent callback requests increases. Contention overhead is not a big deal, but the increased race opportunity can make headaches. Simplify the locking sequence by moving all damon_call_control objects from the shared list to a local list at once under the single lock protection, processing the callback requests without locking, and adding back repeat mode controls to the shared list again at once again, again under the single lock protection. This change makes the number of locking in kdamond_call() be always two, regardless of the number of the queued requests. Link: https://lkml.kernel.org/r/20260117175256.82826-5-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/folio_queue.h')
0 files changed, 0 insertions, 0 deletions