tr command in DDB

2003-12-25 Thread Zhihui Zhang
Hi, I always like the command db tr 123 in DDB. Is there an equivalent command in gdb? Thanks. -Zhihui -- ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL

high resolution kernel profiling

2003-03-15 Thread Zhihui Zhang
I try to use high resolution kernel profiling today on FreeBSD 4.6 release. I use config -p -p MYKERNEL and later kgmon -Br to start the profiling. However, the file generate by gprof contains many negative numbers such as -0.00, -0.02 under the columns of self and descendents. Why is the case?

Disk utilization command

2003-03-14 Thread Zhihui Zhang
Hi, Can anyone please tell me what is the command and syntax of it that can display how much time in percentage a disk is busy? iostat is supposed to do that, but I could not figure out the syntax. Thanks, -Zhihui -- To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe

long long sysctl possible?

2003-03-11 Thread Zhihui Zhang
Hi, I notice that the SYSCTL_INT() only support integer. Is there a support of things like 64-bit SYSCTL_LONGLONG()? If so, where is the sample code? Thanks. -Zhihui -- To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

A quick gdb help

2002-11-12 Thread Zhihui Zhang
I need to set a variable value in gdb: (gdb) set xyz = 1 - works (gdb) set i = 1- syntax error near '1' I guess i must have special meaning in gdb. But what if I insist setting it, is there a way? Thanks. -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe

RE: Command used to trace the stack of a process

2002-10-29 Thread Zhihui Zhang
Thanks. The backtrace often gives something like: routine name + 0x350 Is there a way to quickly determine the correponding source code line? -Zhihui On Tue, 29 Oct 2002, Nate Lawson wrote: On Tue, 29 Oct 2002, John Baldwin wrote: On 29-Oct-2002 Zhihui Zhang wrote: I remember

RE: kernel thread

2002-06-11 Thread Zhihui Zhang
I asked a very similar question a while ago (within at most two months I think). Try search for subject kernel daemon cleanup. -Zhihui On Tue, 11 Jun 2002, John Baldwin wrote: On 10-Jun-2002 Ferruccio Vitale wrote: Hi, how can I destroy a kernel thread that I previously created?

kernel I/O timing statistics

2002-05-22 Thread Zhihui Zhang
I have a need to record the total physical times spent on I/O requests during some period. My basic idea is to record the start time when the request is issued somewhere in a disk driver and the finish time somewhere in an interrupt routine. Can any one please tell me where are the right places

kernel daemon clean up

2002-05-20 Thread Zhihui Zhang
When we reboot a machine, it seems to me that the kernel sends signal 15 to daemons and wait 60 seconds for them to finish. In my program, I use kthread_create() to create a daemon, how to make sure that my daemon finishes all its job before reboot can proceed? Do I need to let the daemon catch

Re: Collect process sleeping statistics

2002-05-15 Thread Zhihui Zhang
for memory and how long it is waiting for I/O. No other process is running at the same time. -Zhihui On Tue, 14 May 2002, Terry Lambert wrote: Doug White wrote: On Mon, 13 May 2002, Zhihui Zhang wrote: A process can sleep for various reasons such as memory, I/O etc. Is there a way to collect

Re: Collect process sleeping statistics

2002-05-15 Thread Zhihui Zhang
much work?) will help. -Zhihui On Wed, 15 May 2002, Alfred Perlstein wrote: * Zhihui Zhang [EMAIL PROTECTED] [020515 10:33] wrote: Basically I have a program that does a lot of I/O and alloctes/frees a lot of memory. The time command gives result like this: 6.239u 19.329s 7:59.76 5.3

Collect process sleeping statistics

2002-05-13 Thread Zhihui Zhang
A process can sleep for various reasons such as memory, I/O etc. Is there a way to collect statistics about how long it sleeps for different reasons? Thanks. -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

Is it a file system code bug?

2002-04-24 Thread Zhihui Zhang
In routine ffs_balloc(), after we have determined that the block is already there, we use the following statement to read the block in: if (flags B_CLRBUF) { error = bread(vp, lbn, (int)fs-fs_bsize, NOCRED, nbp); if (error) {

fault on non-fault page - any debugging ideas?

2002-04-10 Thread Zhihui Zhang
While debugging kernel modules, I often get page fault panics. Using up command in gdb, I can find out which routine is the culprit. But I can not get information about which statement within that routine causes the problem. Is there a way to get this more exact information? Any help is

total module count

2002-04-01 Thread Zhihui Zhang
I am wondering how many modules in all are compiled during the kernel compilation (make depend; make). Is there any configuration file I can look into to find out all the module names? Thanks, -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body

A question of VM page ownership

2002-03-07 Thread Zhihui Zhang
Is there any fundamental reason why a page can not be owned by more than one VM object? If that was the case, the bogus page stuff in vfs_bio.c could be made cleaner IMHO. -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

Re: A question of VM page ownership

2002-03-07 Thread Zhihui Zhang
the data come from? On Thu, 7 Mar 2002, Zhihui Zhang wrote: Is there any fundamental reason why a page can not be owned by more than one VM object? If that was the case, the bogus page stuff in vfs_bio.c could be made cleaner IMHO. -Zhihui To Unsubscribe: send mail

Re: A weird disk behaviour

2002-03-06 Thread Zhihui Zhang
On Wed, 6 Mar 2002, Peter Edwards wrote: Zhihui Zhang wrote: snip ... I also do not read anything during the partial block write, and I think the disk controller should not do that either. If you do a partial block write, surely at some point the block must be read in order

Re: A weird disk behaviour

2002-03-06 Thread Zhihui Zhang
On Wed, 6 Mar 2002, Ian wrote: Zhihui Zhang wrote: snip ... I also do not read anything during the partial block write, and I think the disk controller should not do that either. If you do a partial block write, surely at some point the block must be read in order

Re: A weird disk behaviour

2002-03-06 Thread Zhihui Zhang
On Wed, 6 Mar 2002, Peter Pentchev wrote: On Wed, Mar 06, 2002 at 12:12:44PM -0500, Zhihui Zhang wrote: On Wed, 6 Mar 2002, Peter Edwards wrote: Zhihui Zhang wrote: snip ... I also do not read anything during the partial block write, and I think the disk

A weird disk behaviour

2002-03-05 Thread Zhihui Zhang
I am doing some raw I/O test on a seagate SCSI disk running FreeBSD 4.5. This situation is like this: +-++++++++++---+-- | |||||||||| | +-++++++++++---+--

Re: A weird disk behaviour

2002-03-05 Thread Zhihui Zhang
to me. -Zhihui On Tue, 5 Mar 2002, Zhihui Zhang wrote: I am doing some raw I/O test on a seagate SCSI disk running FreeBSD 4.5. This situation is like

Re: A weird disk behaviour

2002-03-05 Thread Zhihui Zhang
The machine has 128M memory. I am doing physical I/O one block at a time, so there should be no memory copy. -Zhihui On Tue, 5 Mar 2002, Rogier R. Mulhuijzen wrote: At 16:03 5-3-2002 -0500, Zhihui Zhang wrote: On Tue, 5 Mar 2002, Julian Elischer wrote: more writes fit

Re: A weird disk behaviour

2002-03-05 Thread Zhihui Zhang
and see what happens. Also, could you post your actual measurements? Lars Zhihui Zhang wrote: The machine has 128M memory. I am doing physical I/O one block at a time, so there should be no memory copy. -Zhihui On Tue, 5 Mar 2002, Rogier R. Mulhuijzen wrote: At 16:03 5-3

Re: A weird disk behaviour

2002-03-05 Thread Zhihui Zhang
Several times slower! The point is that writing less data performs worse. So I call it weird. -Zhihui On Tue, 5 Mar 2002, Lars Eggert wrote: Zhihui Zhang wrote: Well, the core of my program is as follows (RANDOM(x) return a value between 0 and x): blocksize = 8192

Re: A weird disk behaviour

2002-03-05 Thread Zhihui Zhang
) is close to the time reported by the user program. -Zhihui On Tue, 5 Mar 2002, Lars Eggert wrote: Zhihui Zhang wrote: Several times slower! The point is that writing less data performs worse. So I call it weird. Huh? You originally said: (1) Write each block fully and sequentially, ie

Re: A weird disk behaviour

2002-03-05 Thread Zhihui Zhang
On Tue, 5 Mar 2002, Brian T.Schellenberger wrote: On Tuesday 05 March 2002 06:29 pm, Julian Elischer wrote: On Tue, 5 Mar 2002, Lars Eggert wrote: Zhihui Zhang wrote: Several times slower! The point is that writing less data performs worse. So I call it weird. Huh? You

Re: Ptrace and SIGTRAP problem

2002-02-09 Thread Zhihui Zhang
(5) signal? The same program works fine on SunOS. Maybe there is a bug in the kernel. I have looked into sys_process.c and still have no idea. -Zhihui On 9 Feb 2002, Dag-Erling Smorgrav wrote: Zhihui Zhang [EMAIL PROTECTED] writes: The following small program demonstrates that a parent

Re: Ptrace and SIGTRAP problem

2002-02-09 Thread Zhihui Zhang
On 9 Feb 2002, Dag-Erling Smorgrav wrote: Zhihui Zhang [EMAIL PROTECTED] writes: - PT_CONTINUE + waitpid() works fine, the trace program prints out values. This is expected behaviour. - PT_CONTINUE alone does not work but no core-dump caused by SIGTRAP - PT_DETACH + waitpid() does

Ptrace and SIGTRAP problem

2002-02-05 Thread Zhihui Zhang
This is a mystery to me. I have gone through some kernel code without luck. The following small program demonstrates that a parent process can write into the data space of its child by ptrace(). If the parent waits for the child to exit, there is no problem. However, if the parent does not do

A question about make install

2002-01-31 Thread Zhihui Zhang
Each time I modify some kernel source, I have to do the following two steps: (1) make (2) make install The second step also re-installs ALL modules even if I only modifies the kernel code (not any of the module code). Is there a better way to do this? Thanks, -Zhihui To Unsubscribe: send

Re: What is HIDE_POSIX HIDE_BSD?

2002-01-30 Thread Zhihui Zhang
I can't guess what does it mean by hiding. Maybe any system call can be hidden from some configuration of the kernel. -Zhihui On Wed, 30 Jan 2002, Peter Pentchev wrote: On Tue, Jan 29, 2002 at 03:58:16PM -0500, Zhihui Zhang wrote: While adding a system call, I notice in file syscall

What is HIDE_POSIX HIDE_BSD?

2002-01-29 Thread Zhihui Zhang
While adding a system call, I notice in file syscall-hide.h there are many instances of HIDE_POSIX() and HIDE_BSD(). What is the purpose of these macros? Maybe they are now obsolete? Thanks! -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body

Re: A quick VM question

2001-12-18 Thread Zhihui Zhang
Now I know FreeBSD could defer creating an VM object until the last minute - when the page fault occurs. Thanks. -Zhihui On Tue, 18 Dec 2001, Matthew Dillon wrote: :What are the backing objects of the stack and heap area of a process's :address space? When are they created? I saw the

A quick VM question

2001-12-16 Thread Zhihui Zhang
What are the backing objects of the stack and heap area of a process's address space? When are they created? I saw the code vm_map_insert(), but the object argument given is NULL. Thanks, -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of

gdb serial port

2001-12-05 Thread Zhihui Zhang
While compiling a debug kernel, I forgot to set the flag of sio0 to 0x80. Is there anyway I can fix this quickly without recompiling the kernel? Thanks, -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

Re: Timedout SCB already complete

2001-11-30 Thread Zhihui Zhang
I have been able to fix this bug in my KLD. I forgot to add a splbio() protection in a function. On Thu, 29 Nov 2001, Zhihui Zhang wrote: While running my KLD that does a lot of I/O, I see the following message: ahc0: Timedout SCB already complete. interrupts may not be functioning

contiguous memory of a buffer

2001-11-29 Thread Zhihui Zhang
I am wondering whether we need contiguous memory for a PHYSICAL buffer to perform the DMA I/O. It seems not, because regular buffers can be consisted of non-contiguous pages. The disk driver should treat both kinds of buffers in the same way. So can I say that any buffers used by kernel (via

Timedout SCB already complete

2001-11-29 Thread Zhihui Zhang
While running my KLD that does a lot of I/O, I see the following message: ahc0: Timedout SCB already complete. interrupts may not be functioning. This happens after my KLD runs a while. What could be the problem? Where could the bugs likely exist? Thanks for any clue. -Zhihui To

malloc deadlock with M_NOWAIT

2001-11-27 Thread Zhihui Zhang
I am trying to allocate a dynamic number of large memory (128K) by malloc(128K, M_xxx, M_NOWAIT). Although this is not done in an interrupt routine, I figure I'd better use M_NOWAIT so that I can deal with the situation when the memory is low. However, I experience the following deadlock: #1

Possible vmopar bug? (was malloc deadlock with M_NOWAIT)

2001-11-27 Thread Zhihui Zhang
VM gurus: This seems to be bug! This morning I sent an email (attached below) regarding a hang at the vmopar state. While waiting for responses, I use Google Advanced Groups Search looking for vmopar in all FreeBSD archived mailing lists and I did find the following message posted by Xavier

How to profiling a KLD?

2001-11-08 Thread Zhihui Zhang
I am trying to profile a KLD. It seems to me that adding the following line in its make file does not help: COPTS+= -pg -DGPROF The kernel was configured with config -p and I used kgmon -b, kgmon -h, kgmon -p, and gprof /kernel gmon.out gprof.out to collect the data. But none of my routines

Re: where are kernel modules located?

2001-10-21 Thread Zhihui Zhang
: In message Pine.SOL.4.21.0110201648520.23011-10@onyx Zhihui Zhang writes: : Kernel modules are supposed to locate under /modules. It turns out we can : find it under /. So where are kernel models located exactly? In -stable it is /modules (except for about 8 hours in the last few days when

where are kernel modules located?

2001-10-20 Thread Zhihui Zhang
Kernel modules are supposed to locate under /modules. It turns out we can find it under /. So where are kernel models located exactly? Thanks, -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

Limiting closed port RST response

2001-10-17 Thread Zhihui Zhang
I was using FreeBSD a while ago, suddenly a lot of messages show up: Limiting closed port RST responses from 224 to 200 packets per seconds. These messages persist even after reboot. What happened? What should I do? Thanks! -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with

Re: patch #3 (was Re: bleh. Re: ufs_rename panic)

2001-10-03 Thread Zhihui Zhang
On Wed, 3 Oct 2001, Ken Pizzini wrote: Zhihui Zhang [EMAIL PROTECTED] wrote: (3) Matt says For example, if you have two hardlinked files residing in different directories both get renamed simultaniously, one of the rename()s can fail even though there is no conflict

hardware watch point support

2001-10-03 Thread Zhihui Zhang
Does FreeBSD 4.3-release support hardware watchpoint? If so, how to enable it? I tried something like: (gdb) watch * 0xc28374d0 Hardware watchpoint 4: * 3263395024 (gdb) watch * (int32_t *) 3263427792 Hardware watchpoint 5: *(int32_t *) 3263427792 But it does not seem to work well. Instead, I

Make a kernel in a different directory

2001-10-01 Thread Zhihui Zhang
I put the whole kernel code under /test by the following command: #cp -R /usr/src/sys /test My configuration file is under /test/sys/i386/conf. Then I follow all the steps as I usually do to make a kernel and install the kernel (config, make depend, make, and make install). But I got the

Re: Make a kernel in a different directory

2001-10-01 Thread Zhihui Zhang
of the Makefile in the accf_http directory? On Mon, 1 Oct 2001, Zhihui Zhang wrote: I put the whole kernel code under /test by the following command: #cp -R /usr/src/sys /test My configuration file is under /test/sys/i386/conf. Then I follow all the steps as I usually do to make

Kernel module debugging help

2001-09-21 Thread Zhihui Zhang
I am using gdb a lot recently and find out that most of the bugs are memory related. I am wondering how to set up a hardware breakpoint which is triggered whenever a memory address is written again. I have no experience with this subject. Another minor question is how to set a static variable

Re: Kernel module debug help

2001-09-14 Thread Zhihui Zhang
have met. -Zhihui On Thu, 13 Sep 2001, Terry Lambert wrote: Ah. Interesting bug; perhaps related to a similar experience of my own... so let's stare at it! Zhihui Zhang wrote: I am debugging a KLD and I have got the following panic inside an interrupt context: fault virutal

Kernel module debug help

2001-09-13 Thread Zhihui Zhang
I am debugging a KLD and I have got the following panic inside an interrupt context: fault virutal address = 0x1080050 ... interrupt mask = bio kernel trap: type 12, code = 0 Stopped at vwakeup+0x14: decl 0x44(%eax) Where eax is 0x108000c and vwakeup() is called from biodone(). Since this

why use vfs_clean_pages()?

2001-09-11 Thread Zhihui Zhang
The routine vfs_clean_pages() is only called by bdwrite() to tell the VM that the buffer pages are clean so that VFS will write them when it sees fit. However, pages belonging to buffers are wired down, which means they are not on any paging queues. So even without vfs_clean_pages(), the

Error of BUF_STRATEGY()

2001-09-07 Thread Zhihui Zhang
I use BUF_STRATEGY() in a kernel module to read a sector on a device like /dev/ad0s3g. The biowait() routine after BUF_STRATEGY() gives me errors like EALREADY and EPERM from time to time. I find out that these errors occur after I already wrote the same device by another program. If I wait a

kernel ddb help

2001-09-05 Thread Zhihui Zhang
I know gdb can source stepping the kernel. But without two machines, you can not do it. Now I have only one machine and the system panic: db trace bqrelse(cxxx, cxxx, cxxx, c, cxxx) at bqrelse+0x25 is there a way to use these addresses to figure out which line or lines of source are

Re: kernel ddb help

2001-09-05 Thread Zhihui Zhang
Your snapshot is cool and I have found your old mail regarding VMWARE. One more question: Is X-windows needed for this stuff? Thanks, -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

What is VT_TFS?

2001-08-31 Thread Zhihui Zhang
What is the file system that uses VT_TFS in vnode.h? Is it still available on FreeBSD? Thanks. -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

Re: ata0-master: non aligned DMA transfer attempted

2001-08-27 Thread Zhihui Zhang
On Sun, 26 Aug 2001, Julian Elischer wrote: Zhihui Zhang wrote: Thanks for your replay. I use gdb to find out that the buffer address is not 16-byte aligned. This leads to a question as to how to align a statically allocated data structure properly. Using union seems to be able

Re: ata0-master: non aligned DMA transfer attempted

2001-08-27 Thread Zhihui Zhang
On Mon, 27 Aug 2001, Julian Elischer wrote: Zhihui Zhang wrote: I believe that message is from ata_dmasetup(): if (((uintptr_t)data scp-alignment) || (count scp-alignment)) { ata_printf(scp, device, non aligned DMA transfer attempted\n); return -1

Re: ata0-master: non aligned DMA transfer attempted

2001-08-26 Thread Zhihui Zhang
to achieve this? -Zhihui On Fri, 24 Aug 2001, Julian Elischer wrote: Zhihui Zhang wrote: I write a program that writes into a raw device directly. Although the program runs OK, the system prints messages like: ata0-master: non aligned DMA transfer attempted make sure your DMA buffer

ata0-master: non aligned DMA transfer attempted

2001-08-24 Thread Zhihui Zhang
I write a program that writes into a raw device directly. Although the program runs OK, the system prints messages like: ata0-master: non aligned DMA transfer attempted What exactly happens here? Is there any problem in my program? Thanks. -Zhihui To Unsubscribe: send mail to [EMAIL

Allocate a page at interrupt time

2001-08-03 Thread Zhihui Zhang
FreeBSD can not allocate from the PQ_CACHE queue in an interrupt context. Can anyone explain it to me why this is the case? Thanks, -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

Allocate a page at interrupt time

2001-08-01 Thread Zhihui Zhang
FreeBSD can not allocate from the PQ_CACHE queue in an interrupt context. Can anyone explain it to me why this is the case? Thanks, -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

Re: cluster size

2001-07-27 Thread Zhihui Zhang
I thought doing a memory free is always safe in an interrupt context. Now it seems doing an allocation of memory is safe too. Does MCLGET() call vm_page_alloc() or malloc() eventually? If so, it might block. -Zhihui On Thu, 26 Jul 2001, Terry Lambert wrote: Bosko Milekic wrote: Er,

Re: cluster size

2001-07-25 Thread Zhihui Zhang
On Tue, 24 Jul 2001, Terry Lambert wrote: Zhihui Zhang wrote: Hi, in freebsd can we change the cluster size from 2048 bytes.If yes how can we do that? do we have to configure in some file? You must be asking why the mbuf cluster size is chosen as 2048, right? It is probably

Re: cluster size

2001-07-25 Thread Zhihui Zhang
I see. It has something to do with the power-of-two allocator we are using inside the kernel. -Zhihui On Wed, 25 Jul 2001, Bosko Milekic wrote: On Wed, Jul 25, 2001 at 01:51:51PM -0400, Zhihui Zhang wrote: On Tue, 24 Jul 2001, Terry Lambert wrote: Zhihui Zhang wrote: Hi

Re: using syscalls in a module (stack problem ?)

2001-07-23 Thread Zhihui Zhang
Just out of curiosity, Linux's kernel stack is one page. Where in the kernel source code that says that we can have two pages instead of one page kernel stack? -Zhihui On Mon, 23 Jul 2001, Eugene L. Vorokov wrote: I call this function with (curproc, PATH_MAX+1), and everything is fine

Re: cluster size

2001-07-23 Thread Zhihui Zhang
You must be asking why the mbuf cluster size is chosen as 2048, right? It is probably a tradeoff between memory efficient and speed. -Zhihui On Mon, 23 Jul 2001, [iso-8859-1] vishwanath pargaonkar wrote: Hi, in freebsd can we change the cluster size from 2048 bytes.If yes how can we do

Re: using syscalls in a module (stack problem ?)

2001-07-23 Thread Zhihui Zhang
/* pages of u-area */ Regards, Weiguang From: Zhihui Zhang [EMAIL PROTECTED] To: [EMAIL PROTECTED], Eugene L. Vorokov [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: using syscalls in a module (stack problem ?) Date: Mon, 23 Jul 2001 12:07:47 -0400 (EDT) Just out

Re: KLD Programming

2001-07-18 Thread Zhihui Zhang
Yes. But it is not easy. Look at code vfs_vnops.c. You can let a user process open a file and then push the file descriptor into kernel via a special system call. Search the mailing list archive and you will find discussions on how to add a new system call. -Zhihui On Wed, 18 Jul 2001, suid

SPARE_USRSPACE

2001-07-17 Thread Zhihui Zhang
Can anyone tell me why FreeBSD has 256 bytes of spare space in the user area? Thanks. -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

Re: vfs.vmiodirenable undocumented

2001-07-11 Thread Zhihui Zhang
100% agreed. In this particular vmiodirenable case, you can search the mailing list archive and will find that people have discussed it at least one year ago. Plus, if you still do not understand it, read the book The design and Implementation of the 4.4 BSD Operating System. Anyway, when you

Re: trace a library call

2001-06-28 Thread Zhihui Zhang
layers is really bad. -Zhihui On Thu, 28 Jun 2001, Terry Lambert wrote: Zhihui Zhang wrote: Suppose I write a program that calls sbrk(). How can I trace into the function sbrk()? In this particular case, I want to know whether sbrk() calls the function in file lib/libstand/sbrk.c or sys

trace a library call

2001-06-27 Thread Zhihui Zhang
Suppose I write a program that calls sbrk(). How can I trace into the function sbrk()? In this particular case, I want to know whether sbrk() calls the function in file lib/libstand/sbrk.c or sys/sbrk.S. Sometimes it is nice to see what system call is eventually called as well. I know dynamic

Re: does data overflow in pipes

2001-06-27 Thread Zhihui Zhang
I guess the kernel will block the process trying to write more data than that can be accommodated. Or if you are using non-blocking I/O, it will return an error. -Zhihui On Wed, 27 Jun 2001, Manas Bhatt wrote: hi all, pipes uses only direct blocks to store data. so depending on the

Re: Confusion with mknod() and devfs

2001-06-23 Thread Zhihui Zhang
On Fri, 22 Jun 2001, Terry Lambert wrote: Zhihui Zhang wrote: According to the red daemon book, alias vnodes are used to make cache coherent (vp as a key). But getblk() stuff does not seem to check it. This makes me feel the code is there for historical reasons. The BSD 4.4 book

Confusion with mknod() and devfs

2001-06-21 Thread Zhihui Zhang
There is following comment inside ufs_mknod() which says /* * Remove inode, then reload it through VFS_VGET so it is * checked to see if it is an alias of an existing entry in * the inode cache. */ I really can not understand it. For each new disk inode, we call

shared versus exclusive lock

2001-05-24 Thread Zhihui Zhang
According to my reading of kern_lock.c, it does support shared lock. However, we are still using LK_EXCLUSIVE mode more often than necessary. If I want to look up a directory or to read a buffer, I should be able to use the LK_SHARED lock. Right now, only few places I have found using LK_SHARED,

cv_wait() or sv_wait() in FreeBSD

2001-04-23 Thread Zhihui Zhang
Do we have conditional/synchronization variable support in FreeBSD? If not, is there any alternative mechanism to use in the kernel? Thanks. -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message

Buffer emergence reserve

2001-04-18 Thread Zhihui Zhang
While looking at the code in vfs_bio.c, I notice the existence of low and high free buffer counters. The comments say they are there to give some special process like buf daemon access to emergence reserve. I just don't get the reason for having this emergence reserve. Do we allocate buffer in

Re: Buffer emergence reserve

2001-04-18 Thread Zhihui Zhang
Thanks! I am wondering whether the free VM page reserve has similar reason to exist, i.e., to clean dirty pages you need more pages. Probably not, that is for interrupt routines that can not block. On Wed, 18 Apr 2001, Alfred Perlstein wrote: * Zhihui Zhang [EMAIL PROTECTED] [010418 09:18

Where is PType in /stand/sysinstall defined?

2000-08-27 Thread Zhihui Zhang
In the FDISK-like menu of /stand/sysinstall, the PType (partition type) column is given values like 1,2,3,4,6. While the subtype field is well-defined (e.g., 0xa5 = freebsd), I can not find where the partition type is explained. I also tried PCguide in vain. Can somebody explain this to me?

Digital Technical Journal - zhihui

2000-08-15 Thread Zhihui Zhang
Kanad: I remember you subscribed some journal a while ago. Was it "digital technical journal?" I found two papers on VAXcluster filesytem design on No. 5, september 1987. If so and you happen to keep that issue, please borrow me for a while. Thanks. Regards, -Zhihui

recompiling boot blocks serial console

2000-08-10 Thread Zhihui Zhang
I want to set up a serial console on a freebsd 4.1 box. I follow the instructions at http://www.mostgraveconcern.com/freebsd/. I tried to do the following: # cd /sys/boot/i386/boo2 # make clean # make I got "cannot open ../btx/lib/crt0.o". What happened? Besides, I want to use another

Re: recompiling boot blocks serial console

2000-08-10 Thread Zhihui Zhang
On Thu, 10 Aug 2000, Mike Smith wrote: I want to set up a serial console on a freebsd 4.1 box. I follow the instructions at http://www.mostgraveconcern.com/freebsd/. I tried to do the following: Put -h in /boot.config. Now you have a serial console. Yes! Two more quick

Re: recompiling boot blocks serial console

2000-08-10 Thread Zhihui Zhang
On Thu, 10 Aug 2000, Mike Smith wrote: On Thu, 10 Aug 2000, Mike Smith wrote: I want to set up a serial console on a freebsd 4.1 box. I follow the instructions at http://www.mostgraveconcern.com/freebsd/. I tried to do the following: Put -h in

bridge driver and Yamaha YMF 724

2000-08-08 Thread Zhihui Zhang
Does 4.1-Release support YAMAHA PCI Audio Controller YMF 724? I have tried the suggestion given by man pcm without success. By the way, what is a card with bridge driver support and a PnP card as mentioned by man pcm? Thanks for your help. -Zhihui To Unsubscribe: send mail to [EMAIL

Re: memory type and its size

2000-07-21 Thread Zhihui Zhang
On Thu, 20 Jul 2000, Zhihui Zhang wrote: Does kernel memory of the same type (e.g., M_TEMP) must be allocated (using malloc()) with the same (range of) size? BTW, how to display mbuf cluster usages info. Thanks. A memory type can have memory blocks with different sizes. Use netstat -m

Re: KLD, kernel threads, zone allocator

2000-07-21 Thread Zhihui Zhang
On Mon, 17 Jul 2000, Zhihui Zhang wrote: I am writing a KLD that gives me kernel fault each time I run 'ps' command after 'make unload'. The KLD has a system call to create several kernel threads by calling kthread_create(). During unload, I set flags to each threads so

memory type and its size

2000-07-20 Thread Zhihui Zhang
Does kernel memory of the same type (e.g., M_TEMP) must be allocated (using malloc()) with the same (range of) size? BTW, how to display mbuf cluster usages info. Thanks. -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message

KLD, kernel threads, zone allocator

2000-07-17 Thread Zhihui Zhang
I am writing a KLD that gives me kernel fault each time I run 'ps' command after 'make unload'. The KLD has a system call to create several kernel threads by calling kthread_create(). During unload, I set flags to each threads so that they will call exit1() upon wakeup (sleep on a timeout).

Max DMA size

2000-07-06 Thread Zhihui Zhang
Can anyone tell me what factors determine the max DMA size (DMA counter on each controller or PCI bus related)? What is the typical max DMA size for a SCSI disk connected to a PCI bus? It seems to be much larger than MAXPHYS (128K). If so, does it mean we are not using full potential of DMA? So

Re: stupid FS questions

2000-05-30 Thread Zhihui Zhang
I believe that it is used to dynamic load filesystem modules. Please read the following pages to understand what is a kernel module: http://thc.inferno.tusculum.edu/files/thc/bsdkern.html -Zhihui On Tue, 30 May 2000, Yevmenkin, Maksim N, CSCIO wrote: Hello All, i've been looking at

Re: blocks and fragments???

2000-05-23 Thread Zhihui Zhang
If a fragment address refers to a fragment at a block boundary, then it is also called a block address. -Zhihui hi all, do disk addresses in struct dinode ( di_db[] array) address block addresses or fragment addresses?? the comment in dinode.h says they are block addresses. but fs.h

A possible bug in directory lookup code?

2000-05-19 Thread Zhihui Zhang
I think I may have found a bug in the directory lookup code in FreeBSD 4.0-Release, although it does not affect normal user. Please be patient and read on. The test code I am using and its result as follows: # cat test.c #include stdio.h #include errno.h main() { int error;

Re: One NFS cookie question

2000-05-08 Thread Zhihui Zhang
On Sun, 7 May 2000, Matthew Dillon wrote: :I have one question regarding the usage of NFS cookies. I read the :following passage in the mailing list archive: : : : :The BSD code simpy re-reads all of the directory blocks until it :hits the right offset again whenever it gets

One NFS cookie question

2000-05-04 Thread Zhihui Zhang
I have one question regarding the usage of NFS cookies. I read the following passage in the mailing list archive: The BSD code simpy re-reads all of the directory blocks until it hits the right offset again whenever it gets NFSERR_BAD_COOKIE. However, suppose you have a directory of

Re: GET OUT THE VOTE! Please support Java port to *BSD

2000-05-02 Thread Zhihui Zhang
Please support the Java on *BSD effort by voting for the RFE at: http://developer.java.sun.com/developer/bugParade/bugs/4288745.html If you are not already a member of Sun's Java Developers Connection, you will need to register before voting (membership is free). I have spent five minutes

Re: Remote kernel debugging

2000-04-20 Thread Zhihui Zhang
I have looked over your steps. It seems that the steps are all correct. I can suggest four things: (1) Consider using "makeoptionsDEBUG=-g" in your configure file. (2) If you are using FreeBSD 3.3-Release, the flag may be 0x50 instead of 0x80. (3) Lower the baud rate if possible. However,

Re: NFS attribute cache profiling sysctl variables

2000-04-19 Thread Zhihui Zhang
On Sun, 16 Apr 2000, Andrzej Bialecki wrote: On Sat, 15 Apr 2000, Zhihui Zhang wrote: I have two unrelated questions I can not figure out myself: (2) I am trying to display kernel profiling sysctl variables with sysctl -a or sysctl -A without success. They are defined

  1   2   3   >