mm/damon: improve damon_new_region strategy
authorDawei Li <set_pte_at@outlook.com>
Mon, 12 Sep 2022 14:39:03 +0000 (22:39 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:03:09 +0000 (14:03 -0700)
commita18709442869e55c42969142d5abf6beb776dbba
tree086535609d830a29750ec9190ba7229c1ed9ed6a
parente7fcac4cd2674fe6849c6ac8a51a7fc878a5e436
mm/damon: improve damon_new_region strategy

Kdamond is implemented as a periodical split-merge pattern, which will
create and destroy regions possibly at high frequency (hundreds or even
thousands of per sec), depending on the number of regions and aggregation
period.  In that case, kmalloc and kfree could bring speed and space
overheads, which can be improved by using a private kmem cache.

[set_pte_at@outlook.com: creating kmem cache for damon regions by KMEM_CACHE()]
Link: https://lkml.kernel.org/r/Message-ID:
Link: https://lkml.kernel.org/r/TYCP286MB2323DA1894FA55BB9CF90978CA449@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM
Signed-off-by: Dawei Li <set_pte_at@outlook.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/core.c