a Q on measuring system performance.

2005-03-24 Thread Yan Yu
Hello, all, I add some codes in various places relating to file operations inside the kernel, e.g., fdalloc(), fdused(), fdunused(), fdfree() etc. I am trying to measure the overhead added by these instrumentation code. my plan is: in my user space program, i have something like the following:

filedesc struct in filedesc.h

2005-03-04 Thread Yan Yu
Hello, all, I have a Q on filedesc.h: i am wondering whether the order of the field in struct _filedesc_ (in sys/filedesc.h) matters? I added a field to _filedesc_ struct in filedesc.h. It is a dynamically allocated list, just as fd_ofiles, or fd_ofilefalgs. I put my new added list right

kernel core dump

2005-03-02 Thread Yan Yu
Hi, I have a Q on generating kernel core dump when the system boots up.. my kernel crashes when it tries to mount the root device, /, i.e., before it adding the swap device to the system (so there is no swap device when the system tries to generate core dump).. I am wondering is there a way to

send file descriptor via ipc

2005-02-26 Thread Yan Yu
Hello, there, I am looking for the function that handle send/recv file descriptors through sendmsg/recvmsg? by looking through source files, unp_internalize/unp_externalize in kern/uipc-usrreq.c seems relevant.. but i am not sure since i could not guess the meaning of the function name.. (btw,

confusion on fopen()/falloc()

2005-02-26 Thread Yan Yu
Hello, all, I have a user program as below: FILE *fd; while (1) { fd= fopen( tmp, r ); if ( fd == NULL ) break; } from my understanding, since i open the same file to read, my process should create a new file descriptor each time when fopen is called. Therefore,

Re: confusion on fopen()/falloc()

2005-02-26 Thread Yan Yu
On Sat, 26 Feb 2005, Yan Yu wrote: Hello, all, I have a user program as below: FILE *fd; while (1) { fd= fopen( tmp, r ); if ( fd == NULL ) break; } from my understanding, since i open the same file to read, my process should create a new file descriptor each

function prototype of fdrop() and fdrop_locked() in kern_descrip.c

2005-02-26 Thread Yan Yu
HI, all, I have a Q on the input parameter of fdrop() and fdrop_locked() in kern/kern_descrip.c. i am curious about the design choice of their input parameter. currently, it is defined as A) fdrop( struct file *, struct thread *)

Re: falloc()

2005-02-07 Thread Yan Yu
hi, THANKS FOR the pointer! falloc() isn't considered a pluggable kernel API, that is to say, we've not engineered FreeBSD with the intent that it be replaced at run-time. If you don't mind my asking, what motivates you to replace falloc()? i would like to add more checks (e.g.,

falloc()

2005-02-05 Thread Yan Yu
Hi, all, I am wondering if there is a way to use kernel loadable module to replace the original falloc() (kern/kern_descrip.c) in the system. I know how to do this if the funciton to be replaced is some system call function or ufs* operatio ( i could just change the symbol table which holds

Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Yan Yu
-24 at 14:27 -0800, Yan Yu wrote: Hi, all, I have a newbie Q: I am trying to use creating large number of threads and allocting memory to stress the system. My user program causes SEG fault in the kernel code, kse_release () in kern_kse.c. (it SEG fault before the system can

Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Yan Yu
HI, Thanks for all the info! kse_release() in this context isn't kernel code, its from libpthread. The kernel equivalent of a segfault would generate a panic. Just in case: you're attempting to allocate more than 5000 threads: Each one from main tries to recursively create 5000 more, and so

Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Yan Yu
an error in this line: printf(\n%d: Hello World!\n, threadid); Since threadid is not an int, its a pointer On Tue, 2005-01-25 at 10:31 -0800, Yan Yu wrote: Hi, thanks a LOT for looking into this. yes, that is exactly my output before the SEG fault happens (btw, i add if (p) before p[id

Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Yan Yu
stress.txt On Mon, 2005-01-24 at 14:27 -0800, Yan Yu wrote: Hi, all, I have a newbie Q: I am trying to use creating large number of threads and allocting memory to stress the system. My user program causes SEG fault in the kernel code, kse_release () in kern_kse.c. (it SEG fault

seg fault on kse_release () (fwd)

2005-01-25 Thread Yan Yu
Hi, all, I have a newbie Q: I am trying to use creating large number of threads and allocting memory to stress the system. My user program causes SEG fault in the kernel code, kse_release () in kern_kse.c. (it SEG fault before the system can be stressed;( the stack when the SEG fault happens

Re: seg fault on kse_release () (fwd)

2005-01-25 Thread Yan Yu
Cool, Thanks A LOT for looking into this! I appreciate it! after I reduce the BSIZE to 50k, it can create more than 10k threads before calloc error.. so i am going to drop this thread:) (just fyi, i use your prog on our machine w/ BSIZE =500k (~512M Ram), again i got SEG fault before the calloc