Received: by 10.192.165.148 with SMTP id m20csp3603377imm; Mon, 23 Apr 2018 09:11:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx49XgOoXLj8YrOnzLYoMMSXx9Go0dAruGw9QCqYtpopUbq/+lYx4Ih8esAH0Z/hq7AWB8exT X-Received: by 10.101.91.204 with SMTP id o12mr15431914pgr.81.1524499909246; Mon, 23 Apr 2018 09:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524499909; cv=none; d=google.com; s=arc-20160816; b=n5K1sAJqlcG1TTBzBjuUgvt4ViP3RZwYhGc1yrk78H6TihW7uvsWo+JBvQWkzZN/rA VLOMLp+RGaA84DKthR+LoGCtSukKTWlzPoy/LZYic5yHp1EdPYYr1xxwqg8OsfMYo4w3 lR5uzGftd36mppDe1pFpagqH9zduWaZsXHtLG38z3s+ySdvFKAGHpKNrVZtr1rVVkqQD prAg3zQzhI9p6aVbKXsE9hKa67lonD8pJ69dVCp9fZkjHOBI4XLr1O8YoCccI/ufR5U8 DSsup33Qca2XNPBHLj/uvGrzHVM7D4uUKaio0TUcAQethF/ZgKGfetIUyQo5SchfSq4O 6tXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=yXMawmxdB7ALUYMJ3oC7tkVHzXeW02JBRZjKNnf9k78=; b=YpepceHkFiGWVHnTPXMd//Z8Nc1bCbUCbnO9JwYgPNz8YTBJNVaklUzhvlbOpo/bq2 PEKvJBlAP44T4ZkzZ5XZ1e9Q4YHR6oT/D/jxEmiTXK9UGYVFZ/k1tXNVpbt+mfTw5HC1 y4U24WNVyq4NSd+pv0XfQpDhOdDGIrBzndgJH7DlbKBPn8NvwQSw3fNmeKU0OaMpg7kH Paghsh45eH+i8kQXhAGneFZCTxLbcDgId904iCuKquKxjlls8l1rTPRDFlOAwg4T8b8j zj0An9g5xHHtaTnQ2draQtlkEOKSTGYYdGyESUmeV8Yz1M8kTTRzJe59bU8diS7TSfTM XGmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i5nGbfzR; 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 i192si10187107pgc.380.2018.04.23.09.11.34; Mon, 23 Apr 2018 09:11:49 -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=i5nGbfzR; 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 S932143AbeDWQJn (ORCPT + 99 others); Mon, 23 Apr 2018 12:09:43 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36216 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932102AbeDWQJh (ORCPT ); Mon, 23 Apr 2018 12:09:37 -0400 Received: by mail-pf0-f195.google.com with SMTP id g14so9698120pfh.3; Mon, 23 Apr 2018 09:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=yXMawmxdB7ALUYMJ3oC7tkVHzXeW02JBRZjKNnf9k78=; b=i5nGbfzRwHbHkG71+qatUDJkmAHAuuggjkm/7ov89fFt9oTrPs+INMUY3OeW673WAP bh6HEkOZpg6W/hyrZzhoHaIZMPo+Uk4eiYu4v8wAwwgTfNcs+tnUbvRYkvXQrYP8qs+w OTCjICdjtbufun9cro5AbIWHMnpJGBQqWPqG8qhqB51gnXuNIDF/j17D6zBwba9i0duR TTtN1uRkx7jrKE1OVc9GaY09ovweNwlP6hJGzkMqoU4qtRcGXSe+kBBIBzlvSExtDVVS Vp7tafQp9Rf2Ld+RqMUEM5/MW0wmgZzhIB/TDng4tpbZmIEuaHGvkq7W4skfRyPEueSa kVxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yXMawmxdB7ALUYMJ3oC7tkVHzXeW02JBRZjKNnf9k78=; b=kvecug6DtdIicrgfdr08GxjUIXwP5l55dAQ698z16SV102ZF28KIcS+1Q+S0XSqkW1 OdEujppkhQ4O+dxEYyyC2aeqgGVHUlwLcg0Hjq3FgdlWg3i1aWAM/Hl6NK0cjaJIGXt0 LPb7OPRPBAhMdyicLCJOCpxYUcmJ3L+9iIrUs7VztmdClr7Iz22NEVjTQvf8axD+EyA2 wqEmKzcgJFiKskvi4enRM5GhVp0/3pN8eCHNxtRPjz4/cwQInsAqPW4ZCt0QH1Py3c0/ dyDsukhltRQqIT9UwU7LR0JWCHjsMTHgkWy/+KQXjn58U2Jjf0HpmZbNoIruaivdYU69 Q4iA== X-Gm-Message-State: ALQs6tDqHzuEkvAvCiG+vEdB0lQy98oZd+ZpPM52kFA89feWhM0Hg8E2 emkB7kVtJ/KGuKE0OAtlWfZeej61 X-Received: by 10.99.109.139 with SMTP id i133mr17490472pgc.268.1524499776911; Mon, 23 Apr 2018 09:09:36 -0700 (PDT) Received: from ?IPv6:2620:15c:2c1:103:dcd8:b5d5:bf84:baad? ([2620:15c:2c1:103:dcd8:b5d5:bf84:baad]) by smtp.gmail.com with ESMTPSA id p6sm21670795pfn.140.2018.04.23.09.09.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 09:09:36 -0700 (PDT) Subject: Re: [PATCH net-next] net: init sk_cookie for inet socket To: David Miller , laoar.shao@gmail.com Cc: eric.dumazet@gmail.com, alexei.starovoitov@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1524405004-10960-1-git-send-email-laoar.shao@gmail.com> <20180423.115821.640630949143585629.davem@davemloft.net> From: Eric Dumazet Message-ID: <788ce3f1-6534-5c2e-1870-5ebd8ea4ae7f@gmail.com> Date: Mon, 23 Apr 2018 09:09:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180423.115821.640630949143585629.davem@davemloft.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/23/2018 08:58 AM, David Miller wrote: > From: Yafang Shao > Date: Sun, 22 Apr 2018 21:50:04 +0800 > >> With sk_cookie we can identify a socket, that is very helpful for >> traceing and statistic, i.e. tcp tracepiont and ebpf. >> So we'd better init it by default for inet socket. >> When using it, we just need call atomic64_read(&sk->sk_cookie). >> >> Signed-off-by: Yafang Shao > > Applied, thank you. > This is adding yet another atomic_inc on a global cache line. Most applications do not need the cookie being ever set. The existing mechanism was fine. Set it on demand.