From: Allison Henderson <allison.henderson@oracle.com>
To: "lihongfu@kylinos.cn" <lihongfu@kylinos.cn>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
"edumazet@google.com" <edumazet@google.com>,
"pabeni@redhat.com" <pabeni@redhat.com>
Cc: "rds-devel@oss.oracle.com" <rds-devel@oss.oracle.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rds:Simplify the allocation of slab caches
Date: Tue, 18 Jun 2024 14:15:27 +0000 [thread overview]
Message-ID: <0fdfe2c864b404a607c852c8a33378497f5b769f.camel@oracle.com> (raw)
In-Reply-To: <20240617075435.110024-1-lihongfu@kylinos.cn>
On Mon, 2024-06-17 at 15:54 +0800, 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>
This change looks simple enough to me. Thanks for the clean up.
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> ---
> net/rds/tcp.c | 4 +---
> net/rds/tcp_recv.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/net/rds/tcp.c b/net/rds/tcp.c
> index d8111ac83bb6..3dc6956f66f8 100644
> --- a/net/rds/tcp.c
> +++ b/net/rds/tcp.c
> @@ -719,9 +719,7 @@ static int __init rds_tcp_init(void)
> {
> int ret;
>
> - rds_tcp_conn_slab = kmem_cache_create("rds_tcp_connection",
> - sizeof(struct
> rds_tcp_connection),
> - 0, 0, NULL);
> + rds_tcp_conn_slab = KMEM_CACHE(rds_tcp_connection, 0);
> if (!rds_tcp_conn_slab) {
> ret = -ENOMEM;
> goto out;
> diff --git a/net/rds/tcp_recv.c b/net/rds/tcp_recv.c
> index c00f04a1a534..7997a19d1da3 100644
> --- a/net/rds/tcp_recv.c
> +++ b/net/rds/tcp_recv.c
> @@ -337,9 +337,7 @@ void rds_tcp_data_ready(struct sock *sk)
>
> int rds_tcp_recv_init(void)
> {
> - rds_tcp_incoming_slab = kmem_cache_create("rds_tcp_incoming",
> - sizeof(struct
> rds_tcp_incoming),
> - 0, 0, NULL);
> + rds_tcp_incoming_slab = KMEM_CACHE(rds_tcp_incoming, 0);
> if (!rds_tcp_incoming_slab)
> return -ENOMEM;
> return 0;
next prev parent reply other threads:[~2024-06-18 14:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 7:54 [PATCH] rds:Simplify the allocation of slab caches Hongfu Li
2024-06-17 10:34 ` Zhu Yanjun
2024-06-18 7:21 ` Hongfu Li
2024-06-18 14:15 ` Allison Henderson [this message]
2024-06-19 9:50 ` patchwork-bot+netdevbpf
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=0fdfe2c864b404a607c852c8a33378497f5b769f.camel@oracle.com \
--to=allison.henderson@oracle.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=lihongfu@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rds-devel@oss.oracle.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).