device polling question

2006-07-25 Thread Ramūnas Lukoševičius

Hi. I think, this is a problem. There is kind of interrupt storm with
device polling turned on, and `sysctl kern.polling` shows some interesting
numbers:

[EMAIL PROTECTED] ~]# uname -r
6.1-RELEASE-p3
[EMAIL PROTECTED] ~]# sysctl kern.clockrate
kern.clockrate: { hz = 1000, tick = 1000, profhz = 1024, stathz = 128 }
[EMAIL PROTECTED] ~]# vmstat 1 10
procs  memory  page   disk   faults  cpu
r b w avmfre  flt  re  pi  po  fr  sr ad0   in   sy  cs us sy id
0 0 0   96488 152772  220   0   0   0 197   0   0 7864 1563 4943  3 30 67
0 0 0   96488 1527721   0   0   0   1   0   0 6006  123 6806  0 43 57
0 0 0   96488 1527720   0   0   0   0   0   0 6026  115 6845  0 37 63
0 0 0   96488 1527720   0   0   0   0   0   0 6146  123 6818  0 41 59
0 0 0   96488 1527720   0   0   0   0   0   7 6013  127 6766  0 41 59
0 0 0   96488 1527720   0   0   0   0   0   0 5929  115 6565  0 34 66
0 0 0   96488 1527720   0   0   0   3   0   2 6453  115 7193  0 38 62
0 0 0   96488 1527760   0   0   0   1   0   1 5683  115 6389  1 39 60
0 0 0   96488 1527760   0   0   0   0   0   0 6279  123 6907  0 42 58
0 0 0   96488 1527760   0   0   0   0   0   0 5774  127 6426  0 37 63
[EMAIL PROTECTED] ~]# ifconfig fxp0 polling
[EMAIL PROTECTED] ~]# ifconfig fxp1 polling
[EMAIL PROTECTED] ~]# vmstat 1 10
procs  memory  page   disk   faults  cpu
r b w avmfre  flt  re  pi  po  fr  sr ad0   in   sy  cs us sy id
0 0 0   96488 152776  212   0   0   0 189   0   0 8004 1506 4980  3 31 66
0 0 0   96488 1527761   0   0   0   1   0   0 34446  123 3066  0 39 61
0 0 0   96488 1527760   0   0   0   0   0   0 34373  123 3059  0 37 63
0 0 0   96488 1527760   0   0   0   0   0   0 34480  127 3060  0 43 57
0 0 0   96488 1527760   0   0   0   3   0   2 34329  115 3059  0 45 55
0 0 0   96488 1527762   0   0   0   0   0   0 34436  120 3061  0 40 60
0 0 0   96488 1527760   0   0   0   0   0   1 34248  115 3069  0 35 65
0 0 0   96488 1527760   0   0   0   0   0   0 34375  123 3063  0 41 59
0 0 0   96488 1527760   0   0   0   0   0   0 34282  127 3052  0 45 55
0 0 0   96488 1527760   0   0   0   0   0   0 34342  566 3061  1 40 60
[EMAIL PROTECTED] ~]# sysctl kern.polling
kern.polling.burst: 150
kern.polling.burst_max: 150
kern.polling.each_burst: 5
kern.polling.idle_poll: 0
kern.polling.user_frac: 50
kern.polling.reg_frac: 20
kern.polling.short_ticks: 2115
kern.polling.lost_polls: 345
kern.polling.pending_polls: 0
kern.polling.residual_burst: 0
kern.polling.handlers: 2
kern.polling.enable: 0
kern.polling.phase: 0
kern.polling.suspect: 135
kern.polling.stalled: 0
kern.polling.idlepoll_sleeping: 1
[EMAIL PROTECTED] ~]# vmstat -i; sleep 1; vmstat -i
interrupt  total   rate
irq0: clk  152025885999
irq1: atkbd0 801  0
irq8: rtc   19453315127
irq11: fxp1 uhci0  122419028804
irq12: fxp0157346527   1034
irq14: ata093765  0
Total  451339321   2966
interrupt  total   rate
irq0: clk  152026925999
irq1: atkbd0 801  0
irq8: rtc   19453448127
irq11: fxp1 uhci0  122419028804
irq12: fxp0157346527   1034
irq14: ata093766  0
Total  451340495   2966

I tried that on a different machine with no shared interrupts.
Allmost the same results.

[EMAIL PROTECTED] ~]# cd /usr/src/sys/i386/conf/
[EMAIL PROTECTED] /usr/src/sys/i386/conf]# diff -u GENERIC ZIRZILE
--- GENERIC Tue Jul 25 10:55:46 2006
+++ ZIRZILE Tue Jul 25 10:55:44 2006
@@ -19,10 +19,8 @@
 # $FreeBSD: src/sys/i386/conf/GENERIC,v 1.429.2.7.2.2 2006/05/01 00:15:12 
scottl Exp $

 machinei386
-cpuI486_CPU
-cpuI586_CPU
 cpuI686_CPU
-ident  GENERIC
+ident  ZIRZILE

 # To statically compile in device wiring instead of /boot/device.hints
 #hints "GENERIC.hints" # Default places to look for devices.
@@ -62,6 +60,16 @@
 optionsAHD_REG_PRETTY_PRINT# Print register bitfields in debug
# output.  Adds ~215k to driver.
 optionsADAPTIVE_GIANT  # Giant mutex is adaptive.
+
+options DEVICE_POLLING
+
+options ALTQ
+options ALTQ_CBQ
+options ALTQ_RED
+options ALTQ_RIO
+options ALTQ_HFSC
+options ALTQ_CDNR
+options ALTQ_PRIQ

 device apic# I/O APIC

Any ideas ?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Device polling question - Freebsd 4.9

2004-09-22 Thread TM4525
I'm a bit confused about device polling. I put a counter in em_poll(), and 
then enabled device polling for 10 seconds and read back the counter, and it was 
called 1.5million times. This is with virtually no network activity and HZ 
set to the default of 100.

The docs seem to imply that the polling function gets called once per clock 
tick, but that doesn't seem to be the case at all. I'm trying to figure the 
reasoning behind mucking with the HZ value, which may affect some other things 
and also seems to defeat the purpose of trying to reduce overhead.

With the HZ value at 100 the system easily passes 90K pps, but Im concerned 
about what variations occur when the system is under load, or if there are 
time-consuming activities (like extensive firewall rules).

Also, when using device polling, even under heavy network load "top" shows 
the system to be almost completely idle. How can I gauge system usage when using 
polling instead of interrupts? Its difficult to compare the 2 methods when 
one of them can't be measured.

TIA

Tommy Mato
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"