tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to identify specific wait-state for a "DE" process?



On Tue, 5 Jan 2016, Michael van Elst wrote:

paul%vps1.whooppee.com@localhost (Paul Goyette) writes:

cv_wait() at cv_wait+0x116
fd_close() at fd_close+0x39a
fd_free() at fd_free+0x178
exit1() at exit1+0x10a
sys_exit() at sys_exit+0x3a
syscall() at syscall+0x9c
--- syscall (number 1) ---

So I guess I need to figure out which/what condvar it is waiting on...


There is only one condvar that fd_close waits for:

               /*
                * Wait for other references to drain.  This is typically
                * an application error - the descriptor is being closed
                * while still in use.
                * (Or just a threaded application trying to unblock its
                * thread that sleeps in (say) accept()).
                */
...
               while ((ff->ff_refcnt & FR_MASK) != 0) {
                       cv_wait(&ff->ff_closing, &fdp->fd_lock);
               }

Yep, I found that chunk of code. Perhaps filemon needs to run in a separate thread/lwp so that it can have a chance to close its access to the "borrowed" fd?

I need to figure out why this is a problem when filemon(4) "borrows" the fd for stdout, but is not a problem when it borrows a real file.



+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+


Home | Main Index | Thread Index | Old Index