From: SeongJae Park <sj@kernel.org>
To: Dawei Li <set_pte_at@outlook.com>
Cc: sj@kernel.org, akpm@linux-foundation.org, damon@lists.linux.dev,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/damon: Creating kmem cache for damon regions by KMEM_CACHE()
Date: Tue, 13 Sep 2022 17:16:46 +0000 [thread overview]
Message-ID: <20220913171646.47472-1-sj@kernel.org> (raw)
In-Reply-To: <TYCP286MB23233778395A18052E578387CA479@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM>
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
prev parent reply other threads:[~2022-09-13 17:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220913171646.47472-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=set_pte_at@outlook.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).