netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Patrick McHardy <kaber@trash.net>, David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [RFC] NET_SCHED: restore HZ value to /proc/net/psched
Date: Mon, 23 Jun 2008 11:13:20 -0700	[thread overview]
Message-ID: <20080623111320.7ddb72b9@extreme> (raw)

Some changes back in  2.6.22 broke a number of
other places where the iproute2 utilities depended on kernel HZ
value. The use of HZ was a bad original ABI design choice; the
question is how to fix the impacts.

During 2.6.22 development, the psched clock was converted over
to use high resolution timers, and one of the changes was to the
return value of /proc/net/psched. This file is used by utilities
to determine conversion between time and jiffies.
It would be better to go back to the original format
output where the fourth field was the kernel HZ.

The motivation for the change was to make the HTB burst size
default smaller because the kernel clock resolution was better.  
But the change broke the use of jiffies by dst_metrics.

With this revert all the metric RTT values will work again.
The only use of hz in htb is to set the buffer and ceiling buffer default,
and having the old value would cause a slightly larger value. Note: the comment
in q_htb is incorrect, the value calculated is the default not the
minimum.  As an example if HTB rate is 1mbit, then the default buffer
would be come 11500 (with 100 HZ) vs 1500 (with 2.6.25).

This effectively reverts commit 4361cb17f0df5491fe6e2c3ae1defc98e9a64a79
I am not 100% convinced this is the best or only solution.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/net/sched/sch_api.c	2008-06-23 10:55:44.000000000 -0700
+++ b/net/sched/sch_api.c	2008-06-23 10:56:11.000000000 -0700
@@ -1266,13 +1266,9 @@ EXPORT_SYMBOL(tcf_destroy_chain);
 #ifdef CONFIG_PROC_FS
 static int psched_show(struct seq_file *seq, void *v)
 {
-	struct timespec ts;
-
-	hrtimer_get_res(CLOCK_MONOTONIC, &ts);
 	seq_printf(seq, "%08x %08x %08x %08x\n",
 		   (u32)NSEC_PER_USEC, (u32)PSCHED_US2NS(1),
-		   1000000,
-		   (u32)NSEC_PER_SEC/(u32)ktime_to_ns(timespec_to_ktime(ts)));
+		   1000000, HZ);
 
 	return 0;
 }

             reply	other threads:[~2008-06-23 18:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 18:13 Stephen Hemminger [this message]
2008-06-23 19:36 ` [RFC] NET_SCHED: restore HZ value to /proc/net/psched Patrick McHardy
2008-06-23 20:45   ` Stephen Hemminger
2008-06-24  0:15     ` Patrick McHardy
2008-06-28  2:59       ` David Miller

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=20080623111320.7ddb72b9@extreme \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    /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).