--- Tofik Suleymanov <[EMAIL PROTECTED]> wrote:
> kamal kc wrote: > > >--- Peter Jeremy <[EMAIL PROTECTED]> > wrote: > >>>thanks i tried getloadavg() it worked. > >>> > >>>but when i tried to put it in the kernel the > kernel > >>>failed to link. > >>You didn't mention the kernel bit before. To > access > >>the load average in the kernel, you just access > >>"averunnable" (see <sys/resource.h>). Note that > you > >>cannot do floating point arithmetic in the kernel > so > >>the load averages are stored as fixed point > numbers. > >thanks , it worked !!!! > > > >i used the ldavg[] and fscale of averunnable to get > >the system load. > > > > > >you people are great .. > > > >kamal > > > 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 bridge.c routine that attempts to compress/decompress ip packets. i don't know if it was a good idea since i am just a beginner in programming in the kernel and have a little knowledge regarding it. after i put my code i got a very high amount of interrupts (irq 21: xl1 interrupts) that overloads the cpu withing seconds if i pump about 4Mbps traffic through it. so i thought as a temp solution that i could turn off the compression if ever the cpu gets overloaded and that's it. But after a second thought--> the very idea of putting the large compression routine in the bridge code now seems awkward to me. since the compression takes time and putting the code in the bridge may be causing high interrupts i now think if i can do the compression stuffs in separate thread/process than in the bridge process itself. but right now i don't know how do i create a separate process/thread, what are the routines that i need to implement for this.. and also how to dispatch control from the bridge process to a new process without blocking. i am looking into these stuffs and hope i find something from the sources but it is getting really difficult ... maybe you people could have something to say, any advice on whether i am doing the right stuffs would be greatly helpful to me .. thanks, kamal __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"