From: David Hildenbrand <david@redhat.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] mm: ksm: drop KSM_KMEM_CACHE()
Date: Tue, 18 Jun 2024 09:51:36 +0200 [thread overview]
Message-ID: <a5057320-c6a9-4ab1-aa61-d9b022aa3cd4@redhat.com> (raw)
In-Reply-To: <20240618081201.134985-1-wangkefeng.wang@huawei.com>
On 18.06.24 10:12, Kefeng Wang wrote:
> After commit 21fbd59136e0 ("ksm: add the ksm prefix to the names of
> the ksm private structures"), we could directly use KMEM_CACHE().
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> mm/ksm.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/mm/ksm.c b/mm/ksm.c
> index d2641bc2efc9..1f62797c9809 100644
> --- a/mm/ksm.c
> +++ b/mm/ksm.c
> @@ -488,21 +488,17 @@ static DECLARE_WAIT_QUEUE_HEAD(ksm_iter_wait);
> static DEFINE_MUTEX(ksm_thread_mutex);
> static DEFINE_SPINLOCK(ksm_mmlist_lock);
>
> -#define KSM_KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\
> - sizeof(struct __struct), __alignof__(struct __struct),\
> - (__flags), NULL)
> -
> static int __init ksm_slab_init(void)
> {
> - rmap_item_cache = KSM_KMEM_CACHE(ksm_rmap_item, 0);
> + rmap_item_cache = KMEM_CACHE(ksm_rmap_item, 0);
> if (!rmap_item_cache)
> goto out;
>
> - stable_node_cache = KSM_KMEM_CACHE(ksm_stable_node, 0);
> + stable_node_cache = KMEM_CACHE(ksm_stable_node, 0);
> if (!stable_node_cache)
> goto out_free1;
>
> - mm_slot_cache = KSM_KMEM_CACHE(ksm_mm_slot, 0);
> + mm_slot_cache = KMEM_CACHE(ksm_mm_slot, 0);
> if (!mm_slot_cache)
> goto out_free2;
>
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
prev parent reply other threads:[~2024-06-18 7:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 8:12 Kefeng Wang
2024-06-18 7:51 ` David Hildenbrand [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=a5057320-c6a9-4ab1-aa61-d9b022aa3cd4@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=wangkefeng.wang@huawei.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