Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3446460imm; Sun, 29 Jul 2018 19:29:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSN1U2+viZ81bnIXYfeUPfFDg/muay69XrzXitocrUyPIQ2JDAPiNuYfdfMVucFqcIPyot X-Received: by 2002:a17:902:b944:: with SMTP id h4-v6mr14401468pls.157.1532917774951; Sun, 29 Jul 2018 19:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532917774; cv=none; d=google.com; s=arc-20160816; b=vYpdCdYZQxpI+1HfAwv7qE03HiF1NsV6vLjlUqzoHn0AqOzNE2Y3nNdwvAHSOmCY73 xo3QJEAFSw4xNvZ2rHCML+EY9t4ZbXZftqpjANco3WUszmZyZ39MDsG3jlu6JMniZ48Q ababX1rptNBaLEYd0zAKsJn8o78XEWsqrQSynK5re1j4r7VzzZYAp9RMfWISnrfW8nNQ Y3Y/chaXC8wYhxmo9KAWwVa5c+1Z83tZgufUPfyXVvrbSEwjRcXH2SewTUEZHDivY9wL wHwepnkpGFERhwu2gJk785HtUO6JKsE55MB8Hxz7BlWia4EOPWTYZETAnGvaw1yUC0Rl Fldg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=rxrODUfCHY8gwZ3lQcckjgac4zgpf3MBpEqTQqjMots=; b=isLL9q2sCfnDO8PmuBd/uV3lTsqcmqLsewBxO6imlNe4MedSftqfBqHEOgzGzQv93D YI4WZTx64g7A7JRaFhgVUC8kHFtcyMndULAsw3VTZAyRej/BAf3lucLErPc94tosKrow 655N4w268UQ6R/pnUEDo+e61Ecm+GXck0SBMCaRRNZw2FucUY+L3jyfMtd53SDwoSrb7 50U6ebzjGhAp+OWX1sgYslUNO7a/tFZdNY7xC+VFzGKe7PO+01U/QZuB/qNfHAGz4oLP /n/z61fHQeaxDKoLxNY3RJ09hUFBwqt/9CdU/Og4/Hx0IbzjqmFtlO69hx21++hIuAz6 AFQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=mSilinzX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id q13-v6si10037766pgc.670.2018.07.29.19.29.08; Sun, 29 Jul 2018 19:29:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=mSilinzX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1725837AbeG3EAe (ORCPT + 99 others); Mon, 30 Jul 2018 00:00:34 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:51438 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725756AbeG3EAd (ORCPT ); Mon, 30 Jul 2018 00:00:33 -0400 Received: by mail-it0-f67.google.com with SMTP id e14-v6so15220520itf.1 for ; Sun, 29 Jul 2018 19:27:50 -0700 (PDT) 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=rxrODUfCHY8gwZ3lQcckjgac4zgpf3MBpEqTQqjMots=; b=mSilinzXNY93k0SJSpI6ztZSCB2X+lQyGbZbQ3qWfK4na9Qigum8qqEL2dD0R2jrJM E+y1SRvym7goNL30HcdbTXrEcyeEcj8WdHfUy+vpdohnnqAPCryIYMIKbTHhLRag1P+6 mUyocOi0qhYDpwx/6kA117Z0tIa6mrJbUbjwWj8oX+RHFC8fzmguuju1+SI1cFcfTdhf RyJ+oldvCqg7XUHvjH0oVOdvWRk9zmpLwlFiJvWm+Aeby/iIrq85CAn60LqdoOUxyUHJ XJsoJ0ElryrTnagMVU7NH7RykIGOyJj94aGal3YBNfvT3VV2Ig2HBTXK5EaX8Dp5nEvQ jIOw== 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=rxrODUfCHY8gwZ3lQcckjgac4zgpf3MBpEqTQqjMots=; b=pQR2dcdyyvysOMi/LW5wokG9LIxQJu3ZS1QH1qzeu2BVvcfIra9V4kg/Z9RyjtnCSW a0FlaKBknjeVQua9lxZniuedxL1wGTwFsI3S+I1kPPQTqpYC9CT1KNqeoo7bQOfQVyub ucmoLSl4eWVKYcD6nLcybYhVyuzfxC8qotsyH7ypCFOlVFQ58qcmdX/KOsSk4pHGtvWc L3wgYEIRlVTQE/XqPcuyr1hsFKoA3UsbOSaNCDc3+08qztqTTSMAXIT1bJPP8YRN0F9z UFl49bIcaCuP7yeqJtolcWjDi1rFUcQG9+zz1TqXeAkmsLWAY7yJ0RMZUNQAxFn6yJ55 xylA== X-Gm-Message-State: AOUpUlFEEnupcXjQBMxNs/m+tp6z5hSYZV5fuMtzxAB0rBlaabxYdS9+ O+ItDmpKwyKq0cwPzykJ4tm/hdipp0JbMPVkidTaeQ== X-Received: by 2002:a24:6f0e:: with SMTP id x14-v6mr12888363itb.139.1532917670071; Sun, 29 Jul 2018 19:27:50 -0700 (PDT) MIME-Version: 1.0 References: <1532746900-11710-1-git-send-email-laoar.shao@gmail.com> In-Reply-To: From: Eric Dumazet Date: Sun, 29 Jul 2018 19:27:38 -0700 Message-ID: Subject: Re: [PATCH net-next 1/2] tcp: call tcp_drop() in tcp collapse To: Yafang Shao Cc: David Miller , netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 29, 2018 at 7:06 PM Yafang Shao wrote: > > On Sun, Jul 29, 2018 at 12:28 AM, Eric Dumazet wrote: > > On Sat, Jul 28, 2018 at 12:43 AM Yafang Shao wrote: > >> > >> On Sat, Jul 28, 2018 at 11:38 AM, Eric Dumazet wrote: > >> > On Fri, Jul 27, 2018 at 8:35 PM Yafang Shao wrote: > >> > > >> >> So what about LINUX_MIB_TCPOFOMERGE ? > >> >> Regarding LINUX_MIB_TCPOFOMERGE, a skb is already covered by another > >> >> skb, is that dropping the packet or simply lowering the memory > >> >> overhead ? > >> > > >> > What do you think ? > >> > > >> > If you receive two times the same payload, don't you have to drop one > >> > of the duplicate ? > >> > > >> > There is a a big difference between the two cases. > >> > >> If the drop caused some data lost (which may then cause retransmition > >> or something), then this is a really DROP. > >> While if the drop won't cause any data lost, meaning it is a > >> non-harmful behavior, I think it should not be defined as DROP. > >> This is my suggestion anyway. > > > > Sigh. > > > > We count drops, not because they are ' bad or something went wrong'. > > > > If TCP stack receives twice the same sequence (same payload), we > > _drop_ one of the duplicate, so we account for this event. > > > > When ' collapsing' we reorganize our own storage, not because we have > > to drop a payload, > > but for some memory pressure reason. > > Thanks for you clarification. > So what about LINUX_MIB_TCPOFODROP ? > > if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) { > NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP); > tcp_drop(sk, skb); > return; > } > > > It is also because of our own memory pressure, but we call tcp_drop() here. Yes, we _drop_ a packet. That is pretty clear that the payload is dropped, and that the sender will have to _retransmit_. > > I am not mean to disagree with you. I am just confused and want to > make it clear. Collapsing is : For (a bunch of packets) Try (to compress them in order to reduce memory overhead) No drop of payload happens here. Sender wont have to retransmit.