From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH v7 2/3] sock: Move the socket inuse to namespace. Date: Mon, 18 Dec 2017 22:22:11 -0500 (EST) Message-ID: <20171218.222211.1453774388722002269.davem@davemloft.net> References: <1513259519-32332-2-git-send-email-xiangxia.m.yue@gmail.com> <20171218.143016.1035157635015719813.davem@davemloft.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: xiangxia.m.yue@gmail.com, netdev@vger.kernel.org To: xiyou.wangcong@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:44642 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934808AbdLSDWS (ORCPT ); Mon, 18 Dec 2017 22:22:18 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Cong Wang Date: Mon, 18 Dec 2017 13:38:39 -0800 > On Mon, Dec 18, 2017 at 11:30 AM, David Miller wrote: >> From: Tonghao Zhang >> Date: Thu, 14 Dec 2017 05:51:58 -0800 >> >>> In some case, we want to know how many sockets are in use in >>> different _net_ namespaces. It's a key resource metric. >> >> Useful or not, you're not exporting this value. >> >> All this patch series does is convert the existing export of the >> global tally to add up the per-net values. >> >> So if you're not exporting the per-net value on it's own in any way, >> this patch series isn't achieving the stated goal. >> >> I'm not applying this series, sorry. > > > This value is already exported via procfs: > sockstat_seq_show() -> socket_seq_show(). > > And the proc file itself should already be per-net: > > static int sockstat_seq_open(struct inode *inode, struct file *file) > { > return single_open_net(inode, file, sockstat_seq_show); > } > > > This patch just makes that value to be per-net too. You're right, my bad. I'll keep reviewing this.