From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH net-next 1/1] net sched actions: add time filter for action dumping Date: Tue, 18 Apr 2017 20:55:25 -0700 Message-ID: <20170418205525.7d8d18a1@cakuba.lan> References: <1492350973-6846-1-git-send-email-jhs@emojatatu.com> <20170418151259.72eaa05a@cakuba.lan> <930f107b-ac5f-3fab-445b-9050437c1909@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, netdev@vger.kernel.org, xiyou.wangcong@gmail.com, eric.dumazet@gmail.com, jiri@resnulli.us To: Jamal Hadi Salim Return-path: Received: from mx4.wp.pl ([212.77.101.12]:42852 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759432AbdDSDzt (ORCPT ); Tue, 18 Apr 2017 23:55:49 -0400 In-Reply-To: <930f107b-ac5f-3fab-445b-9050437c1909@mojatatu.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 18 Apr 2017 21:37:12 -0400, Jamal Hadi Salim wrote: > On 17-04-18 06:12 PM, Jakub Kicinski wrote: > > > Noob question - would it be an option to establish some form of > > streaming statistic updates out of the kernel? > > It would be more efficient, certainly. Current polling approach is not > as bad though (you send one extra kernel message) and is more reliable > (events generated by the kernel are not reliably delivered to user > space). I see. > > The notion of user > > space trying to keep track of the time here seems a bit shaky. > > You mean the patch i sent or suggestion you are making would be > more shaky? > I see both being fine from that perspective - you dont need 100% > accuracy. Just something that is within reason of a small delta > of time. I'm just referring to the theoretical possibility that if the dumping process gets preempted for long enough you may loose samples. Just because the dumping process cannot control when kernel executes this line: jiffy_wanted = jiffies - jiffy_msecs; It could in theory be few seconds after the request was made. Perhaps using timestamps from a proper time sources instead of the notion of "last X seconds" would solve that?