Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp589169pxb; Wed, 27 Jan 2021 16:01:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBqC5T8oPD0DUe7zORUpAmRTTsK/3YH6gMW/hv7BT5DIr7jlKRNlgJf2NjoMmaelSSZ+Tb X-Received: by 2002:aa7:c2ce:: with SMTP id m14mr10931044edp.76.1611792102786; Wed, 27 Jan 2021 16:01:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611792102; cv=none; d=google.com; s=arc-20160816; b=efwW1Vt6Q8Z/5K5P8yLKqgXXlKaOQrabIqTMlSPKzrFZOhTZHbfpnLbkoC3enY2xhh Mc+CEhW+B2DID37/L57LwnJ4wtWmY37EoRN5Jd5IJqIIRNutFKLIYikFom8TM1fh/WdG Sue/XF0SArTMGOwQW7ttV+EyaXru6o+dN2VcO/zg36fXY0zXAYZYdYK7vbnKF93nAfuU Et8gyTRmQC/8o4aplTnhw6wo3TL8QYRS1rDMOHGKAWF2gYqK59rwUE3+hbnHhZdGCWdI xfprucaf4VKTUmP8xdqDwAJcBPYGgJABDaRmskAOYkiSaG7vrG4r/tRsq7ov94W5EHvM y6Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sTdyNYkze+hI+OFRZCPwqiZbewY8o758U81yg52mX4M=; b=Ig0b75uLIFNVxpP+ITzzi3ogzetqpsNI6Hdfre0sbjvdFjGOfC5Q0BLMXJ0sVP71Kq YrPuo81LUNGXed6mLfajLaVvtcEkXAIKC9nM1WdLyq/0rO3KPalyd8+IpfiFmIH/3iTV FuYIquaTDXuAzYSQlsuZEFfUG+lkcgeTfX5aXw6KxWF+AliDNYUK2jwQnlzEqovusJB7 UxfNwL0DSskL9iLVqzblbf0cKUesBGGXNLZglDkgcKCzsv9ps8cjCVqgbBt3n9Ez0Jq+ xu9jO5OjzjTbQEFDkxo8wM1XD2KqlHI+8sHB71EI82w9UhisvplfOiZtnidrH4ENMdXd +AhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=q8pB9egR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si1843873edp.516.2021.01.27.16.01.18; Wed, 27 Jan 2021 16:01:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=q8pB9egR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235404AbhA0PCZ (ORCPT + 99 others); Wed, 27 Jan 2021 10:02:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235215AbhA0PA2 (ORCPT ); Wed, 27 Jan 2021 10:00:28 -0500 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C650C061786 for ; Wed, 27 Jan 2021 06:54:45 -0800 (PST) Received: by mail-il1-x12a.google.com with SMTP id d6so2011254ilo.6 for ; Wed, 27 Jan 2021 06:54:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sTdyNYkze+hI+OFRZCPwqiZbewY8o758U81yg52mX4M=; b=q8pB9egRttgWsLnscO5G4bYRpXSZAEr3Czk7HDYKghXyYGkiR66u90ioZFw7tahaDB CRGEkXinK6SxoxNHkCZVsQBD9lx8K9iIfwCaFFI2JewouxfQOryXga8qneDuVLCvyMeh arIMCS6QW8H6wS49vnLZvbTB7u3t3Mhk5LAJtuxVabZRSEafRpP5DAE2ABVKbfqAhSIw Xh3Ro1U23HmvBdQsN9sAkGVktk4YcULQJndthgOAd5l6CIazx6bo6unngx1qigZFlvft OABmeGgEvmJAJFBTkgBVz4lUcIweqDeHE4Hclkon06Fyfy36GeiimnRdN+9yrwYyhaSd Yv0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sTdyNYkze+hI+OFRZCPwqiZbewY8o758U81yg52mX4M=; b=g3kIMPDv4RftVxZRSVqjYNdkcLzV918qsMx0X7wVMTA58ZXrwE6Ngxi3R48eu9yM22 DZI3TGmT4HYZfqG4MxpkQ/okOKxbkSYG7QYM3wrAsCVn6JhzOFFUosDqgtCE5gNzq++Z kxUtSgl4Lz4CIjGi0hrxfB5cZcq932wzUGy5XlUsrR6kKTHkv1xnTV36AGqLJ1rvsJMU Ocmrh92V2aFTMDtEyjeUBs+/iNNU59vkRwjnSBmLjKENyo0XqiTl/YJSe1jFuROUAO22 Bgi8ioFkxIFRwzEDepyWaYx45t6lwIJeMGXwJwlFXlq1kw7PZejsZN2IjswV6kuvD7Sj OzJg== X-Gm-Message-State: AOAM533HAmSrDGidpi0JVLQIXn1Gv/pwbWOaLu7oQyosMJCS++OEfBG4 SYViAFOFrDk2L6vzXvUr/CIWxheKEo6CyX4UoJXI4g== X-Received: by 2002:a92:d8c2:: with SMTP id l2mr9200045ilo.216.1611759284256; Wed, 27 Jan 2021 06:54:44 -0800 (PST) MIME-Version: 1.0 References: <20210127125018.7059-1-kuniyu@amazon.co.jp> In-Reply-To: <20210127125018.7059-1-kuniyu@amazon.co.jp> From: Eric Dumazet Date: Wed, 27 Jan 2021 15:54:32 +0100 Message-ID: Subject: Re: [PATCH net] net: Remove redundant calls of sk_tx_queue_clear(). To: Kuniyuki Iwashima Cc: "David S . Miller" , Jakub Kicinski , Amit Shah , Kuniyuki Iwashima , netdev , LKML , Tariq Toukan , Boris Pismenny Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 27, 2021 at 1:50 PM Kuniyuki Iwashima 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 > CC: Boris Pismenny > Signed-off-by: Kuniyuki Iwashima > Reviewed-by: Amit Shah > --- > 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) >