From: Andi Kleen <andi@firstfloor.org>
To: rapier <rapier@psc.edu>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 2/3] Implementation of RFC 4898 Extended TCP Statistics (Web10G)
Date: Tue, 16 Dec 2014 19:44:17 -0800 [thread overview]
Message-ID: <87y4q79bzi.fsf@tassilo.jf.intel.com> (raw)
In-Reply-To: <549070D3.5050808@psc.edu> (rapier@psc.edu's message of "Tue, 16 Dec 2014 12:50:11 -0500")
rapier <rapier@psc.edu> writes:
> +
> +void tcp_estats_update_rtt(struct sock *sk, unsigned long rtt_sample)
> +{
> + struct tcp_estats *stats = tcp_sk(sk)->tcp_stats;
> + struct tcp_estats_path_table *path_table = stats->tables.path_table;
> + unsigned long rtt_sample_msec = rtt_sample/1000;
> + u32 rto;
> +
> + if (path_table == NULL)
> + return;
> +
> + path_table->SampleRTT = rtt_sample_msec;
> +
> + if (rtt_sample_msec > path_table->MaxRTT)
> + path_table->MaxRTT = rtt_sample_msec;
> + if (rtt_sample_msec < path_table->MinRTT)
> + path_table->MinRTT = rtt_sample_msec;
> +
> + path_table->CountRTT++;
> + path_table->SumRTT += rtt_sample_msec;
> +
> + rto = jiffies_to_msecs(inet_csk(sk)->icsk_rto);
> + if (rto > path_table->MaxRTO)
> + path_table->MaxRTO = rto;
> + if (rto < path_table->MinRTO)
> + path_table->MinRTO = rto;
Looking through your hooks it seem that many basically do simple
value profiling in a very open coded way.
Perhaps you could simplify things a lot by just having a couple of trace
points for these values (e.g. trace_change_rtt). Then have a library
of different data profiling types.
Then you could register a new value oriented trace point type with
different backend for whatever you currently need from the value: like
min/max/avg/ or full histogram or even reservoir sampling or EWMA.
I guess such a generic infrastructure would be useful elsewhere too.
One challenge would be how to associate such value profiles with
sockets, but I'm sure this could be done in some nice generic
way too.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
next prev parent reply other threads:[~2014-12-17 3:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-16 17:50 [PATCH net-next 2/3] Implementation of RFC 4898 Extended TCP Statistics (Web10G) rapier
2014-12-17 3:44 ` Andi Kleen [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-12-16 18:24 Alexei Starovoitov
2014-12-16 18:58 ` rapier
2014-12-16 19:11 ` David Miller
2014-12-16 19:09 ` David Miller
2014-12-16 20:01 ` rapier
2014-12-16 20:03 ` David Miller
2014-12-16 20:13 ` rapier
2014-12-16 20:18 ` David Miller
2014-12-16 21:02 ` rapier
2014-12-16 22:33 ` Eric Dumazet
2014-12-16 22:44 ` David Miller
2014-12-17 17:32 ` rapier
2014-12-16 22:09 ` Dominic Hamon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y4q79bzi.fsf@tassilo.jf.intel.com \
--to=andi@firstfloor.org \
--cc=netdev@vger.kernel.org \
--cc=rapier@psc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).