linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/damon: Creating kmem cache for damon regions by KMEM_CACHE()
@ 2022-09-13 16:21 Dawei Li
  2022-09-13 17:16 ` SeongJae Park
  0 siblings, 1 reply; 2+ messages in thread
From: Dawei Li @ 2022-09-13 16:21 UTC (permalink / raw)
  To: sj, akpm; +Cc: damon, linux-mm, linux-kernel, Dawei Li

Damon regions are dynamic objects which can be created and destroyed
frequently, a dedicated slab cache is created by KMEM_CACHE(), as
suggested by akpm.

Signed-off-by: Dawei Li <set_pte_at@outlook.com>
---
 mm/damon/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index 0b1eb945c68a..20163c3c9aa7 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1283,8 +1283,7 @@ bool damon_find_biggest_system_ram(unsigned long *start, unsigned long *end)
 
 static int __init damon_init(void)
 {
-	damon_region_cache = kmem_cache_create("damon_region_cache", sizeof(struct damon_region),
-		0, 0, NULL);
+	damon_region_cache = KMEM_CACHE(damon_region, 0);
 	if (unlikely(!damon_region_cache)) {
 		pr_err("creating damon_region_cache fails\n");
 		return -ENOMEM;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/damon: Creating kmem cache for damon regions by KMEM_CACHE()
  2022-09-13 16:21 [PATCH] mm/damon: Creating kmem cache for damon regions by KMEM_CACHE() Dawei Li
@ 2022-09-13 17:16 ` SeongJae Park
  0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2022-09-13 17:16 UTC (permalink / raw)
  To: Dawei Li; +Cc: sj, akpm, damon, linux-mm, linux-kernel

On Wed, 14 Sep 2022 00:21:58 +0800 Dawei Li <set_pte_at@outlook.com> wrote:

> Damon regions are dynamic objects which can be created and destroyed
> frequently, a dedicated slab cache is created by KMEM_CACHE(), as
> suggested by akpm.
> 
> Signed-off-by: Dawei Li <set_pte_at@outlook.com>
> ---
>  mm/damon/core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index 0b1eb945c68a..20163c3c9aa7 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -1283,8 +1283,7 @@ bool damon_find_biggest_system_ram(unsigned long *start, unsigned long *end)
>  
>  static int __init damon_init(void)
>  {
> -	damon_region_cache = kmem_cache_create("damon_region_cache", sizeof(struct damon_region),
> -		0, 0, NULL);
> +	damon_region_cache = KMEM_CACHE(damon_region, 0);

I was about to say about the 80 columns limit, and this fixes it as well.
Thank you, Andrew and Dawei!

>  	if (unlikely(!damon_region_cache)) {
>  		pr_err("creating damon_region_cache fails\n");
>  		return -ENOMEM;
> -- 
> 2.25.1
> 

For this fixup and the initial patch[1],
Reviewed-by: SeongJae Park <sj@kernel.org>

[1] https://lore.kernel.org/damon/TYCP286MB2323DA1894FA55BB9CF90978CA449@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM/


Thanks,
SJ


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-13 17:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 16:21 [PATCH] mm/damon: Creating kmem cache for damon regions by KMEM_CACHE() Dawei Li
2022-09-13 17:16 ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).