Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3433038imm; Sun, 29 Jul 2018 19:07:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcnKraGd2TzFMR379RzvylnEUYkfjyod/iQOeFxEjCpYOivXM49Yi8oQ85r2hu/OjSXiKkl X-Received: by 2002:a63:1546:: with SMTP id 6-v6mr14697691pgv.271.1532916465527; Sun, 29 Jul 2018 19:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532916465; cv=none; d=google.com; s=arc-20160816; b=WYqyqdZSZ/PA4ukz8h+azABlP/0SBhmh6yoqtNtNYPiPrJGCygiMq4m98LToi7d/Ys jAzZftlggAnfwjkXn5QSCLHmZgIqG+wSbrvwsixiLtz1bRKqXKZc/esZqMmpCQR1XXM4 SizjSJPjQPpBr55OWow4H7L7/pqEW4O+eO0NGwZGW7ZGRcCfvuKzI5JLxbAnTVQoz2VK DqshPWStU1jfXUkzC5GZPyiVS5Ba416LGNy3b2tqPenraIW8zzA2ul7HrX/0gljQY8Xo SrO9VbcqI6gNmnbYD7D7Altl58Gt323CgZpCOYbL5kn9Ax4JwBVsWhZ/gHHml+MdpVu4 8oLw== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=RdIZnJNxUFIp4cJXGJTSt338HopkOCj8ZUXoPAf5I1k=; b=tGOFDonmoezhFWp/t5qLScwFuRMblLMUyU4+o1VSkDErP/B6Zp7yiRaWObgMZTDXii Os//d7Z4nhe46Tfu6dWJxNtP50KWnpiyYV04ALrvQVfR2bouLzRbAhg2kGpNGe9tvPN9 AmQPVSpDDMFk2eoR0UPijKyIVO++2xm+QzXBQWj0XdCTvmWVYCPGKw0UXAPkJ8o/e77i QZWnh+tfaTjA4dyMoW1EGI4jFSOz46UjhFbkYXaEhxYO+FZS0X96JezCi526bGbuGBbR 5ti+ojPAifB0OuzXrKgJBPQwb3Aq5dRulF+EVPAooeqSQEE46qjdXUKo/95VDljmU/RV OXCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RoIXXZgj; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16-v6si8834901pls.404.2018.07.29.19.07.30; Sun, 29 Jul 2018 19:07:45 -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=@gmail.com header.s=20161025 header.b=RoIXXZgj; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729023AbeG3DjX (ORCPT + 99 others); Sun, 29 Jul 2018 23:39:23 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:52732 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728701AbeG3DjX (ORCPT ); Sun, 29 Jul 2018 23:39:23 -0400 Received: by mail-it0-f67.google.com with SMTP id d9-v6so14946555itf.2; Sun, 29 Jul 2018 19:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RdIZnJNxUFIp4cJXGJTSt338HopkOCj8ZUXoPAf5I1k=; b=RoIXXZgjPnyYlvsyGatlQEd0gXDdmPlEj1Vnflthh2PaK4TDtN224mKiZFTXU1dHdx 8CQXJ0uHpHGusYvjeFX3S7/mRacAcLRUMW1A6P5uYz1AVlxjdn4KK5Ud8LxrA1Ae+D1k ArW0IoL4VylEmSL7IJ/UDe65p2RAdrkHg0mgxEyCerFwYBW7FOX4h60MpVapO40EQnv3 MM8sd7D5LoPD4S3C4PxaBL/wHv5ym9SXno5wllFJW7qZXPHMwvYVmdMB5JHB3pYR7q4A fFS2IcQY8aHNHcX647Oq52nE8SjGS3evV48VYhYuu5o+wxZa6qpju7uXsOReCuds891O Ou+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RdIZnJNxUFIp4cJXGJTSt338HopkOCj8ZUXoPAf5I1k=; b=sAfo4fKkLQK4JtVx2odrLvT6sp/OuOyToI280lN5bK2dV+0O0URZk8WfDh/Ae+hr3h IN8GF5SterZVXVhTdWMpoYanlRbOW6rm8x4auIHV+drCG4jox3H1IzXi4it5o2dik/i3 fUPjzsLEx47DTkxL1lKwinWO32hZ3j5EgMHQu4e8nEZAuqrMuIm/e0VJlajTAgHz6IMi IumDzW99ys+PgZLcPQDNh/HbvAabNXu8RLa7RMCC7GkqnX1wl75lzsRT84IjlIDKGaTk 2hxCqsV6cCTemERJ+4p9PICCPgNNM4G9iE7/zfUC/Hqv6qq/3Grzx79AEBkzbZJO0miU vSoA== X-Gm-Message-State: AOUpUlHPpMkKVm3vVfdTAzcliRX8nlmIwbgr7NN7/QMUvVtqYALzLiXI WqSMQKlCbDGqj3jb2qN31ecxe/lfEA5ZufOu0fI= X-Received: by 2002:a24:9cc7:: with SMTP id b190-v6mr13293466ite.118.1532916403097; Sun, 29 Jul 2018 19:06:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:7a47:0:0:0:0:0 with HTTP; Sun, 29 Jul 2018 19:06:02 -0700 (PDT) In-Reply-To: References: <1532746900-11710-1-git-send-email-laoar.shao@gmail.com> From: Yafang Shao Date: Mon, 30 Jul 2018 10:06:02 +0800 Message-ID: Subject: Re: [PATCH net-next 1/2] tcp: call tcp_drop() in tcp collapse To: Eric Dumazet 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 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. I am not mean to disagree with you. I am just confused and want to make it clear. > We have specific SNMP counters to account for these, we do not want to > pretend a packet was ' dropped' since it was not. > > If we have to _drop_ some packets, it is called Pruning, and we do > properly account for these drops. Agreed. Thanks Yafang