Received: by 10.192.165.156 with SMTP id m28csp625641imm; Tue, 17 Apr 2018 16:46:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/lh0jrqy8MEIrl01NXQhcy8EeF77caCbIzKeJZMFI5gQhVZV3Qb2k9CxmxTjHBRFU/xDA9 X-Received: by 2002:a17:902:7c02:: with SMTP id x2-v6mr2689121pll.186.1524008796993; Tue, 17 Apr 2018 16:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524008796; cv=none; d=google.com; s=arc-20160816; b=VnQnbhLnpgI3PcSdox7bMRfh7mZAfYv4gXwMQU7IriWRYUPbC0bCY+990QzPfQF7GM /oxm31dLJAYV6TsguQt5XzvdwKSIc25nCT8iXL5p8r30K+Gy7ZtDE/t6pdHKmahQ14ZV TA0bJP/Bwpg7cC3FJENIXaUhoNTllujYtRLxap3RqLNLBv/6vSGrSIf0AxoL20R1orVh 8NChq4qbtI4+wBryrYP9lzq5et5k7pn6ZUu9eFAaNPjrElJMCCFNoOyfBlYX+2ADL2Ru FSvP7SFKy6PA05ox+JTppltwQ2syviL9zPmpt0oQzvMEqmsJO4+DLkog9tW9syrpKPLZ n2CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=UlJLEMRE+1CGA2fPKPuDDuEAiOtSehui1Yxz6gHImR4=; b=NAdREd6MBJAy6GtMRLIxWvCjLp6U6f1IcXTQghV0BqiOqr4bnXRWQ6bWzstVEmb6uW iQ6mG3KZyIkehQ/uvf4ggf+rs2oP7D3VW8uguQ3wujrmJtOXevPBtlrXggONkKxcozgv UsC8UBlI91GlhbEpx9y+m2FTypVYAora02TK+i1xEyMXlYT+zkePrKXtox98GSbVCFpn DX2mrX5OFSNS+czoDaH368yaeQKyJ5DxGmd5Vzco6o4uAKHjBKnqwRF9uhLViXzc7RCc mGUDW1Fh5RIL00dCMwkpmhTspEr+rNHLexVga4ymXgMf1kWqPbi+kkS0l9pjPC1qQT9U 4pag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nYKpSqVX; 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 o11si12950242pgc.274.2018.04.17.16.46.22; Tue, 17 Apr 2018 16:46:36 -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=nYKpSqVX; 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 S1753218AbeDQXpC (ORCPT + 99 others); Tue, 17 Apr 2018 19:45:02 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:41987 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752727AbeDQXpA (ORCPT ); Tue, 17 Apr 2018 19:45:00 -0400 Received: by mail-pg0-f68.google.com with SMTP id e12so6120147pgn.9; Tue, 17 Apr 2018 16:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UlJLEMRE+1CGA2fPKPuDDuEAiOtSehui1Yxz6gHImR4=; b=nYKpSqVXgweiiRWuSq+a6R4xErWDaPso0mdaX3XEHgtDg3qO5nocOc3Rfw0yrEhx+z 0uNmfNnYZtoEz2AOq1phC5NeBR6AarLHJbQeG+uRUKVVBjLLU3vrZvPvC0RTi3MVpAZh YbihsZ26Pkqr9O167OAdeQry38q1RuS55PdZUOaT8K884ReRJVda5DFaH0rrFztDvJz7 l/KeA6cMNssV2TuyIKRfqW/7E1V6WNabOWDgXyoo6tb2NalGRirdOYiR+aAlVdVOGHsY pG58DQOdKLF7McF5xhztY64yG0Bzdlngs6VLBzyfnV48Li5teFbYeoAvT4IckLtvt1Fy a8Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UlJLEMRE+1CGA2fPKPuDDuEAiOtSehui1Yxz6gHImR4=; b=agiwx9BJPYxsPOeBzKQ8N80SQZZNYTPpoYJlek7+7g2r1z+4RA4L0yPCNpZ8ui49IW 8iHjZHczieHP8ynlVGUr/+t/OK42znaGX4zfH/3RwOULGAu+gndGxrYHGdi0kJ4Jf2DJ 0kmICLbCHepaGscA+/Sn/LTIcT9JHRPdK2CozkwEQvPI135hSz7PhMPbL7vQpUhSmpNC w/sjbMrrKAjbCYa5bohCpDHlWXv2dv/mva02tAB/oG8joyV7oTNoTheKztcUaaKmFnsG l5A3O0xTwBFJO7VbJDfpB8+4j9tLtWPONoqPHtf/pk9VQB6rXyVA4GVpmJ3DbVkTg9T9 b6Sw== X-Gm-Message-State: ALQs6tDE+KuSEY2oQYxfPL1vQNfEfR7L6pu9JiDXJkTZlkfA0vX5yAOp 6FTsVonYpzvinnGeaFr7RpiSsj1o X-Received: by 10.98.200.152 with SMTP id i24mr18511pfk.35.1524008699831; Tue, 17 Apr 2018 16:44:59 -0700 (PDT) Received: from ast-mbp ([2620:10d:c090:180::1:5a07]) by smtp.gmail.com with ESMTPSA id s5sm3351914pgv.8.2018.04.17.16.44.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 16:44:59 -0700 (PDT) Date: Tue, 17 Apr 2018 16:44:57 -0700 From: Alexei Starovoitov To: Eric Dumazet Cc: Yafang Shao , davem@davemloft.net, songliubraving@fb.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: introduce a new tracepoint for tcp_rcv_space_adjust Message-ID: <20180417234455.q6fgn7oroehmxk6l@ast-mbp> References: <1523892818-12820-1-git-send-email-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 16, 2018 at 08:43:31AM -0700, Eric Dumazet wrote: > > > On 04/16/2018 08:33 AM, Yafang Shao wrote: > > tcp_rcv_space_adjust is called every time data is copied to user space, > > introducing a tcp tracepoint for which could show us when the packet is > > copied to user. > > This could help us figure out whether there's latency in user process. > > > > When a tcp packet arrives, tcp_rcv_established() will be called and with > > the existed tracepoint tcp_probe we could get the time when this packet > > arrives. > > Then this packet will be copied to user, and tcp_rcv_space_adjust will > > be called and with this new introduced tracepoint we could get the time > > when this packet is copied to user. > > > > arrives time : user process time => latency caused by user > > tcp_probe tcp_rcv_space_adjust > > > > Hence in the prink message, sk is printed as a key to connect these two > > tracepoints. > > > > socket pointer is not a key. > > TCP sockets can be reused pretty fast after free. > > I suggest you go for cookie instead, this is an unique 64bit identifier. > ( sock_gen_cookie() for details ) I think would be even better if the stack would do this sock_gen_cookie() on its own in some way that user cannnot infere the order. In many cases we wanted to use socket cookie, but since it's not inited by default it's kinda useless. Turning this tracepoint on just to get cookie would be an ugly workaround.