| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
kqueue filter type is requested on a vnode.
MFC after: 3 days
Notes:
svn path=/head/; revision=150062
|
| |
|
|
|
|
|
|
| |
Approved by: anholt (mentor)
Discussed on: arch
Notes:
svn path=/head/; revision=150047
|
| |
|
|
|
|
|
| |
by handling all the cookie stuff.
Notes:
svn path=/head/; revision=150020
|
| |
|
|
|
|
|
|
|
| |
instead of vhold(), even though the vnode interlock is unlocked.
MFC after: 3 days
Notes:
svn path=/head/; revision=149557
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vlrureclaim() in vfs_subr.c 1.636 because waiting for the vnode
lock aggravates an existing race condition. It is also undesirable
according to the commit log for 1.631.
Fix the tiny race condition that remains by rechecking the vnode
state after grabbing the vnode lock and grabbing the vnode interlock.
Fix the problem of other threads being starved (which 1.636 attempted
to fix by removing LK_NOWAIT) by calling uio_yield() periodically
in vlrureclaim(). This should be more deterministic than hoping
that VOP_LOCK() without LK_NOWAIT will block, which may not happen
in this loop.
Reviewed by: kan
MFC after: 5 days
Notes:
svn path=/head/; revision=149385
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is a workaround for non-symetric teardown of the file systems at
shutdown with respect to the mount order at boot. The proper long term
fix is to properly detach devfs from the root mount before unmounting
each, and should be implemented, but since the problem is non-harmful,
this temporary band-aid will prevent false positive bug reports and
unnecessary error output for 6.0-RELEASE.
MFC after: 3 days
Tested by: pav, pjd
Notes:
svn path=/head/; revision=149340
|
| |
|
|
| |
Notes:
svn path=/head/; revision=149034
|
| |
|
|
|
|
|
|
|
| |
vdropl callers expect it to return with interlock still being held.
MFC after: 2 days
Notes:
svn path=/head/; revision=148922
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vnode is inactivated), possibly leading to a NULL dereference when
checking if the mount wants knotes to be activated in the VOP hooks.
So, we add a new vnode flag VV_NOKNOTE that is only set in getnewvnode(),
if necessary, and check it when activating knotes.
Since the flags are not erased when a vnode is being held, we can safely
read them.
Reviewed by: kris@
MFC after: 3 days
Notes:
svn path=/head/; revision=148768
|
| |
|
|
|
|
|
| |
Found by: trhodes
Notes:
svn path=/head/; revision=148671
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vnlru proc is extremely inefficient, potentially iteration over tens of
thousands of vnodes without blocking. Droping Giant allows other threads
to preempt us although we should revisit the algorithm to fix the runtime
problems especially since this may hold up all vnode allocations.
- Remove the LK_NOWAIT from the VOP_LOCK in vlrureclaim. This provides
a natural blocking point to help alleviate the situation described above
although it may not technically be desirable.
- yield after we make a pass on all mount points to prevent us from
blocking other threads which require Giant.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=148167
|
| |
|
|
|
|
|
|
|
|
|
| |
below KASSERT()s, which means there was no real problem here, we just
needed better locking for assertions.
OK'ed by: jeff
Approved by: re (scottl)
Notes:
svn path=/head/; revision=147772
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Introducing the possibility of using locks different than mutexes
for the knlist locking. In order to do this, we add three arguments to
knlist_init() to specify the functions to use to lock, unlock and
check if the lock is owned. If these arguments are NULL, we assume
mtx_lock, mtx_unlock and mtx_owned, respectively.
- Using the vnode lock for the knlist locking, when doing kqueue operations
on a vnode. This way, we don't have to lock the vnode while holding a
mutex, in filt_vfsread.
Reviewed by: jmg
Approved by: re (scottl), scottl (mentor override)
Pointyhat to: ssouhlal
Will be happy: everyone
Notes:
svn path=/head/; revision=147730
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
are actually caused by a buf with both VNCLEAN and VNDIRTY set. In
the traces it is clear that the buf is removed from the dirty queue while
it is actually on the clean queue which leaves the tail pointer set.
Assert that both flags are not set in buf_vlist_add and buf_vlist_remove.
Sponsored by: Isilon Systems, Inc.
Approved by: re (blanket vfs)
Notes:
svn path=/head/; revision=147478
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ref while we're calling vgone(). This prevents transient refs from
re-adding us to the free list. Previously, a vfree() triggered via
vinvalbuf() getting rid of all of a vnode's pages could place a partially
destructed vnode on the free list where vtryrecycle() could find it. The
first call to vtryrecycle would hang up on the vnode lock, but when it
failed it would place a now dead vnode onto the free list, and another
call to vtryrecycle() would free an already free vnode. There were many
complications of having a zero ref count while freeing which can now go
away.
- Change vdropl() to release the interlock before returning. All callers
now respect this, so vdropl() directly frees VI_DOOMED vnodes once the
last ref is dropped. This means that we'll never have VI_DOOMED vnodes
on the free list.
- Seperate v_incr_usecount() into v_incr_usecount(), v_decr_usecount() and
v_decr_useonly(). The incr/decr split is so that incr usecount can
return with the interlock still held while decr drops the interlock so
it can call vdropl() which will potentially free the vnode. The calling
function can't drop the lock of an already free'd node. v_decr_useonly()
drops a usecount without droping the hold count. This is done so the
usecount reaches zero in vput() before we recycle, however the holdcount
is still 1 which prevents any new references from placing the vnode
back on the free list.
- Fix vnlrureclaim() to vhold the vnode since it doesn't do a vget(). We
wouldn't want vnlrureclaim() to bump the usecount since this has
different semantics. Also change vnlrureclaim() to do a NOWAIT on the
vn_lock. When this function runs we're usually in a desperate situation
and we wouldn't want to wait for any specific vnode to be released.
- Fix a bunch of misc comments to reflect the new behavior.
- Add vhold() and vdrop() to vflush() for the same reasons that we do in
vlrureclaim(). Previously we held no reference and a vnode could have
been freed while we were waiting on the lock.
- Get rid of vlruvp() and vfreehead(). Neither are used. vlruvp() should
really be rethought before it's reintroduced.
- vgonel() always returns with the vnode locked now and never puts the
vnode back on a free list. The vnode will be freed as soon as the last
reference is released.
Sponsored by: Isilon Systems, Inc.
Debugging help from: Kris Kennaway, Peter Holm
Approved by: re (blanket vfs)
Notes:
svn path=/head/; revision=147407
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
of the clean and dirty lists. This is in an attempt to catch the wrong
bufobj problem sooner.
- In vgonel() don't acquire an extra reference in the active case, the
vnode lock and VI_DOOMED protect us from recursively cleaning.
- Also in vgonel() clean up some stale comments.
Sponsored by: Isilon Systems, Inc.
Approved by: re (blanket vfs)
Notes:
svn path=/head/; revision=147387
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
anyway and it's not used outside of vfs_subr.c.
- Change vgonel() to accept a parameter which determines whether or not
we'll put the vnode on the free list when we're done.
- Use the new vgonel() parameter rather than VI_DOOMED to signal our
intentions in vtryrecycle().
- In vgonel() return if VI_DOOMED is already set, this vnode has already
been reclaimed.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=147332
|
| |
|
|
|
|
|
| |
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=147327
|
| |
|
|
|
|
|
| |
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=147297
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
events could be added to cover other interesting details.
- Add some VNASSERTs to discover places where we access vnodes after
they have been uma_zfree'd before we try to free them again.
- Add a few more VNASSERTs to vdestroy() to be certain that the vnode is
really unused.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=147290
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
UFS by:
- Making the pre and post hooks for the VOP functions work even when
DEBUG_VFS_LOCKS is not defined.
- Moving the KNOTE activations into the corresponding VOP hooks.
- Creating a MNTK_NOKNOTE flag for the mnt_kern_flag field of struct
mount that permits filesystems to disable the new behavior.
- Creating a default VOP_KQFILTER function: vfs_kqfilter()
My benchmarks have not revealed any performance degradation.
Reviewed by: jeff, bde
Approved by: rwatson, jmg (kqueue changes), grehan (mentor)
Notes:
svn path=/head/; revision=147198
|
| |
|
|
|
|
|
| |
of a vget causing another call to INACTIVE before we're finished.
Notes:
svn path=/head/; revision=147113
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
1. Copy a NULL-terminated string into a fixed-length buffer, and
2. copyout that buffer to userland,
we really ought to
0. Zero the entire buffer
first.
Security: FreeBSD-SA-05:08.kmem
Notes:
svn path=/head/; revision=145953
|
| |
|
|
|
|
|
|
|
|
| |
vgone'd. We must remove it from the freelist before returning in
vtryrecycle() or we may get a duplicate free.
Reported by: kkenn
Notes:
svn path=/head/; revision=145822
|
| |
|
|
|
|
|
|
|
|
|
| |
drop the check+initialization for a straight initialization. Also
assert that curthread will never be NULL just to be sure.
Discussed with: rwatson, peter
MFC after: 1 week
Notes:
svn path=/head/; revision=145785
|
| |
|
|
|
|
|
|
|
|
| |
are set when we attempt to remove a buffer from a queue we should panic.
Hopefully this will catch the source of the wrong bufobj panics.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=145767
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vtryrecycle(). We could sometimes get into situations where two threads
could try to recycle the same vnode before this.
- vtryrecycle() is now responsible for returning the vnode to the free list
if it fails and someone else hasn't done it.
- Make a new function vfreehead() which moves a vnode to the head of the
free list and use it in vgone() to clean up that code a bit.
Sponsored by: Isilon Systems, Inc.
Reported by: pho, kkenn
Notes:
svn path=/head/; revision=145697
|
| |
|
|
|
|
|
|
|
|
| |
This fixes forced unmounts via nullfs.
Reported by: kkenn
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=145590
|
| |
|
|
|
|
|
| |
weeks now.
Notes:
svn path=/head/; revision=145588
|
| |
|
|
|
|
|
|
|
|
|
| |
do not correctly deal with failures. This presently risks deadlock
problems if dependency processing is held up by failures to allocate
a vnode, however, this is better than the situation with the failures.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=145385
|
| |
|
|
|
|
|
| |
earlier.
Notes:
svn path=/head/; revision=145249
|
| |
|
|
|
|
|
| |
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=145005
|
| |
|
|
|
|
|
|
|
| |
uses it.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144908
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
potential lock order reversal. Also, don't unlock the vnode if this
fails, lockmgr has already unlocked it for us.
- Restructure vget() now that vn_lock() does all of VI_DOOMED checking
for us and also handles the case where there is no real lock type.
- If VI_OWEINACT is set, we need to upgrade the lock request to EXCLUSIVE
so that we can call inactive. It's not legal to vget a vnode that hasn't
had INACTIVE called yet.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144900
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
to root cause on exactly how this happens.
- If the assert is disabled, we presently try to handle this case, but the
BUF_UNLOCK was missing. Thus, if this condition ever hit we would leak
a buf lock.
Many thanks to Peter Holm for all his help in finding this bug. He really
put more effort into it than I did.
Notes:
svn path=/head/; revision=144704
|
| |
|
|
| |
Notes:
svn path=/head/; revision=144661
|
| |
|
|
|
|
|
| |
Spotted by: Antoine Brodin
Notes:
svn path=/head/; revision=144625
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
one to become available for one second and then return ENFILE. We
can run out of vnodes, and there must be a hard limit because without
one we can quickly run out of KVA on x86. Presently the system can
deadlock if there are maxvnodes directories in the namecache. The
original 4.x BSD behavior was to return ENFILE if we reached the max,
but 4.x BSD did not have the vnlru proc so it was less profitable to
wait.
Notes:
svn path=/head/; revision=144624
|
| |
|
|
|
|
|
|
|
|
| |
on filesystems which safely support them. It appears that many
network filesystems specifically are not shared lock safe.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144374
|
| |
|
|
|
|
|
| |
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144367
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
vnodes whose names it caches, so we no longer need a `generation
number' to tell us if a referenced vnode is invalid. Replace the use
of the parent's v_id in the hash function with the address of the
parent vnode.
Tested by: Peter Holm
Glanced at by: jeff, phk
Notes:
svn path=/head/; revision=144319
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
vhold()s us.
- Avoid an extra mutex acquire and release in the common case of vgonel()
by checking for OWEINACT at the start of the function.
- Fix the case where we set OWEINACT in vput(). LK_EXCLUPGRADE drops our
shared lock if it fails.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144284
|
| |
|
|
|
|
|
| |
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144283
|
| |
|
|
|
|
|
|
|
|
| |
vrele so that we can decrease the indentation of the real work and
make things slightly more clear.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144219
|
| |
|
|
|
|
|
|
|
| |
vfs.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144204
|
| |
|
|
|
|
|
| |
Also spotted by: bz
Notes:
svn path=/head/; revision=144173
|
| |
|
|
|
|
|
| |
Found by: bz
Notes:
svn path=/head/; revision=144172
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
now always allocates a new vnode.
- Define a new function, vnlru_free, which frees vnodes from the free list.
It takes as a parameter the number of vnodes to free, which is
wantfreevnodes - freevnodes when called from vnlru_proc or 1 when
called from getnewvnode(). For now, getnewvnode() still tries to reclaim
a free vnode before creating a new one when we are near the limit.
- Define a function, vdestroy, which handles the actual release of memory
and teardown of locks, etc. This could become a uma_dtor() routine.
- Get rid of minvnodes. Now wantfreevnodes is 1/4th the max vnodes. This
keeps more unreferenced vnodes around so that files which have only
been stat'd are less likely to be kicked out of the system before we
have a chance to read them, etc. These vnodes may still be freed via
the normal vnlru_proc() routines which may some day become a real lru.
Notes:
svn path=/head/; revision=144092
|
| |
|
|
|
|
|
|
|
| |
now, all calls to VFS_ROOT() should still acquire exclusive locks.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144055
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
before it can call VOP_INACTIVE(). This must use the EXCLUPGRADE path
because we may violate some lock order with another locked vnode if
we drop and reacquire the lock. If EXCLUPGRADE fails, we mark the
vnode with VI_OWEINACT. This case should be very rare.
- Clear VI_OWEINACT in vinactive() and vbusy().
- If VI_OWEINACT is set in vgone() do the VOP_INACTIVE call here as well.
Sponsored by: Isilon Systems, Inc.
Notes:
svn path=/head/; revision=144051
|