tech-kern archive

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

Re: memcpy of struct buf, or similar?

Simon Burge wrote:
> Andrew Doran wrote:
>> I am trying to fix PR 38761.  [ ... ]
> FWIW, just sticking a
>       KASSERT(mutex_owned(&bufcache_lock));
> before each time b_cflags is modified fails to reach single user when it
> hits genfs_getpages():
> panic: kernel diagnostic assertion "mutex_owned(&bufcache_lock)" failed: file 
> "../../../../miscfs/genfs/genfs_io.c", line 418

I think thats a false positive, getiobuf gives you a fresh clean buffer,
which isn't known about to the buffer cache code (yet) Looking at the
getiobuf it already sets cflags to BC_BUSY, so doing so genfs doesn't
actually need to do so (and probably shouldn't anyway, otherwise people
might thing cflags can be played with outside of the bufcache code)

I've also seen a similar hang.  I had a biolock and a biowait on the
same  buffer, and bunch of tstiles.

The biowait was from an open call.  The biolock was from a close call.
AFAIR the vnode was different, but the buf was the same.

show buf indicated that the buffer was flagged as done.

Since applying ad's patch to add a KASSERT for cv_has_waiters(or running
LOCKDEBUG kernel) I've not been able to repro the issue, -j8
(on a quad-core) runs to completion, even with raidframe rebuilding
underneath it.

All fs are ffs on raidframe mirror.  / doesn't use softdep, /home does
use softdep.


Home | Main Index | Thread Index | Old Index