using get_system_info() - obtaining system load averages
kamal_ckk at yahoo.com
Tue Jan 10 17:55:05 PST 2006
--- Tofik Suleymanov <tofik at oxygen.az> wrote:
> kamal kc wrote:
> >--- Peter Jeremy <PeterJeremy at optushome.com.au>
> >>>thanks i tried getloadavg() it worked.
> >>>but when i tried to put it in the kernel the
> >>>failed to link.
> >>You didn't mention the kernel bit before. To
> >>the load average in the kernel, you just access
> >>"averunnable" (see <sys/resource.h>). Note that
> >>cannot do floating point arithmetic in the kernel
> >>the load averages are stored as fixed point
> >thanks , it worked !!!!
> >i used the ldavg and fscale of averunnable to get
> >the system load.
> >you people are great ..
> Just a curiosity: why use kernel-space functions to
> get system load ?
> Isn't it better to use sysctls in user-space ?
actually the thing is , i have put some code in the
routine that attempts to compress/decompress ip
i don't know if it was a good idea since i am just a
in programming in the kernel and have a little
after i put my code i got a very high amount
of interrupts (irq 21: xl1 interrupts) that overloads
cpu withing seconds if i pump about 4Mbps traffic
so i thought as a temp solution that i could turn off
compression if ever the cpu gets overloaded and that's
But after a second thought-->
the very idea of putting the large compression
in the bridge code now seems awkward to me. since the
takes time and putting the code in the bridge may be
causing high interrupts i now think if i can do the
stuffs in separate thread/process than in the bridge
but right now i don't know how do i create a separate
what are the routines that i need to implement for
and also how to dispatch control from the bridge
process to a new
process without blocking. i am looking into these
hope i find something from the sources but it is
maybe you people could have something to say, any
on whether i am doing the right stuffs would be
helpful to me ..
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
More information about the freebsd-hackers