allocating 14KB memory per packet compression/decompression results in vm_fault

2005-11-02 Thread kamal kc
dear everybody, i am trying to compress/decompress ip packets. for this i have implemented the adaptive lzw compression. i put the code in the ip_output.c and do my compression/decompression just before the if_output() function call so that i won't interfere with the ip processing of the kernel.

Re: allocating 14KB memory per packet compression/decompression results in vm_fault

2005-11-03 Thread kamal kc
> > for my compression/decompression i use string > tables and temporary > > buffers which take about 14KB of memory per > packet. > > If you're allocating 14 KB of data just to send > (approximately) 1.4 KB > and then you throw away the 14 KB immediately, it > sounds terrible. yes that's true.

fatal trap 12; page fault in kernel mode --HELP

2005-11-07 Thread kamal kc
dear all, i am written code for compression/decompression which works very fine for binary as well as the ascii data. i have put the routine just before the if_output() so that i do not interfere with the kernel ip operations. Now the compression/decompression works fine most of the times bu

Fatal trap 12: page fault while in kernel mode

2005-12-25 Thread kamal kc
crash dumps here that may help some of you suggest me whether there is anything i can possibly do in order to solve this panic. Is the problem related to memory leaks or sleeping on mutexes or some other causes. i have added my function just before the IFQ_HANDOFF(). thanks, kam

Re: Fatal trap 12: page fault while in kernel mode

2005-12-25 Thread kamal kc
hanks, kamal Xin LI <[EMAIL PROTECTED]> wrote: Hi, On 12/25/05, kamal kc wrote: [...] > Is the problem related to memory leaks or sleeping > on mutexes or some other causes. >From the backtrace you have provided, it looks like a memory corruption. In order to aid your debu

using get_system_info() - obtaining system load averages

2006-01-09 Thread kamal kc
dear everybody, i want to use the routine get_system_info() to get the load averages of the cpu. i found it that top uses it. but i do not know which object files do i need to link it to my program. also the struct system_info is defined in the machine.h of the /usr/src/contrib/top. do i need t

Re: using get_system_info() - obtaining system load averages

2006-01-09 Thread kamal kc
> On Mon, 2006-Jan-09 19:14:53 -0800, kamal kc wrote: > >i want to use the routine get_system_info() to get > the > >load averages of the cpu. i found it that top uses > it. > > The approved mechanism is via the sysctl(3) name > "vm.loadavg" or OID >

Re: using get_system_info() - obtaining system load averages

2006-01-10 Thread kamal kc
--- Dan Nelson <[EMAIL PROTECTED]> wrote: > In the last episode (Jan 09), kamal kc said: > > dear everybody, > > > > i want to use the routine get_system_info() to get > the load averages > > of the cpu. i found it that top uses it. > > get_system_info

Re: using get_system_info() - obtaining system load averages

2006-01-10 Thread kamal kc
--- Peter Jeremy <[EMAIL PROTECTED]> wrote: > On Mon, 2006-Jan-09 23:59:10 -0800, kamal kc 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 kern

Re: using get_system_info() - obtaining system load averages

2006-01-10 Thread kamal kc
--- 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

rescheduling tasks using swi_add()

2006-01-11 Thread kamal kc
dear everybody, i had previous thread going on about the cpu load average. and had some discussion regarding it. i have a newer thing to discuss on so i started this thread. as i mentioned earlier i had put some code in the bridge.c that performed compression which took a long time and hence i

Re: rescheduling tasks using swi_add()

2006-01-11 Thread kamal kc
--- John Baldwin <[EMAIL PROTECTED]> wrote: > > > > the man page discussed the swi_add() and > swi_sched() > > functions. > > > > what i don't understand is, how do i register my > > handler > > function ?? > > if i use the swi_add() for that purpose what > > do i use for the void *arg argument.

Re: rescheduling tasks using swi_add()

2006-01-11 Thread kamal kc
--- John Baldwin <[EMAIL PROTECTED]> wrote: > > the man page discussed the swi_add() and > swi_sched() > > functions. > > > > what i don't understand is, how do i register my > > handler > > function ?? > > if i use the swi_add() for that purpose what > > do i use for the void *arg argument. > >

Re: rescheduling tasks using swi_add()

2006-01-12 Thread kamal kc
--- kamal kc <[EMAIL PROTECTED]> wrote: > > > > Queue a task to a taskqueue. Behind the scenes > that > > will invoke a swi_add if > > you use the taskqueue_swi queue. However, given > > that you want to do some > > rather complicated work,

Re: rescheduling tasks using swi_add()

2006-01-12 Thread kamal kc
--- John Baldwin <[EMAIL PROTECTED]> wrote: > On Thursday 12 January 2006 06:19 am, kamal kc > wrote: > > --- kamal kc <[EMAIL PROTECTED]> wrote: > > > > Queue a task to a taskqueue. Behind the > scenes > > > > > > that > > >

giving more cpu time to cpu intensive kernel daemon

2006-01-15 Thread kamal kc
dear all, i created a kernel daemon thread using the SYSINIT(). i want that daemon thread to do more cpu intensive tasks and that's why i want to give it more cpu time. my daemon thread get a priority of -84 and a nice value of 0. i guess when the nice value is 0 it affects its scheduling.

kernel hack

2005-09-25 Thread kamal kc
does anybody know what is the best way to start kernel hack. Any references to any web page would be appreciated __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com ___ freebsd-hac

malloc() in kernel and increasing mbuf and cluster size

2005-10-17 Thread kamal kc
this may be a trivial question for many of you but i am confused in doing memory allocation in the kernel. sys/malloc.h has function prototypes for malloc() kern/kern_malloc.c defines the malloc() the malloc() definition is void * malloc(size, type, flags) unsigned long size; st

Re: malloc() in kernel and increasing mbuf and cluster size

2005-10-17 Thread kamal kc
> > sys/malloc.h has function prototypes for malloc() > > kern/kern_malloc.c defines the malloc() > > > > the malloc() definition is > > > > void * > > malloc(size, type, flags) > > unsigned long size; > > struct malloc_type *type; > > int flags; > > > > i understand the size and fla

in_cksum() for ip packets with multiple mbufs

2005-10-23 Thread kamal kc
i come across this unusual problem. i changed the ip_tos field of the struct ip and computed the checksum by using in_cksum(). when the packet uses only one mbuf the computed checksum is ok but when the packet uses more than one mbuf then the computed checksum is wrong. eg. pinging with payloa

Re: in_cksum() for ip packets with multiple mbufs

2005-10-23 Thread kamal kc
> > i changed the ip_tos field of the struct ip and > computed the checksum > > by using in_cksum(). > > > > when the packet uses only one mbuf the computed > checksum is ok but > > when the packet uses more than one mbuf then the > computed checksum is > > wrong. > > Note that the IP header conta

Re: in_cksum() for ip packets with multiple mbufs

2005-10-23 Thread kamal kc
> > void copy_the_memorybuffer(struct mbuf **m) > > { > >struct mbuf *mbuf_pointer=*m; > >struct mbuf **next_packet; > > > >next_packet=&mbuf_pointer; > > > >struct ip *my_ip_hdr; > >my_ip_hdr=mtod((*next_packet),struct ip *); > >my_ip_hdr->ip_tos=64; > >my_ip_hdr->ip_s

Re: in_cksum() for ip packets with multiple mbufs

2005-10-23 Thread kamal kc
> > void copy_the_memorybuffer(struct mbuf **m) > > { > >struct mbuf *mbuf_pointer=*m; > >struct mbuf **next_packet; > > > >next_packet=&mbuf_pointer; > > > >struct ip *my_ip_hdr; > >my_ip_hdr=mtod((*next_packet),struct ip *); > >my_ip_hdr->ip_tos=64; > >my_ip_hdr->ip_s

compiling the kernel faster

2005-10-27 Thread kamal kc
hello everybody, i am new to kernel programming. i am developing a compression/decompression functionality in the ip layer. i want to compile the kernel faster. it would be ok if the kernel doesn't have support for sound devices, or other devices like scsi,usb etc. because i would be using the

tcp services (ssh,ftp) does not work

2005-10-30 Thread kamal kc
dear all, i have put sshd_enable="YES" and inetd_enable="YES" in /etc/rc.conf. netstat -an also shows that the port numbers 21 and 22 are in listen state ftp is uncommented in /etc/inetd.conf but still the ssh/ftp services does not work. when i ftp from another computer the netstat shows conne

kernel crash dump could not be obtained

2005-10-31 Thread kamal kc
dear all, i have to make modifictions to the kernel and i have been encountering kernel crashes all the time. the kernel panics with messages starting with vm_fault: and then crashes and reboots. i guess i have done incorrect memory operations and i want to know where i went wrong. so i thou