Bug 20555

Summary: 3C509 driver performance problem
Product: Base System Reporter: xyf <xyf>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description xyf 2000-08-12 02:50:01 UTC
I just freshly installed Redhat Linux 6.2 and FreeBSD 4.0 on same
machine,  I run ApacheBench program ab on another
Linux machine to test the both OS, both OS have same Apache config options, using command:

    ab -c 10 -n 10000 http://192.168.1.27/index.html

they both give me good performance, the result is almost same, but ...
FreeBSD uses more CPU time than Linux, FreeBSD CPU idle is 40%,
Linux CPU idle is 60%, almost 20% CPU lost in FreeBSD!

I use "top" command and see FreeBSD cost 34% of CPU time in interrupt
handling, the system time is good, only 12%, my net card is old 3COM 3C509, my question is:

  is this the problem of 3C509 driver in FreeBSD  or  just is more serious FreeBSD design problem?

Fix: 

don't kown
How-To-Repeat: from another machine run apache benchmark program to pull FreeBSD,

    ab -c 10 -n 10000 http://192.168.1.27/index.html
Comment 1 Will Andrews 2000-08-12 06:11:11 UTC
On Fri, Aug 11, 2000 at 06:46:39PM -0700, xyf@stocke.com wrote:
> FreeBSD uses more CPU time than Linux, FreeBSD CPU idle is 40%,
> Linux CPU idle is 60%, almost 20% CPU lost in FreeBSD!

How do you know top(1) doesn't measure CPU idle time on Linux
differently than it does on FreeBSD?  (I don't know whether they do or
not, for the record, but I do know things like load averages are
measured differently..)

Plus, with no real way to "fix" this "problem", this PR is rather bogus.
If it is determined that the 3c509 driver sucks in terms of performance,
patches to increase its efficiency and such are quite acceptable.  :)

Besides, no one in their right mind that worries about performance is
going to use a 3c509...

-- 
Will Andrews <andrewsw@purdue.edu> <will@FreeBSD.org>
GCS/E/S @d- s+:+ a--- C++ UB++++$ P+ L- E--- W+ N-- !o ?K w---
O- M+ V- PS+ PE++ Y+ PGP+>+++ t++ 5 X+ R+ tv+ b++ DI+++ D+ 
G++ e>++++ h! r- y?
Comment 2 Bruce Evans 2000-08-13 19:19:48 UTC
On Fri, 11 Aug 2000 xyf@stocke.com wrote:

>     ab -c 10 -n 10000 http://192.168.1.27/index.html
> 
> they both give me good performance, the result is almost same, but ...
> FreeBSD uses more CPU time than Linux, FreeBSD CPU idle is 40%,
> Linux CPU idle is 60%, almost 20% CPU lost in FreeBSD!
> 
> I use "top" command and see FreeBSD cost 34% of CPU time in interrupt
> handling, the system time is good, only 12%, my net card is old 3COM 3C509, my question is:
> 
>   is this the problem of 3C509 driver in FreeBSD  or  just is more serious FreeBSD design problem?

I dodn't see any problem here, except missing accounting for interrupt
time in Linux.  I think Linux still counts interrupt time against
whatever process (including the idle "process") happens to be running
when the interrupt occurs.  FreeBSD's idle time of 40% is actually
the idle time (modulo jitter in the measurement).  Linux's idle time
of 60% may be mostly spent handling interrupts.  Similarly for system
and user times.  System and user times under Linux are normally larger
than under FreeBSD, because parts of them are actually interrupt times.

Bruce
Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2000-08-14 10:17:35 UTC
State Changed
From-To: open->closed

Asked and answered.