linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Hongfu Li <lihongfu@kylinos.cn>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] khugepaged: Simplify the allocation of slab caches
Date: Tue, 18 Jun 2024 09:37:26 +0200	[thread overview]
Message-ID: <030ba6a5-d3ff-429b-8672-59b7f7d44208@redhat.com> (raw)
In-Reply-To: <20240618014517.25954-1-lihongfu@kylinos.cn>

On 18.06.24 03:45, Hongfu Li wrote:
> Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
> to simplify the creation of SLAB caches.
> 
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
> ---
>   mm/khugepaged.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index 774a97e6e2da..f8d08b49420c 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -385,10 +385,7 @@ int hugepage_madvise(struct vm_area_struct *vma,
>   
>   int __init khugepaged_init(void)
>   {
> -	mm_slot_cache = kmem_cache_create("khugepaged_mm_slot",
> -					  sizeof(struct khugepaged_mm_slot),
> -					  __alignof__(struct khugepaged_mm_slot),
> -					  0, NULL);
> +	mm_slot_cache = KMEM_CACHE(khugepaged_mm_slot, 0);
>   	if (!mm_slot_cache)
>   		return -ENOMEM;
>   

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



      reply	other threads:[~2024-06-18  7:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18  1:45 Hongfu Li
2024-06-18  7:37 ` 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=030ba6a5-d3ff-429b-8672-59b7f7d44208@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=lihongfu@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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