Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Oct 2003 22:30:13 -0800
From:      andi payn <andi_payn@speedymail.org>
To:        Andrew Humphries <humphie@ucip.boyko.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Linux port.....
Message-ID:  <1067409012.36829.368.camel@verdammt.falcotronic.net>
In-Reply-To: <1067260100.6768.2.camel@revelation.home.net>
References:  <20031024214427.22367.qmail@web20709.mail.yahoo.com> <1067042620.38004.1429.camel@verdammt.falcotronic.net> <200310271252.h9RCq1C22058@anon.securenym.net> <1067260100.6768.2.camel@revelation.home.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2003-10-27 at 05:08, Andrew Humphries wrote:
> On Mon, 2003-10-27 at 13:51, C. Ulrich wrote:
> > On Sat, 2003-10-25 at 00:43, andi payn wrote:
> > > 4. While running a similar set of services, FreeBSD may be using less
> > > background processing time. Or maybe not. I definitely see significantly
> > > lower CPU usage (idling under X, FreeBSD shows about 2-10% CPU, linux
> > > about 15-35%). However, this may just be an artifact of linux's
> > > notoriously bad reporting, or the fact that I'm using the O(1) kernel
> > > and preemptible kernel patches, or maybe something stupid some GNOME
> > > applet is doing because I configured it wrong under linux; who knows....
> > 
> > Check with top to see which processes are using the CPU. 

Keep in mind that top is gathering information from the same proc
filesystem as gtop, GNOME's system monitor, etc., so it's no more
accurate than they are. And, as I mentioned, there are well-known issues
with this reporting.

> > For me, 9 times
> > out of 10, it's the X server itself taking up cycles for doing nothing.

But for me, 9 times out of 10, the X server is grabbing lots of idle
time but won't steal time away from processes that actually need it.
This may prevent a laptop CPU from going into low-power mode, but it
doesn't affect anything else--even nice 20'd processes run.

With a patched kernel, this can get even more extreme (like the
interactive kernel patches, which will throw "bonus" timeslices at X,
nautilus, and some other processes): I've seen X using supposedly over
90% of my CPU--and then started a compile, and X immediately dropped to
under 10%--and everything remained responsive throughout. Even without
unofficial patches, remember that the linux scheduler has been hacked at
and even continually rewritten a few times in recent years, so what you
see with one version may not be the same with another.

However, you may have a memory leak. When I upgraded a Redhat 6 box to
XFree86 3.3, I had exactly that problem (IIRC, it ultimately had to do
with a bug in the version of gcc that Redhat was distributing)--after a
while, X was using 90% of my CPU for real, and sucking up a few hundred
megs of memory to boot, and the system slowed to a crawl. (Even then, I
just had to kill X; I didn't need to restart.)

This is why I said, "FreeBSD may be using less background processing
time. Or maybe not." Linux sometimes doesn't give you enough (or
accurate enough) information to know whether it's wasting your CPU. So,
it certainly appears to be more wasteful than FreeBSD, but it may not
actually _be_ more wasteful.

As a test, rebuilding mozilla takes about the same amount of time under
both systems (FreeBSD 5.1 vs. Mandrake 9.1 with kernel 2.4.21 with the
preemptible patch).

> > It won't do it right after a fresh boot, but some program along the way
> > usually triggers the siphoning of the CPU usage.
>
> I have found this an awful lot whilst running X under Linux. After a
> fresh boot, with nothing running, it works nicely. Give it a couple open
> applications, and even when nothing is running except X itself, it will
> take up extra CPU time and physical memory space until freshly booted
> again.

If this isn't getting too off-topic, what distro, kernel, and X are you
using?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1067409012.36829.368.camel>