From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Smale Date: Tue, 29 Jul 2003 17:56:15 +0000 Subject: [LARTC] Effect of HZ (system tick) on shaping Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org I was asked to write some traffic shaping scripts for a 100mbit ethernet connection on an intel P4 machine running redhat 8.0 (I upgraded 'tc' first http://bugzilla.redhat.com/bugzilla/show_bug.cgi?idu486 blah, blah...). The scripts I normally use and have verified as working against the vanilla 2.4 series of kernels didn't seem to do any traffic shaping when used against the redhat 8.0 kernel (stock 686 binary release kernel). The filters (HTB with SFQ leaves) were all in place and I could see the bytes flowing through the correct filters, it just wasn't right. Traffic shaped to 10mbit/s was flowing through at 94mbit/s no problem. I tried a later version of the HTB code (3.12) with the same kernel and the problem persisted. I then recompiled the redhat-8 kernel with the HZ value set at 512 (rh default) and also with the value of HZ set at 100, which is the setting the vanilla 2.4 series use. The 100Hz version worked fine whereas the problem persisted in the 512Hz version. So I went a bit deeper into the HTB filter (sch_htb.c). It uses a macro PSCHED_GET_TIME for timing purposes, which is defined in 'include/net/pkt_sched.h'. Looking in 'pkt_sched.h' I see that for my system PSCHED_CLOCK_SOURCE is defined as PSCHED_JIFFIES which means that PSCHED_GET_TIME is expressed as; '#define PSCHED_GET_TIME(stamp) ((stamp) = psched_time_base + (((unsigned long)(jiffies-psched_time_mark))<