[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJF_LOMDj9RZAe0QDkkJwCs7CgFA4KMijs5siz904DSzg@mail.gmail.com>
Date: Wed, 27 Jan 2021 15:54:32 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Kuniyuki Iwashima <kuniyu@...zon.co.jp>
Cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Amit Shah <aams@...zon.de>,
Kuniyuki Iwashima <kuni1840@...il.com>,
netdev <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Tariq Toukan <tariqt@...lanox.com>,
Boris Pismenny <borisp@...lanox.com>
Subject: Re: [PATCH net] net: Remove redundant calls of sk_tx_queue_clear().
On Wed, Jan 27, 2021 at 1:50 PM Kuniyuki Iwashima <kuniyu@...zon.co.jp> wrote:
>
> The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
> sk_set_socket()") removes sk_tx_queue_clear() from sk_set_socket() and adds
> it instead in sk_alloc() and sk_clone_lock() to fix an issue introduced in
> the commit e022f0b4a03f ("net: Introduce sk_tx_queue_mapping"). However,
> the original commit had already put sk_tx_queue_clear() in sk_prot_alloc():
> the callee of sk_alloc() and sk_clone_lock(). Thus sk_tx_queue_clear() is
> called twice in each path currently.
Are you sure ?
I do not clearly see the sk_tx_queue_clear() call from the cloning part.
Please elaborate.
In any case, this seems to be a candidate for net-next, this is not
fixing a bug,
this would be an optimization at most, and potentially adding a bug.
So if you resend this patch, you can mention the old commit in the changelog,
but do not add a dubious Fixes: tag
>
> This patch removes the redundant calls of sk_tx_queue_clear() in sk_alloc()
> and sk_clone_lock().
>
> Fixes: 41b14fb8724d ("net: Do not clear the sock TX queue in sk_set_socket()")
> CC: Tariq Toukan <tariqt@...lanox.com>
> CC: Boris Pismenny <borisp@...lanox.com>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.co.jp>
> Reviewed-by: Amit Shah <aams@...zon.de>
> ---
> net/core/sock.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/net/core/sock.c b/net/core/sock.c
> index bbcd4b97eddd..5c665ee14159 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -1759,7 +1759,6 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
> cgroup_sk_alloc(&sk->sk_cgrp_data);
> sock_update_classid(&sk->sk_cgrp_data);
> sock_update_netprioidx(&sk->sk_cgrp_data);
> - sk_tx_queue_clear(sk);
> }
>
> return sk;
> @@ -1983,7 +1982,6 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
> */
> sk_refcnt_debug_inc(newsk);
> sk_set_socket(newsk, NULL);
> - sk_tx_queue_clear(newsk);
> RCU_INIT_POINTER(newsk->sk_wq, NULL);
>
> if (newsk->sk_prot->sockets_allocated)
> --
> 2.17.2 (Apple Git-113)
>
Powered by blists - more mailing lists