The NetBSD Project

CVS log for src/sys/kern/vfs_vnode.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.156: download - view: text, markup, annotated - select for diffs
Sat Dec 7 02:27:38 2024 UTC (3 months, 2 weeks ago) by riastradh
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +9 -8 lines
vfs(9): Sprinkle SET_ERROR dtrace probes.

PR kern/58378: Kernel error code origination lacks dtrace probes

Revision 1.155: download - view: text, markup, annotated - select for diffs
Sat Dec 7 02:23:09 2024 UTC (3 months, 2 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +3 -3 lines
vfs(9): Fix some more whitespace issues.

No functional change intended.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Sat Dec 7 02:11:42 2024 UTC (3 months, 2 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +13 -8 lines
vfs(9): Sprinkle KNF.

No functional change intended.

Revision 1.153: download - view: text, markup, annotated - select for diffs
Mon Nov 27 16:13:59 2023 UTC (15 months, 3 weeks ago) by hannken
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +3 -3 lines
Restore kpause() accidentially removed with last commit.

Revision 1.152: download - view: text, markup, annotated - select for diffs
Mon Nov 27 10:03:40 2023 UTC (15 months, 3 weeks ago) by hannken
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +206 -151 lines
Implement and use an iterator over LRU lists.

Replace the vdrain kernel thread with two threadpool jobs,
one to process deferred vrele and
one to keep the number of allocated vnodes below limit.

Revision 1.151: download - view: text, markup, annotated - select for diffs
Wed Nov 22 13:19:50 2023 UTC (16 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +3 -3 lines
vfs(9): Make sure to kpause at least one tick, not zero.

kpause(9) forbids zero.

Local workaround for wider problem in PR kern/57718, to address
immediate symptom of crash on any system with hz=50, e.g. alpha in
qemu:

panic: kernel diagnostic assertion "timo != 0 || intr" failed: file "/usr/src/sys/kern/kern_synch.c", line 249

XXX pullup-10
XXX pullup-9
XXX pullup-8

Revision 1.150: download - view: text, markup, annotated - select for diffs
Mon Nov 6 12:17:50 2023 UTC (16 months, 2 weeks ago) by hannken
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +5 -3 lines
As the number of allocated vnodes goes beyond 106% of desiredvnodes
start throttling threads allocating new vnodes at a rate of ~100 new
vnodes per second and thread.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Fri Feb 24 11:02:27 2023 UTC (2 years ago) by riastradh
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +2 -14 lines
kern: Eliminate most __HAVE_ATOMIC_AS_MEMBAR conditionals.

I'm leaving in the conditional around the legacy membar_enters
(store-before-load, store-before-store) in kern_mutex.c and in
kern_lock.c because they may still matter: store-before-load barriers
tend to be the most expensive kind, so eliding them is probably
worthwhile on x86.  (It also may not matter; I just don't care to do
measurements right now, and it's a single valid and potentially
justifiable use case in the whole tree.)

However, membar_release/acquire can be mere instruction barriers on
all TSO platforms including x86, so there's no need to go out of our
way with a bad API to conditionalize them.  If the procedure call
overhead is measurable we just could change them to be macros on x86
that expand into __insn_barrier.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2023/02/23/msg028729.html

Revision 1.148: download - view: text, markup, annotated - select for diffs
Wed Feb 22 21:44:21 2023 UTC (2 years ago) by riastradh
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +8 -13 lines
_vstate_assert: Use atomic_load/store_relaxed.  Omit membar_enter.

Can't find anything this is supposed to pair with.  Pretty sure this
is just an optimistic unlocked test, not actually reliant on memory
ordering.  But as it is unlocked, it needs to be coordinated with
atomic_load/store_relaxed, not ordinary loads or stores, if for no
other reason than to pacify sanitizers.

No need in vnalloc_marker or vcache_alloc because these still have
exclusive access to the vnode at that point.

XXX Should deduplicate the logic in vstate_assert_change and
vstate_change.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Wed Oct 26 23:40:08 2022 UTC (2 years, 4 months ago) by riastradh
Branches: MAIN
CVS tags: netbsd-10-base, netbsd-10-1-RELEASE, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +3 -3 lines
miscfs/specfs/specdev.h: New home for extern spec_vnodeop_opv_desc.

Also use it for extern spec_vnodeop_p, which is already there.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Wed Oct 26 23:39:43 2022 UTC (2 years, 4 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +6 -7 lines
miscfs/deadfs/deadfs.h: New home for deadfs-related externs.

XXX regen sys/kern/vnode_if.c and the others

Revision 1.145: download - view: text, markup, annotated - select for diffs
Fri Aug 5 05:20:39 2022 UTC (2 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +16 -9 lines
In vcache_reclaim(), post NOTE_REVOKE immediately after changing the
vnode state to VS_RECLAIMING, before we actually call VOP_RECLAIM(),
which will release the reference on the lower node of a stacked FS
vnode, which is likely to free the upper node's v_klist backing store.

Acquire the vnode interlock when checking for kevent interest now,
because the vp->v_klist pointer is now volatile.

PR kern/56950

Revision 1.144: download - view: text, markup, annotated - select for diffs
Mon Jul 18 04:30:30 2022 UTC (2 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +36 -7 lines
Make kqueue event status for vnodes shareable, and for stacked file systems
like nullfs, make the upper vnode share that status with the lower vnode.

And, lo, NetBSD 9.99.99.

Fixes PR kern/56713.

Revision 1.143: download - view: text, markup, annotated - select for diffs
Sat Apr 9 23:45:45 2022 UTC (2 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +4 -2 lines
vfs(9): Add XXX comment about unclear membar_enter.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Sat Apr 9 23:38:33 2022 UTC (2 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +9 -9 lines
sys: Use membar_release/acquire around reference drop.

This just goes through my recent reference count membar audit and
changes membar_exit to membar_release and membar_enter to
membar_acquire -- this should make everything cheaper on most CPUs
without hurting correctness, because membar_acquire is generally
cheaper than membar_enter.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Mon Mar 28 12:37:56 2022 UTC (2 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +4 -7 lines
specfs: Remove specnode from hash table in spec_node_revoke.

Previously, it was possible for spec_node_lookup_by_dev to handle a
speconde that a concurrent spec_node_destroy is about to remove from
the hash table and then free, as soon as spec_node_lookup_by_dev
releases device_lock.

Now, the ordering is:

1. Remove specnode from hash table in spec_node_revoke.  At this
   point, no _new_ vnode references are possible (other than possibly
   one acquired by vcache_vget under v_interlock), but there may be
   existing ones.

2. Mark vnode reclaimed so vcache_vget will fail.

3. The last vrele (or equivalent logic in vcache_vget) will then free
   the specnode in spec_node_destroy.

This way, _if_ a thread in spec_node_lookup_by_dev finds a specnode
in the hash table under device_lock/v_interlock, _then_ it will not
be freed until the thread completes vcache_vget.

This change requires calling spec_node_revoke unconditionally for
device special nodes, not just for active ones.  Might introduce
slightly more contention on device_lock but not much because we
already have to take it in this path anyway a little later in
spec_node_destroy.

Revision 1.140: download - view: text, markup, annotated - select for diffs
Mon Mar 28 12:37:46 2022 UTC (2 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +4 -3 lines
specfs: Let spec_node_lookup_by_dev wait for reclaim to finish.

vdevgone relies on this to ensure that if there is a concurrent
revoke in progress, it will wait for that revoke to finish -- that
way, it can guarantee all I/O operations have completed and the
device is closed.

Revision 1.139: download - view: text, markup, annotated - select for diffs
Sat Mar 19 13:53:32 2022 UTC (3 years ago) by hannken
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +6 -13 lines
Remove now unused VV_LOCKSWORK, all file systems support locking.

Remove unused predicates vn_locked() and vn_anylocked().

Welcome to 9.99.95

Revision 1.138: download - view: text, markup, annotated - select for diffs
Sat Mar 19 13:52:11 2022 UTC (3 years ago) by hannken
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +3 -4 lines
Switch spec_vnodeop vector to real vnode locking, VV_LOCKSWORK now.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Tue Mar 15 15:27:43 2022 UTC (3 years ago) by hannken
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +6 -5 lines
vrelel(): No need to test usecount if VGET marker is clear.
Assert "usecount == 1" instead.

Revision 1.136: download - view: text, markup, annotated - select for diffs
Sat Mar 12 15:32:32 2022 UTC (3 years ago) by riastradh
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +27 -7 lines
sys: Membar audit around reference count releases.

If two threads are using an object that is freed when the reference
count goes to zero, we need to ensure that all memory operations
related to the object happen before freeing the object.

Using an atomic_dec_uint_nv(&refcnt) == 0 ensures that only one
thread takes responsibility for freeing, but it's not enough to
ensure that the other thread's memory operations happen before the
freeing.

Consider:

	  Thread A			  Thread B
	obj->foo = 42;			obj->baz = 73;
	mumble(&obj->bar);		grumble(&obj->quux);
	/* membar_exit(); */		/* membar_exit(); */
	atomic_dec -- not last		atomic_dec -- last
					/* membar_enter(); */
					KASSERT(invariant(obj->foo,
					    obj->bar));
					free_stuff(obj);

The memory barriers ensure that

	obj->foo = 42;
	mumble(&obj->bar);

in thread A happens before

	KASSERT(invariant(obj->foo, obj->bar));
	free_stuff(obj);

in thread B.  Without them, this ordering is not guaranteed.

So in general it is necessary to do

	membar_exit();
	if (atomic_dec_uint_nv(&obj->refcnt) != 0)
		return;
	membar_enter();

to release a reference, for the `last one out hit the lights' style
of reference counting.  (This is in contrast to the style where one
thread blocks new references and then waits under a lock for existing
ones to drain with a condvar -- no membar needed thanks to mutex(9).)

I searched for atomic_dec to find all these.  Obviously we ought to
have a better abstraction for this because there's so much copypasta.
This is a stop-gap measure to fix actual bugs until we have that.  It
would be nice if an abstraction could gracefully handle the different
styles of reference counting in use -- some years ago I drafted an
API for this, but making it cover everything got a little out of hand
(particularly with struct vnode::v_usecount) and I ended up setting
it aside to work on psref/localcount instead for better scalability.

I got bored of adding #ifdef __HAVE_ATOMIC_AS_MEMBAR everywhere, so I
only put it on things that look performance-critical on 5sec review.
We should really adopt membar_enter_preatomic/membar_exit_postatomic
or something (except they are applicable only to atomic r/m/w, not to
atomic_load/store_*, making the naming annoying) and get rid of all
the ifdefs.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Wed Mar 9 08:43:28 2022 UTC (3 years ago) by hannken
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +8 -2 lines
vrelel(): after all locks are in place check for new reference again.

Should fix assertion "vp->v_iflag & VI_TEXT" under load.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Mon Feb 28 08:44:04 2022 UTC (3 years ago) by hannken
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +12 -6 lines
vrelel(): no VOP_UNLOCK() with v_interlock or vmobjlock held.

Revision 1.133: download - view: text, markup, annotated - select for diffs
Thu Feb 17 14:39:51 2022 UTC (3 years, 1 month ago) by hannken
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +39 -17 lines
Do the space accounting before VOP_INACTIVE() so we may
unlock the vnode after VOP_INCATIVE().

This was the last call from vrelel() to VOP_UNLOCK() with v_interlock held.

Revision 1.132: download - view: text, markup, annotated - select for diffs
Thu Feb 17 14:39:14 2022 UTC (3 years, 1 month ago) by hannken
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +69 -43 lines
Add a marker VUSECOUNT_VGET to v_usecount that gets set whenever
vcache_vget() or vache_tryvget() succeeds.

Use it to rerun VOP_INACTIVE() if another thread ran a vget()..vrele()
cycle while we inactivated our last reference.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Thu Feb 17 14:38:06 2022 UTC (3 years, 1 month ago) by hannken
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +72 -65 lines
If the vnode to vrelel() is already reclaimed there is no need
to lock or defer it.  Jump straight to decrement usecount and requeue.

Revision 1.130: download - view: text, markup, annotated - select for diffs
Sat Feb 12 15:51:29 2022 UTC (3 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +6 -2 lines
Add inline functions to manipulate the klists that link up knotes
via kn_selnext:

- klist_init()
- klist_fini()
- klist_insert()
- klist_remove()

These provide some API insulation from the implementation details of these
lists (but not completely; see vn_knote_attach() and vn_knote_detach()).
Currently just a wrapper around SLIST(9).

This will make it significantly easier to switch kn_selnext linkage
to a different kind of list.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Tue Feb 8 08:57:11 2022 UTC (3 years, 1 month ago) by hannken
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +3 -3 lines
Operation vfs_suspend() returns ENOENT if the mount is gone (IMNT_GONE).

Adjust the KASSERT() appropriately.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Wed Oct 20 03:08:18 2021 UTC (3 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +6 -2 lines
Overhaul of the EVFILT_VNODE kevent(2) filter:

- Centralize vnode kevent handling in the VOP_*() wrappers, rather than
  forcing each individual file system to deal with it (except VOP_RENAME(),
  because VOP_RENAME() is a mess and we currently have 2 different ways
  of handling it; at least it's reasonably well-centralized in the "new"
  way).
- Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ,
  compatible with the same events in FreeBSD.
- Track which kevent notifications clients are interested in receiving
  to avoid doing work for events no one cares about (avoiding, e.g.
  taking locks and traversing the klist to send a NOTE_WRITE when
  someone is merely watching for a file to be deleted, for example).

In support of the above:

- Add support in vnode_if.sh for specifying PRE- and POST-op handlers,
  to be invoked before and after vop_pre() and vop_post(), respectively.
  Basic idea from FreeBSD, but implemented differently.
- Add support in vnode_if.sh for specifying CONTEXT fields in the
  vop_*_args structures.  These context fields are used to convey information
  between the file system VOP function and the VOP wrapper, but do not
  occupy an argument slot in the VOP_*() call itself.  These context fields
  are initialized and subsequently interpreted by PRE- and POST-op handlers.
- Version VOP_REMOVE(), uses the a context field for the file system to report
  back the resulting link count of the target vnode.  Return this in tmpfs,
  udf, nfs, chfs, ext2fs, lfs, and ufs.

NetBSD 9.99.92.

Revision 1.126.2.1: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:29:00 2021 UTC (3 years, 11 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.126: preferred, colored; next MAIN 1.127: preferred, colored
Changes since revision 1.126: +35 -2 lines
Sync with HEAD.

Revision 1.126.4.1: download - view: text, markup, annotated - select for diffs
Sat Apr 3 21:45:00 2021 UTC (3 years, 11 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.126: preferred, colored; next MAIN 1.127: preferred, colored
Changes since revision 1.126: +35 -2 lines
Sync with HEAD.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Thu Apr 1 06:26:14 2021 UTC (3 years, 11 months ago) by simonb
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +35 -2 lines
Add a sysctl hashstat collector for vcache.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Tue Aug 4 03:00:10 2020 UTC (4 years, 7 months ago) by riastradh
Branches: MAIN
Branch point for: thorpej-futex, thorpej-cfargs
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +4 -3 lines
Fix bogus fast path in vput.

If we can't discern whether we have an exclusive or shared lock, then
just unlock and don't play fast and loose with pretending that we
have an exclusive lock will work -- it won't.

Revision 1.125: download - view: text, markup, annotated - select for diffs
Sun Jun 14 00:20:17 2020 UTC (4 years, 9 months ago) by ad
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +4 -5 lines
If a vnode is marked with VI_EXECMAP then in all likelyhood it has pages.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Thu Jun 11 22:21:05 2020 UTC (4 years, 9 months ago) by ad
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +2 -4 lines
Counter tweaks:

- Don't need to count anonpages+filepages any more; clean+unknown+dirty for
  each kind of page can be summed to get the totals.

- Track the number of free pages with a counter so that it's one less thing
  for the allocator to do, which opens up further options there.

- Remove cpu_count_sync_one().  It has no users and doesn't save a whole lot.
  For the cheap option, give cpu_count_sync() a boolean parameter indicating
  that a cached value is okay, and rate limit the updates for cached values
  to hz.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Tue May 26 18:38:37 2020 UTC (4 years, 9 months ago) by ad
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +89 -65 lines
Make vcache_tryvget() lockless.  Reviewed by hannken@.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Mon May 18 08:27:54 2020 UTC (4 years, 10 months ago) by hannken
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +8 -2 lines
vrele_flush(): yield() every 100ms like we do it in vflush().

Revision 1.100.4.3: download - view: text, markup, annotated - select for diffs
Tue Apr 21 18:42:42 2020 UTC (4 years, 11 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.100.4.2: preferred, colored; branchpoint 1.100: preferred, colored; next MAIN 1.101: preferred, colored
Changes since revision 1.100.4.2: +42 -31 lines
Sync with HEAD

Revision 1.118.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 20 11:29:10 2020 UTC (4 years, 11 months ago) by bouyer
Branches: bouyer-xenpvh
Diff to: previous 1.118: preferred, colored; next MAIN 1.119: preferred, colored
Changes since revision 1.118: +44 -33 lines
Sync with HEAD

Revision 1.121: download - view: text, markup, annotated - select for diffs
Sun Apr 19 13:25:00 2020 UTC (4 years, 11 months ago) by hannken
Branches: MAIN
CVS tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +6 -7 lines
Take some pressure from vdrain lock:

- Use cv_signal() instead of cv_broadcast(), there is only one waiter.
- No need to signal if number of vnodes doesn't increase.
- Use kpause(1) instead of yield().

Revision 1.120: download - view: text, markup, annotated - select for diffs
Mon Apr 13 19:23:18 2020 UTC (4 years, 11 months ago) by ad
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +36 -24 lines
Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed().  Signature matches
FreeBSD.

Revision 1.119: download - view: text, markup, annotated - select for diffs
Mon Apr 13 15:54:45 2020 UTC (4 years, 11 months ago) by maxv
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +6 -6 lines
hardclock_ticks -> getticks()

Revision 1.100.4.2: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:08:52 2020 UTC (4 years, 11 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.100.4.1: preferred, colored; branchpoint 1.100: preferred, colored
Changes since revision 1.100.4.1: +245 -128 lines
Merge changes from current as of 20200406

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sat Apr 4 20:54:42 2020 UTC (4 years, 11 months ago) by ad
Branches: MAIN
CVS tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +4 -5 lines
vrelel(): clear VV_MAPPED with the vnode still locked.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Sat Apr 4 20:49:30 2020 UTC (4 years, 11 months ago) by ad
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +10 -13 lines
Merge the remaining changes from the ad-namecache branch, affecting namei()
and getcwd():

- push vnode locking back as far as possible.
- do most lookups directly in the namecache, avoiding vnode locks & refs.
- don't block new refs to vnodes across VOP_INACTIVE().
- get shared locks for VOP_LOOKUP() if the file system supports it.
- correct lock types for VOP_ACCESS() / VOP_GETATTR() in a few places.

Possible future enhancements:

- make the lookups lockless.
- support dotdot lookups by being lockless and inferring absence of chroot.
- maybe make it work for layered file systems.
- avoid vnode references at the root & cwd.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Sun Mar 22 18:45:28 2020 UTC (5 years ago) by ad
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +3 -2 lines
Process concurrent page faults on individual uvm_objects / vm_amaps in
parallel, where the relevant pages are already in-core.  Proposed on
tech-kern.

Temporarily disabled on MP architectures with __HAVE_UNLOCKED_PMAP until
adjustments are made to their pmaps.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Sun Mar 22 16:43:57 2020 UTC (5 years ago) by ad
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +2 -3 lines
Fix build failure.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Sun Mar 22 14:38:37 2020 UTC (5 years ago) by ad
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +12 -9 lines
Merge vfs_cache.c from the ad-namecache branch.  With this the namecache
index becomes per-directory (initially, a red-black tree).  The remaining
changes on the branch to namei()/getcwd() will be merged in the future.

Revision 1.105.2.9: download - view: text, markup, annotated - select for diffs
Sat Feb 29 20:21:03 2020 UTC (5 years ago) by ad
Branches: ad-namecache
Diff to: previous 1.105.2.8: preferred, colored; branchpoint 1.105: preferred, colored; next MAIN 1.106: preferred, colored
Changes since revision 1.105.2.8: +39 -14 lines
Sync with head.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Thu Feb 27 22:12:54 2020 UTC (5 years ago) by ad
Branches: MAIN
CVS tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +7 -8 lines
Tighten up the locking around vp->v_iflag a little more after the recent
split of vmobjlock & v_interlock.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Sun Feb 23 22:14:04 2020 UTC (5 years ago) by ad
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +99 -22 lines
Merge from ad-namecache:

- Have a stab at clustering the members of vnode_t and vnode_impl_t in a
  more cache-conscious way.  With that done, go back to adjusting v_usecount
  with atomics and keep vi_lock directly in vnode_impl_t (saves KVA).

- Allow VOP_LOCK(LK_NONE) for the benefit of VFS_VGET() and VFS_ROOT().
  Make sure LK_UPGRADE always comes with LK_NOWAIT.

- Make cwdinfo use mostly lockless.

Revision 1.105.2.8: download - view: text, markup, annotated - select for diffs
Sun Feb 23 19:14:03 2020 UTC (5 years ago) by ad
Branches: ad-namecache
Diff to: previous 1.105.2.7: preferred, colored; branchpoint 1.105: preferred, colored
Changes since revision 1.105.2.7: +8 -30 lines
Turns out there's no point adjusting v_holdcnt with atomics.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Sun Feb 23 15:46:41 2020 UTC (5 years ago) by ad
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +32 -7 lines
UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart.  v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap.  Others to follow later.

Revision 1.105.2.7: download - view: text, markup, annotated - select for diffs
Sat Jan 25 22:38:51 2020 UTC (5 years, 1 month ago) by ad
Branches: ad-namecache
Diff to: previous 1.105.2.6: preferred, colored; branchpoint 1.105: preferred, colored
Changes since revision 1.105.2.6: +11 -2 lines
Sync with head.

Revision 1.105.2.6: download - view: text, markup, annotated - select for diffs
Sat Jan 25 15:54:03 2020 UTC (5 years, 1 month ago) by ad
Branches: ad-namecache
Diff to: previous 1.105.2.5: preferred, colored; branchpoint 1.105: preferred, colored
Changes since revision 1.105.2.5: +4 -2 lines
Make cwdinfo use mostly lockless, and largely hide the details in vfs_cwd.c.

Revision 1.105.2.5: download - view: text, markup, annotated - select for diffs
Fri Jan 24 16:05:22 2020 UTC (5 years, 1 month ago) by ad
Branches: ad-namecache
Diff to: previous 1.105.2.4: preferred, colored; branchpoint 1.105: preferred, colored
Changes since revision 1.105.2.4: +117 -22 lines
vnodes:

- Have own v_usecount again, don't share the uvm_object's refcount.
- Cluster the members of vnode_t and vnode_impl_t in a cache-concious way.
- Go back to having vi_lock directly in vnode_impl_t.
- Go back to having v_usecount adjusted with atomics.
- Start adjusting v_holdcnt with atomics, too.
- Put all the namecache stuff back into vnode_impl_t.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Thu Jan 23 20:53:33 2020 UTC (5 years, 1 month ago) by ad
Branches: MAIN
CVS tags: ad-namecache-base2
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +6 -6 lines
Do not clean up segvguard while holding v_interlock.c

Revision 1.105.2.4: download - view: text, markup, annotated - select for diffs
Thu Jan 23 19:28:39 2020 UTC (5 years, 1 month ago) by ad
Branches: ad-namecache
Diff to: previous 1.105.2.3: preferred, colored; branchpoint 1.105: preferred, colored
Changes since revision 1.105.2.3: +9 -5 lines
vcache_reclaim(): purge namecache immediately after setting vnode to
VS_RECLAIMED.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Thu Jan 23 11:17:09 2020 UTC (5 years, 2 months ago) by ad
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +4 -2 lines
#ifdef _KERNEL_OPT for previous

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Jan 23 10:21:14 2020 UTC (5 years, 2 months ago) by ad
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +9 -2 lines
PAX_SEGVGUARD doesn't seem to work properly in testing for me, but at least
make it not cause problems:

- Cover it with exec_lock so the updates are not racy.
- Using fileassoc is silly.  Just hang a pointer off the vnode.

Revision 1.105.2.3: download - view: text, markup, annotated - select for diffs
Fri Jan 17 21:55:13 2020 UTC (5 years, 2 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.105.2.2: preferred, colored; branchpoint 1.105: preferred, colored
Changes since revision 1.105.2.2: +12 -15 lines
vrelel: don't change the vnode state to VS_BLOCKED for VOP_INACTIVE(), it's
not needed (at least not for the usual case).  Will revist before merge.

Revision 1.105.2.2: download - view: text, markup, annotated - select for diffs
Fri Jan 17 21:47:35 2020 UTC (5 years, 2 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.105.2.1: preferred, colored; branchpoint 1.105: preferred, colored
Changes since revision 1.105.2.1: +56 -41 lines
Sync with head.

Revision 1.107: download - view: text, markup, annotated - select for diffs
Sun Jan 12 17:49:17 2020 UTC (5 years, 2 months ago) by ad
Branches: MAIN
CVS tags: ad-namecache-base1
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +56 -39 lines
vput(): don't drop the vnode lock, carry the hold over into vrelel() which
might need it anyway.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Wed Jan 8 12:04:56 2020 UTC (5 years, 2 months ago) by ad
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +3 -3 lines
- options NAMECACHE_ENTER_REVERSE is no more.

- Partially sort the list of per-vnode namecache entries by using a TAILQ.
  Put the real name to the head, and put dot and dotdot to the tail so that
  cache_lookup_reverse() doesn't have to consider them.

Revision 1.105.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 8 11:02:16 2020 UTC (5 years, 2 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +4 -3 lines
Redo the namecache to focus on per-directory data structures, removing the
huge hashtable and nasty locking scheme.

Initially this uses rbtrees (because that's what's there).  The intent is
experiment with other data structures.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Mon Dec 16 22:47:54 2019 UTC (5 years, 3 months ago) by ad
Branches: MAIN
CVS tags: ad-namecache-base
Branch point for: ad-namecache
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +6 -8 lines
- Extend the per-CPU counters matt@ did to include all of the hot counters
  in UVM, excluding uvmexp.free, which needs special treatment and will be
  done with a separate commit.  Cuts system time for a build by 20-25% on
  a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).

Revision 1.104: download - view: text, markup, annotated - select for diffs
Sun Dec 1 13:56:29 2019 UTC (5 years, 3 months ago) by ad
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +104 -111 lines
Minor vnode locking changes:

- Stop using atomics to maniupulate v_usecount.  It was a mistake to begin
  with.  It doesn't work as intended unless the XLOCK bit is incorporated in
  v_usecount and we don't have that any more.  When I introduced this 10+
  years ago it was to reduce pressure on v_interlock but it doesn't do that,
  it just makes stuff disappear from lockstat output and introduces problems
  elsewhere.  We could do atomic usecounts on vnodes but there has to be a
  well thought out scheme.

- Resurrect LK_UPGRADE/LK_DOWNGRADE which will be needed to work effectively
  when there is increased use of shared locks on vnodes.

- Allocate the vnode lock using rw_obj_alloc() to reduce false sharing of
  struct vnode.

- Put all of the LRU lists into a single cache line, and do not requeue a
  vnode if it's already on the correct list and was requeued recently (less
  than a second ago).

Kernel build before and after:

119.63s real  1453.16s user  2742.57s system
115.29s real  1401.52s user  2690.94s system

Revision 1.100.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:09:04 2019 UTC (5 years, 9 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +9 -9 lines
Sync with HEAD

Revision 1.103: download - view: text, markup, annotated - select for diffs
Wed Feb 20 10:07:27 2019 UTC (6 years, 1 month ago) by hannken
Branches: MAIN
CVS tags: phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +5 -7 lines
Attach "mnt_transinfo" to "dead_rootmount" so every mount has a
valid "mnt_transinfo" and remove now unneeded flag IMNT_HAS_TRANS.

Run fstrans_start()/fstrans_done() on dead_rootmount if FSTRANS_DEAD_ENABLED.
Should become the default for DIAGNOSTIC in the future.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Wed Feb 20 10:06:33 2019 UTC (6 years, 1 month ago) by hannken
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +4 -2 lines
Assign vnode to dead_rootmount before vcache_dealloc() releases it.

Now v_mount is never NULL.

Revision 1.100.2.1: download - view: text, markup, annotated - select for diffs
Fri Jan 18 08:50:57 2019 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.100: preferred, colored; next MAIN 1.101: preferred, colored
Changes since revision 1.100: +4 -4 lines
Synch with HEAD

Revision 1.101: download - view: text, markup, annotated - select for diffs
Tue Jan 1 10:06:54 2019 UTC (6 years, 2 months ago) by hannken
Branches: MAIN
CVS tags: pgoyette-compat-20190127, pgoyette-compat-20190118
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +4 -4 lines
Add "void *extra" argument to vcache_new() so a file system may
pass more information about the file to create.

Welcome to 8.99.30

Revision 1.15.6.4: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:38:45 2017 UTC (7 years, 3 months ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.15.6.3: preferred, colored; branchpoint 1.15: preferred, colored; next MAIN 1.16: preferred, colored
Changes since revision 1.15.6.3: +1099 -803 lines
update from HEAD

Revision 1.93.2.3: download - view: text, markup, annotated - select for diffs
Fri Nov 17 14:34:02 2017 UTC (7 years, 4 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Diff to: previous 1.93.2.2: preferred, colored; branchpoint 1.93: preferred, colored; next MAIN 1.94: preferred, colored
Changes since revision 1.93.2.2: +26 -8 lines
Pull up following revision(s) (requested by hannken in ticket #309):
	sys/sys/vnode_impl.h: revision 1.17
	sys/kern/vfs_vnode.c: revision 1.99, 1.100

Change the VSTATE_ASSERT_UNLOCKED code by pushing the potential lock
handling into the backend and doing an optimistic (unlocked) check
first. Always taking the vnode interlock makes this assertion otherwise
very heavy for multi-processor machines.
-
Fix non-DIAGNOSTICS build by adjusting _vstate_assert here too.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Fri Sep 22 06:05:20 2017 UTC (7 years, 6 months ago) by joerg
Branches: MAIN
CVS tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi, pgoyette-compat
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +4 -3 lines
Fix non-DIAGNOSTICS build by adjusting _vstate_assert here too.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Thu Sep 21 18:19:44 2017 UTC (7 years, 6 months ago) by joerg
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +24 -7 lines
Change the VSTATE_ASSERT_UNLOCKED code by pushing the potential lock
handling into the backend and doing an optimistic (unlocked) check
first. Always taking the vnode interlock makes this assertion otherwise
very heavy for multi-processor machines. Ride the kernel version bump.

Revision 1.39.2.9: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:53:08 2017 UTC (7 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.39.2.8: preferred, colored; branchpoint 1.39: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39.2.8: +342 -166 lines
Sync with HEAD

Revision 1.93.2.2: download - view: text, markup, annotated - select for diffs
Fri Aug 25 05:46:46 2017 UTC (7 years, 6 months ago) by snj
Branches: netbsd-8
CVS tags: matt-nb8-mediatek-base, matt-nb8-mediatek
Diff to: previous 1.93.2.1: preferred, colored; branchpoint 1.93: preferred, colored
Changes since revision 1.93.2.1: +104 -25 lines
Pull up following revision(s) (requested by hannken in ticket #227):
	sys/sys/vnode_impl.h: revision 1.16
	sys/kern/vfs_vnode.c: revision 1.97
	sys/kern/vfs_vnode.c: revision 1.98
	sys/kern/vfs_mount.c: revision 1.67
	sys/miscfs/deadfs/dead_vfsops.c: revision 1.8
No need to cache anonymous device vnodes, they will never be looked up.
Set key to (dead_rootmount, 0, NULL) and add assertions.
--
Change forced unmount to revert open device vnodes to anonymous devices.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Mon Aug 21 09:00:21 2017 UTC (7 years, 7 months ago) by hannken
Branches: MAIN
CVS tags: nick-nhusb-base-20170825
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +69 -2 lines
Change forced unmount to revert open device vnodes to anonymous devices.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Mon Aug 21 08:56:45 2017 UTC (7 years, 7 months ago) by hannken
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +37 -25 lines
No need to cache anonymous device vnodes, they will never be looked up.

Set key to (dead_rootmount, 0, NULL) and add assertions.

Revision 1.93.2.1: download - view: text, markup, annotated - select for diffs
Sun Jun 4 20:35:01 2017 UTC (7 years, 9 months ago) by bouyer
Branches: netbsd-8
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +50 -57 lines
pullup the following revisions, requested by hannken in ticket #2:
	src/share/man/man9/fstrans.9			1.25
	src/sys/kern/vfs_mount.c			1.66
	src/sys/kern/vfs_subr.c				1.468
	src/sys/kern/vfs_trans.c			1.46
	src/sys/kern/vfs_vnode.c			1.94, 1.95, 1.96
	src/sys/kern/vnode_if.c				1.105, 1.106
	src/sys/kern/vnode_if.sh			1.65, 1.66
	src/sys/kern/vnode_if.src			1.76
	src/sys/miscfs/genfs/genfs_io.c			1.69
	src/sys/miscfs/genfs/genfs_vnops.c		1.196, 1.197
	src/sys/miscfs/genfs/layer_extern.h		1.40
	src/sys/miscfs/genfs/layer_vfsops.c		1.51
	src/sys/miscfs/genfs/layer_vnops.c		1.67
	src/sys/miscfs/nullfs/null_vnops.c		1.42
	src/sys/miscfs/overlay/overlay_vnops.c		1.24
	src/sys/miscfs/umapfs/umap_vnops.c		1.60
	src/sys/rump/include/rump/rumpvnode_if.h	1.29, 1.30
	src/sys/rump/librump/rumpkern/emul.c		1.182
	src/sys/rump/librump/rumpvfs/rumpvnode_if.c	1.29, 1.30
	src/sys/sys/fstrans.h				1.11
	src/sys/sys/vnode.h				1.278
	src/sys/sys/vnode_if.h				1.100, 1.101
	src/sys/sys/vnode_impl.h			1.14, 1.15
	src/sys/ufs/lfs/lfs_pages.c			1.12

Vnode state, lock and fstrans cleanup:
- Rename vnode state "VS_ACTIVE" to "VS_LOADED" and add synthetic
  state "VS_ACTIVE" to assert a loaded vnode with usecount > 0.

- Redo FSTRANS in vnode_if.c and use it for VOP_LOCK and VOP_UNLOCK.

- Cleanup the genfs lock operations.

- Make "struct vnode_impl" member "vi_lock" a krwlock_t again.

- Remove the lock type argument from fstrans_start and
  fstrans_start_nowait,
  remove now unused FSTRANS state "FSTRANS_SUSPENDING".

Revision 1.96: download - view: text, markup, annotated - select for diffs
Sun Jun 4 08:05:42 2017 UTC (7 years, 9 months ago) by hannken
Branches: MAIN
CVS tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +5 -5 lines
Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Sun Jun 4 08:02:26 2017 UTC (7 years, 9 months ago) by hannken
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +4 -19 lines
Locking a layer vnode using the regular bypass routine is no longer
racy.  Undo the change from 2017-03-30 11:16:52, commitid eurqbzuGxGRlryLz
and make vi_lock a krwlock_t again.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun Jun 4 07:58:29 2017 UTC (7 years, 9 months ago) by hannken
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +45 -37 lines
A vnode is usually called "active", if it has an associated file system
node and a usecount greater zero.  Therefore rename state "VS_ACTIVE"
to "VS_LOADED" and add a new synthetic state "VS_ACTIVE" for VSTATE_ASSERT()
to assert an active vnode.

Add VSTATE_ASSERT_UNLOCKED() to be used with v_interlock unheld and
move the state assertion macros to sys/vnode_impl.h.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun May 28 16:39:41 2017 UTC (7 years, 9 months ago) by hannken
Branches: MAIN
CVS tags: netbsd-8-base
Branch point for: netbsd-8
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +5 -2 lines
Restrict vgone() to suspended file systems only.

Welcome to 7.99.75, old file system modules would cause a diagnostic
assertion with new kernel.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Sun May 28 16:35:47 2017 UTC (7 years, 9 months ago) by hannken
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +35 -19 lines
Add a helper to propagate file system suspension for vrevoke().

Take care to retry suspension on interrupt as vrevoke must succeed.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Fri May 26 14:40:09 2017 UTC (7 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +4 -2 lines
Check VOP_INACTIVE contract with a judicious assert.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Fri May 26 14:39:20 2017 UTC (7 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +5 -3 lines
Clarify comment.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Fri May 26 14:20:59 2017 UTC (7 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +2 -3 lines
Make VOP_RECLAIM do the last unlock of the vnode.

VOP_RECLAIM naturally has exclusive access to the vnode, so having it
locked on entry is not strictly necessary -- but it means if there
are any final operations that must be done on the vnode, such as
ffs_update, requiring exclusive access to it, we can now kassert that
the vnode is locked in those operations.

We can't just have the caller release the last lock because some file
systems don't use genfs_lock, and require the vnode to remain valid
for VOP_UNLOCK to work, notably unionfs.

Revision 1.87.2.1: download - view: text, markup, annotated - select for diffs
Fri May 19 00:22:57 2017 UTC (7 years, 10 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.87: preferred, colored; next MAIN 1.88: preferred, colored
Changes since revision 1.87: +24 -7 lines
Resolve conflicts from previous merge (all resulting from $NetBSD
keywork expansion)

Revision 1.88: download - view: text, markup, annotated - select for diffs
Wed May 17 12:46:14 2017 UTC (7 years, 10 months ago) by hannken
Branches: MAIN
CVS tags: prg-localcount2-base3
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +24 -7 lines
Suspend file system while revoking a vnode.  This way no operations run
on the mounted file system during revoke and all operations see
the state before or after the revoke.

Revision 1.53.2.4: download - view: text, markup, annotated - select for diffs
Wed Apr 26 02:53:27 2017 UTC (7 years, 10 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.53.2.3: preferred, colored; branchpoint 1.53: preferred, colored; next MAIN 1.54: preferred, colored
Changes since revision 1.53.2.3: +122 -102 lines
Sync with HEAD

Revision 1.72.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:54:03 2017 UTC (7 years, 11 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.72: preferred, colored; next MAIN 1.73: preferred, colored
Changes since revision 1.72: +182 -107 lines
Sync with HEAD

Revision 1.87: download - view: text, markup, annotated - select for diffs
Mon Apr 17 08:32:01 2017 UTC (7 years, 11 months ago) by hannken
Branches: MAIN
CVS tags: prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426, bouyer-socketcan-base1
Branch point for: prg-localcount2
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +11 -9 lines
Remove unused argument "nextp" from vfs_busy() and vfs_unbusy().
Remove argument "keepref" from vfs_unbusy() and add vfs_ref() where needed.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Mon Apr 17 08:31:02 2017 UTC (7 years, 11 months ago) by hannken
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +3 -3 lines
Add vfs_ref(mp) and vfs_rele(mp) to add or remove a reference to
struct mount.  Rename vfs_destroy(mp) to vfs_rele(mp) and replace
incrementing mp->mnt_refcnt with vfs_ref(mp).

Revision 1.85: download - view: text, markup, annotated - select for diffs
Sun Apr 16 16:48:08 2017 UTC (7 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +3 -3 lines
Back out previous.

Breaks file systems for which VOP_UNLOCK doesn't work on a reclaimed
vnode.

The only case in tree right now is sys/fs/union -- most file systems
use genfs_unlock, which does work on a reclaimed vnode.

Maybe we can work around this -- and still enable VOP_RECLAIM's
callees to assert lock ownership -- by having VOP_RECLAIM unlock the
vnode instead.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Sat Apr 15 23:16:53 2017 UTC (7 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +3 -3 lines
Keep vnode locked during VOP_RECLAIM.

No bump because it wouldn't have been possible to acquire the lock in
VOP_RECLAIM anyway -- instant deadlock because vn_lock waits to
transition out of the RECLAIMING state first.  Benefit is that we can
now assert ownership of the lock in any operations called by
VOP_RECLAIM.

Discussed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Revision 1.83: download - view: text, markup, annotated - select for diffs
Tue Apr 11 14:45:46 2017 UTC (7 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +5 -8 lines
Simplify: eliminate a now-needless unlock/lock cycle.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Tue Apr 11 14:25:00 2017 UTC (7 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +6 -4 lines
Make VOP_INACTIVE preserve vnode lock on return.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!

Revision 1.81: download - view: text, markup, annotated - select for diffs
Thu Mar 30 09:16:52 2017 UTC (7 years, 11 months ago) by hannken
Branches: MAIN
CVS tags: jdolecek-ncq-base, jdolecek-ncq
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +19 -4 lines
Locking a layer vnode is racy as it may become reclaimed before
calling the operation on the lower vnode.

Replace vi_lock with a rw_obj and change layered file systems
to share the lock with the lower vnode.

Layered file systems now use genfs_lock()/_unlock/_islocked().

Welcome to 7.99.67

Revision 1.80: download - view: text, markup, annotated - select for diffs
Thu Mar 30 09:15:51 2017 UTC (7 years, 11 months ago) by hannken
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +13 -8 lines
Change the operations vector before changing the mount.

Vnode operations enter the mount before using the vector.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Thu Mar 30 09:14:59 2017 UTC (7 years, 11 months ago) by hannken
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +69 -74 lines
Change vrelel() to defer the test for a reclaimed vnode until
we hold both the interlock and the vnode lock.

Add a common operation to deallocate a vnode in state LOADING.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Thu Mar 30 09:14:08 2017 UTC (7 years, 11 months ago) by hannken
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +12 -8 lines
Add flag VRELEL_FORCE_RELE to vrelel() to force release and
use it from vdrain_vrele() and vrele_flush() to prevent a
possible live lock from vrele_flush().

Revision 1.77: download - view: text, markup, annotated - select for diffs
Thu Mar 30 09:12:21 2017 UTC (7 years, 11 months ago) by hannken
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +4 -4 lines
Change last users of FSTRANS_LAZY to FSTRANS_SHARED and change
genfs_suspendctl() to move from FSTRANS_NORMAL to FSTRANS_SUSPENDED
and vice versa.

Revision 1.53.2.3: download - view: text, markup, annotated - select for diffs
Mon Mar 20 06:57:48 2017 UTC (8 years ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.53.2.2: preferred, colored; branchpoint 1.53: preferred, colored
Changes since revision 1.53.2.2: +69 -14 lines
Sync with HEAD

Revision 1.76: download - view: text, markup, annotated - select for diffs
Mon Mar 6 10:07:52 2017 UTC (8 years ago) by hannken
Branches: MAIN
CVS tags: pgoyette-localcount-20170320
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +8 -9 lines
Change vrecycle() and vgone() to lock with LK_RETRY.  If this node is
a layerfs node the lower node(s) may already be reclaimed.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Fri Feb 17 08:30:00 2017 UTC (8 years, 1 month ago) by hannken
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +43 -2 lines
Bring back vrele_flush() to flush deferred vrele() o an suspended file system.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Fri Feb 17 08:27:58 2017 UTC (8 years, 1 month ago) by hannken
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +7 -2 lines
Make sure vcache_reclaim() will complete before file system suspension.

Revision 1.39.2.8: download - view: text, markup, annotated - select for diffs
Sun Feb 5 13:40:56 2017 UTC (8 years, 1 month ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.39.2.7: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.7: +464 -473 lines
Sync with HEAD

Revision 1.73: download - view: text, markup, annotated - select for diffs
Fri Jan 27 10:50:10 2017 UTC (8 years, 1 month ago) by hannken
Branches: MAIN
CVS tags: nick-nhusb-base-20170204
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +14 -4 lines
Vrecycle() cannot wait for the vnode lock.  On a leaf file system this lock
will always succeed as we hold the last reference and prevent further
references.  On layered file systems waiting for the lock would open a can of
deadlocks as the lower vnodes may have other active references.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Wed Jan 11 09:08:58 2017 UTC (8 years, 2 months ago) by hannken
Branches: MAIN
CVS tags: bouyer-socketcan-base
Branch point for: bouyer-socketcan
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +4 -4 lines
Move vnode member v_lock as vi_lock to vnode_impl.h.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Jan 11 09:04:37 2017 UTC (8 years, 2 months ago) by hannken
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +4 -4 lines
Move vnode members v_dnclist and v_nclist as vi_dnclist and
vi_nclist to vnode_impl.h.

Revision 1.53.2.2: download - view: text, markup, annotated - select for diffs
Sat Jan 7 08:56:49 2017 UTC (8 years, 2 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.53.2.1: preferred, colored; branchpoint 1.53: preferred, colored
Changes since revision 1.53.2.1: +478 -499 lines
Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.70: download - view: text, markup, annotated - select for diffs
Thu Jan 5 10:05:11 2017 UTC (8 years, 2 months ago) by hannken
Branches: MAIN
CVS tags: pgoyette-localcount-20170107
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +138 -139 lines
Name all "vnode_impl_t" variables "vip".
No functional change.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Wed Jan 4 17:13:50 2017 UTC (8 years, 2 months ago) by hannken
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +73 -76 lines
Expand struct vcache to individual variables (vcache.* -> vcache_*).
No functional change.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Mon Jan 2 10:36:58 2017 UTC (8 years, 2 months ago) by hannken
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +7 -2 lines
Now that v_usecount tracks valid references add some "v_usecount == 1"
assertions.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Mon Jan 2 10:35:00 2017 UTC (8 years, 2 months ago) by hannken
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +36 -60 lines
Change vcache_*vget() to increment v_usecount on success only.
Increment v_holdcnt to prevent the vnode from disappearing while
vcache_vget() waits for a stable state.

Now v_usecount tracks the number of successfull references.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Mon Jan 2 10:33:28 2017 UTC (8 years, 2 months ago) by hannken
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +97 -63 lines
Rename vget() to vcache_vget() and vcache_tryvget() respectively and
move the definitions to sys/vnode_impl.h.

No functional change intended.

Welcome to 7.99.54

Revision 1.65: download - view: text, markup, annotated - select for diffs
Tue Dec 27 11:59:36 2016 UTC (8 years, 2 months ago) by hannken
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +6 -12 lines
It is wrong to block the vnode during vcache_rekey.  The vnode may be looked
up using the old key until vcache_rekey_exit changes the key to the new one.

Add an assertion that the temporary key is different from the current one.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Tue Dec 20 10:02:21 2016 UTC (8 years, 3 months ago) by hannken
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +11 -12 lines
Restructure vdrain_vrele().  While it is not possible for another thread
to lock this vnodes v_interlock -> vdrain_lock another vnode sharing the
v_interlock may lock this order.
While here, restore fstrans_start_nowait arg to FSTRANS_LAZY.

Fixes a deadlock seen recently on some pbulk environments.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Wed Dec 14 15:49:35 2016 UTC (8 years, 3 months ago) by hannken
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +179 -208 lines
Change the freelists to lrulists, all vnodes are always on one
of the lists.  Speeds up namei on cached vnodes by ~3 percent.

Merge "vrele_thread" into "vdrain_thread" so we have one thread
working on the lrulists.  Adapt vfs_drainvnodes() to always wait
for a complete cycle of vdrain_thread().

Revision 1.62: download - view: text, markup, annotated - select for diffs
Wed Dec 14 15:48:55 2016 UTC (8 years, 3 months ago) by hannken
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +34 -26 lines
Move vnode members "v_freelisthd" and "v_freelist" from "struct vnode"
to "struct vnode_impl" and rename to "vi_lrulisthd" and "vi_lrulist".

No functional change intended.

Welcome to 7.99.48

Revision 1.61: download - view: text, markup, annotated - select for diffs
Wed Dec 14 15:46:57 2016 UTC (8 years, 3 months ago) by hannken
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +18 -20 lines
Remove the "target" argment from vfs_drainvnodes() as it is
always equal to "desiredvnodes" and move its definition
from sys/vnode.h to sys/vnode_impl.h.

Extend vfs_drainvnodes() to also wait for deferred vrele to flush
and replace the call to vrele_flush() with a call to vfs_drainvnodes().

Revision 1.39.2.7: download - view: text, markup, annotated - select for diffs
Mon Dec 5 10:55:26 2016 UTC (8 years, 3 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.39.2.6: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.6: +170 -240 lines
Sync with HEAD

Revision 1.60: download - view: text, markup, annotated - select for diffs
Thu Dec 1 14:49:03 2016 UTC (8 years, 3 months ago) by hannken
Branches: MAIN
CVS tags: nick-nhusb-base-20161204
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +35 -37 lines
- Change vcache_reclaim() to always call VOP_INACTIVE() before VOP_RECLAIM().
  When called from vrecycle() or vgone() there is a window where the refcount
  is greater than zero and another thread could get and release a reference
  that would miss VOP_INACTIVE() as the refcount doesn't drop to zero.

  Adjust test fs/puffs/t_basic:  test VOP_INACTIVE count being greater zero.

- Make vrecycle() more robust by checking v_usecount first and preventing
  further references across vn_lock().  Fixes a deadlock where one thread
  starts unmount, second thread locks a directory and allocates a vnode
  and first thread tries to vrecycle() the directory.
  First thread holds vfs_busy and wants vnode, second thread holds vnode
  and wants vfs_busy.

- With these fixes in place change cleanvnode() to use vget()/vrecycle()
  to reclaim the vnode.

Revision 1.53.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 4 14:49:17 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +217 -197 lines
Sync with HEAD

Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Nov 3 11:04:21 2016 UTC (8 years, 4 months ago) by hannken
Branches: MAIN
CVS tags: pgoyette-localcount-20161104
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +2 -45 lines
Add a function to print the fields of a vnode including its implementation
and use it from vprint() and vfs_vnode_print().

Move vstate_name() to vfs_subr.c.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Thu Nov 3 11:03:31 2016 UTC (8 years, 4 months ago) by hannken
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +3 -29 lines
Split sys/vnode.h into sys/vnode.h and sys/vnode_impl.h
- Move _VFS_VNODE_PRIVATE protected operations into vnode_impl.h.
- Move struct vnode_impl definition and operations into vnode_impl.h.
- Include vnode_impl.h where we include vnode.h with _VFS_VNODE_PRIVATE defined.
- Get rid of _VFS_VNODE_PRIVATE.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Thu Nov 3 11:02:09 2016 UTC (8 years, 4 months ago) by hannken
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +164 -163 lines
Prepare the split of sys/vnode.h into sys/vnode.h and sys/vnode_impl.h
- Rename struct vcache_node to vnode_impl, start its fields with vi_.
- Rename enum vcache_state to vnode_state, start its elements with VS_.
- Rename macros VN_TO_VP and VP_TO_VN to VIMPL_TO_VNODE and VNODE_TO_VIMPL.
- Add typedef struct vnode_impl vnode_impl_t.

Revision 1.39.2.6: download - view: text, markup, annotated - select for diffs
Wed Oct 5 20:56:03 2016 UTC (8 years, 5 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.39.2.5: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.5: +118 -114 lines
Sync with HEAD

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sat Aug 20 12:37:08 2016 UTC (8 years, 7 months ago) by hannken
Branches: MAIN
CVS tags: nick-nhusb-base-20161004, localcount-20160914
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +2 -25 lines
Remove now obsolete operation vcache_remove().

Welcome to 7.99.36

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sat Aug 20 12:33:57 2016 UTC (8 years, 7 months ago) by hannken
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +30 -4 lines
Change vcache_reclaim() to remove vnode from vnode cache once the
vnode was reclaimed from the file system.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sat Aug 20 12:31:37 2016 UTC (8 years, 7 months ago) by hannken
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +104 -103 lines
Rename vclean() to vcache_reclaim().
No functional change.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Thu Jul 7 06:55:43 2016 UTC (8 years, 8 months ago) by msaitoh
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -3 lines
KNF. Remove extra spaces. No functional change.

Revision 1.39.2.5: download - view: text, markup, annotated - select for diffs
Sun May 29 08:44:37 2016 UTC (8 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.39.2.4: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.4: +441 -252 lines
Sync with HEAD

Revision 1.52: download - view: text, markup, annotated - select for diffs
Thu May 26 11:09:55 2016 UTC (8 years, 9 months ago) by hannken
Branches: MAIN
CVS tags: nick-nhusb-base-20160529
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +160 -195 lines
Use vnode state to replace VI_MARKER, VI_CHANGING, VI_XLOCK and VI_CLEAN.

Presented on tech-kern@

Revision 1.51: download - view: text, markup, annotated - select for diffs
Thu May 26 11:08:44 2016 UTC (8 years, 9 months ago) by hannken
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +155 -3 lines
Add vnode state and supporting operations and diagnostics.

Presented on tech-kern@

Revision 1.50: download - view: text, markup, annotated - select for diffs
Thu May 26 11:07:33 2016 UTC (8 years, 9 months ago) by hannken
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +116 -93 lines
Merge the vnode and its corresponding vcache_node into one
vcache_node structure.

Print the vcache_node part in vprint() and vfs_vnode_print().

Presented on tech-kern@

Revision 1.49: download - view: text, markup, annotated - select for diffs
Thu May 19 14:50:18 2016 UTC (8 years, 10 months ago) by hannken
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +30 -14 lines
Keep the old vcache node on rekey.  Change its key and remove the
new vcache node now used as placeholder only.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Thu May 19 14:47:33 2016 UTC (8 years, 10 months ago) by hannken
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +37 -4 lines
Add VFS_VNODE_PRIVATE protected operations vnalloc_marker() to create,
vnfree_marker() to destroy and vnis_marker() to test for marker vnodes.

Make operations vnalloc() and vnfree() local to vfs_vnode.c.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Fri Apr 22 15:01:54 2016 UTC (8 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +6 -6 lines
Report what error was if nonzero with KASSERTMSG.

Revision 1.37.2.1.2.1: download - view: text, markup, annotated - select for diffs
Tue Jan 26 23:44:11 2016 UTC (9 years, 1 month ago) by snj
Branches: netbsd-7-0
CVS tags: netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Diff to: previous 1.37.2.1: preferred, colored; next MAIN 1.37.2.2: preferred, colored
Changes since revision 1.37.2.1: +27 -18 lines
Pull up following revision(s) (requested by hannken in ticket #1070):
	sys/kern/vfs_vnode.c: revision 1.46 via patch
Take the vnode lock before the vnode is marked VI_CHANGING and fed
to vclean().  Prevents a deadlock with two null mounts on the same
physical mount where one thread tries to vclean() a layer node and
another thread tries to vget() a layer node pointing to the same
physical node.
Fixes PR kern/50375 layerfs (nullfs) locking problem leading to livelock

Revision 1.37.2.2: download - view: text, markup, annotated - select for diffs
Tue Jan 26 23:43:34 2016 UTC (9 years, 1 month ago) by snj
Branches: netbsd-7
CVS tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Diff to: previous 1.37.2.1: preferred, colored; branchpoint 1.37: preferred, colored; next MAIN 1.38: preferred, colored
Changes since revision 1.37.2.1: +27 -18 lines
Pull up following revision(s) (requested by hannken in ticket #1070):
	sys/kern/vfs_vnode.c: revision 1.46 via patch
Take the vnode lock before the vnode is marked VI_CHANGING and fed
to vclean().  Prevents a deadlock with two null mounts on the same
physical mount where one thread tries to vclean() a layer node and
another thread tries to vget() a layer node pointing to the same
physical node.
Fixes PR kern/50375 layerfs (nullfs) locking problem leading to livelock

Revision 1.39.2.4: download - view: text, markup, annotated - select for diffs
Sun Dec 27 12:10:05 2015 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.39.2.3: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.3: +27 -19 lines
Sync with HEAD (as of 26th Dec)

Revision 1.46: download - view: text, markup, annotated - select for diffs
Thu Nov 12 11:35:42 2015 UTC (9 years, 4 months ago) by hannken
Branches: MAIN
CVS tags: nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +27 -19 lines
Take the vnode lock before the vnode is marked VI_CHANGING and fed
to vclean().  Prevents a deadlock with two null mounts on the same
physical mount where one thread tries to vclean() a layer node and
another thread tries to vget() a layer node pointing to the same
physical node.

Fixes PR kern/50375 layerfs (nullfs) locking problem leading to livelock

Revision 1.39.2.3: download - view: text, markup, annotated - select for diffs
Tue Sep 22 12:06:07 2015 UTC (9 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.39.2.2: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.2: +23 -115 lines
Sync with HEAD

Revision 1.45: download - view: text, markup, annotated - select for diffs
Sun Jul 12 08:11:28 2015 UTC (9 years, 8 months ago) by hannken
Branches: MAIN
CVS tags: nick-nhusb-base-20150921
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +3 -86 lines
Operations getnewvnode() and ungetnewvnode() have been replaced with vcache.
- Remove now obsolete functions getnewvnode() and ungetnewvnode().
- Document vcache operations.

Welcome to 7.99.20

Revision 1.44: download - view: text, markup, annotated - select for diffs
Tue Jun 23 10:41:59 2015 UTC (9 years, 9 months ago) by hannken
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +8 -8 lines
Use VFS_PROTOS() for deadfs.  Rename dead_mount to dead_rootmount.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Tue Jun 23 10:40:36 2015 UTC (9 years, 9 months ago) by hannken
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +16 -25 lines
Remove the test for mounted-on block devices in vclean() and
always close the vnode here.

A forced unmount of a file system holding a mounted-on
block device will make this mounted-on file system unusable.

Revision 1.39.2.2: download - view: text, markup, annotated - select for diffs
Sat Jun 6 14:40:22 2015 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.39.2.1: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.1: +9 -19 lines
Sync with HEAD

Revision 1.42: download - view: text, markup, annotated - select for diffs
Mon Apr 20 19:36:55 2015 UTC (9 years, 11 months ago) by riastradh
Branches: MAIN
CVS tags: nick-nhusb-base-20150606
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +2 -7 lines
Cull unused vnode v_iflags: VI_LAYER, VI_LOCKSHARE.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Mon Apr 20 13:44:16 2015 UTC (9 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +7 -12 lines
Make vget always return vnode unlocked.

Convert callers who want locks to use vn_lock afterward.

Add extra argument so the compiler will report stragglers.

Revision 1.39.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 6 15:18:20 2015 UTC (9 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +78 -2 lines
Sync with HEAD

Revision 1.40: download - view: text, markup, annotated - select for diffs
Tue Mar 17 09:38:21 2015 UTC (10 years ago) by hannken
Branches: MAIN
CVS tags: nick-nhusb-base-20150406
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +78 -2 lines
Add new operation "vcache_new()" to allocate and initialise a new
vnode/fsnode pair:

int
vcache_new(struct mount *mp, struct vnode *dvp, struct vattr *vap,
    kauth_cred_t cred, struct vnode **vpp)

where dvp is the (referenced) directory where we want to create the
new node, vap passes va_type, va_mode and possibly va_rdev and cred
gives the credentials to setup uid/guid.

The node returned from vcache_new() is referenced, fully initialised
and has link count zero.

Welcome to NetBSD 7.99.7

Revision 1.37.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 19 10:02:59 2014 UTC (10 years, 5 months ago) by martin
Branches: netbsd-7
CVS tags: netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1
Branch point for: netbsd-7-0
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +7 -2 lines
Pull up following revision(s) (requested by hannken in ticket #150):
	sys/kern/vfs_vnode.c: revision 1.39
When creating a vnode with vcache_get() mark the vnode VI_CHANGING until
it is fully initialised.  It may be on the specnode list before it is
fully initialised and revoking it then would panic.
Should prevent the panic from PR kern/49171 (panic when closing a pty).

Revision 1.39: download - view: text, markup, annotated - select for diffs
Fri Oct 3 14:45:38 2014 UTC (10 years, 5 months ago) by hannken
Branches: MAIN
CVS tags: nick-nhusb-base
Branch point for: nick-nhusb
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +7 -2 lines
When creating a vnode with vcache_get() mark the vnode VI_CHANGING until
it is fully initialised.  It may be on the specnode list before it is
fully initialised and revoking it then would panic.

Should prevent the panic from PR kern/49171 (panic when closing a pty).

Revision 1.38: download - view: text, markup, annotated - select for diffs
Fri Sep 5 05:57:21 2014 UTC (10 years, 6 months ago) by matt
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +4 -3 lines
Don't next structure and enum definitions.
Don't use C++ keywords new, try, class, private, etc.

Revision 1.15.6.3: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:04:29 2014 UTC (10 years, 7 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.15.6.2: preferred, colored; branchpoint 1.15: preferred, colored
Changes since revision 1.15.6.2: +525 -220 lines
Rebase to HEAD as of a few days ago.

Revision 1.35.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 06:55:58 2014 UTC (10 years, 7 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35: +324 -13 lines
Rebase.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat Jul 5 09:33:15 2014 UTC (10 years, 8 months ago) by hannken
Branches: MAIN
CVS tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base
Branch point for: netbsd-7
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +84 -2 lines
Add vcache operations to support key changes:

vcache_rekey_enter locks the old cache node and creates and locks the
  new cache node.  It is an error if the new cache node exists.

vcache_rekey_exit removes the old cache node and finalizes and
  unlocks the new cache node.

No objections on tech-kern@

Welcome to 6.99.46

Revision 1.14.2.6: download - view: text, markup, annotated - select for diffs
Thu May 22 19:11:17 2014 UTC (10 years, 10 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.14.2.5: preferred, colored; branchpoint 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14.2.5: +4 -3 lines
adapt assertions to this branch

Revision 1.14.2.5: download - view: text, markup, annotated - select for diffs
Thu May 22 11:41:04 2014 UTC (10 years, 10 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.14.2.4: preferred, colored; branchpoint 1.14: preferred, colored
Changes since revision 1.14.2.4: +447 -243 lines
sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.19.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 17:46:08 2014 UTC (10 years, 10 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.19: preferred, colored; next MAIN 1.20: preferred, colored
Changes since revision 1.19: +443 -220 lines
sync with head

Revision 1.36: download - view: text, markup, annotated - select for diffs
Thu May 8 08:21:53 2014 UTC (10 years, 10 months ago) by hannken
Branches: MAIN
CVS tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +242 -13 lines
Add a global vnode cache:

- vcache_get() retrieves a referenced and initialised vnode / fs node pair.
- vcache_remove() removes a vnode / fs node pair from the cache.

On cache miss vcache_get() calls new vfs operation vfs_loadvnode() to
initialise a vnode / fs node pair.  This call is guaranteed exclusive,
no other thread will try to load this vnode / fs node pair.

Convert ufs/ext2fs, ufs/ffs and ufs/mfs to use this interface.

Remove now unused ufs/ufs_ihash

Discussed on tech-kern.

Welcome to 6.99.41

Revision 1.35: download - view: text, markup, annotated - select for diffs
Mon Mar 24 13:42:40 2014 UTC (11 years ago) by hannken
Branches: MAIN
CVS tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Branch point for: tls-earlyentropy
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +29 -3 lines
- Make VI_XLOCK, VI_CLEAN and VI_LOCKSHARE private to kern/vfs_*.c.
- Make vwait() static.
- Add  vdead_check() to check a vnode for being or becoming dead.

Discussed on tech-kern.

Welcome to 6.99.38

Revision 1.34: download - view: text, markup, annotated - select for diffs
Mon Mar 17 09:27:37 2014 UTC (11 years ago) by hannken
Branches: MAIN
CVS tags: riastradh-drm2-base3
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +15 -3 lines
Add fstrans_startnowait()/fstrans_done() to vrele_thread().

Revision 1.33: download - view: text, markup, annotated - select for diffs
Wed Mar 5 09:37:29 2014 UTC (11 years ago) by hannken
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +18 -15 lines
Current support for iterating over mnt_vnodelist is rudimentary.  Every
caller has to care about list and vnode mutexes, reference count being zero,
intermediate vnode states like VI_CLEAN, VI_XLOCK, VI_MARKER and so on.

Add an interface to iterate over a vnode list:

void vfs_vnode_iterator_init(struct mount *mp, struct vnode_iterator **marker)
void vfs_vnode_iterator_destroy(struct vnode_iterator *marker)
bool vfs_vnode_iterator_next(struct vnode_iterator *marker, struct vnode **vpp)

vfs_vnode_iterator_next() returns either "false / *vpp == NULL" when done
or "true / *vpp != NULL" to return the next referenced vnode from the list.

To make vrecycle() work in this environment change it to

bool vrecycle(struct vnode *vp)

where "vp" is a referenced vnode to be destroyed if this is the last reference.

Discussed on tech-kern.

Welcome to 6.99.34

Revision 1.32: download - view: text, markup, annotated - select for diffs
Thu Feb 27 16:51:38 2014 UTC (11 years ago) by hannken
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +31 -31 lines
The current implementation of vn_lock() is racy.  Modification of
the vnode operations vector for active vnodes is unsafe because it
is not known whether deadfs or the original file system will be
called.

- Pass down LK_RETRY to the lock operation (hint for deadfs only).

- Change deadfs lock operation to return ENOENT if LK_RETRY is unset.

- Change all other lock operations to check for dead vnode once
  the vnode is locked and unlock and return ENOENT in this case.

With these changes in place vnode lock operations will never succeed
after vclean() has marked the vnode as VI_XLOCK and before vclean()
has changed the operations vector.

Adresses PR kern/37706 (Forced unmount of file systems is unsafe)

Discussed on tech-kern.

Welcome to 6.99.33

Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Feb 27 13:00:06 2014 UTC (11 years ago) by hannken
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +12 -8 lines
Currently dead vnodes still reside on the vnodelist of the file system
they have been removed from.

Create a "dead mount" that takes dead vnodes until they get freed.

Discussed on tech-kern.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sat Dec 7 10:03:28 2013 UTC (11 years, 3 months ago) by hannken
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +12 -28 lines
When deciding to defer in vrelel():
- No need to always defer layer vnodes, if we get the vnode lock it
  is safe to inactivate.
- Always use VOP_LOCK(), it makes no sense to use vn_lock() here.
- No need to drop v_interlock for VOP_LOCK(... LK_NOWAIT).

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sun Dec 1 17:29:40 2013 UTC (11 years, 3 months ago) by christos
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +62 -57 lines
Put back the vnode changes I backed out yesterday; they were not the problem.
I've tested them with 2 -j 20 builds on an 8 cpu box. It crashed reliably
with the pcu changes present before.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Sun Dec 1 00:59:34 2013 UTC (11 years, 3 months ago) by christos
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +57 -62 lines
Revert recent vnode changes per PR/48411, I still have deadlocks with
build -j 20 on an 8 cpu machine.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Fri Nov 29 14:58:55 2013 UTC (11 years, 3 months ago) by hannken
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +24 -14 lines
Change vrelel() to mark the vnode as changing after it has aquired
the vnode lock but before it calls VOP_INACTIVE().

Should fix the race between layer_node_find() trying to vget(, LK_NOWAIT)
a locked vnode when vrelel() marked it as changing and wants its lock.

PR kern/48411 (repeatable SMP crashes in amd64-current)

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sat Nov 23 13:46:22 2013 UTC (11 years, 4 months ago) by hannken
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +49 -54 lines
Replace VI_INACTNOW and VI_INACTREDO with a new flag VI_CHANGING that gets
set while a vnode changes state from active to inactive or from active
or inactive to clean and protects "vclean(); vrelel()" and "vrelel()"
against "vget()".

Presented on tech-kern.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Thu Nov 7 09:48:34 2013 UTC (11 years, 4 months ago) by hannken
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +21 -27 lines
Make vclean static (ride 6.99.2).

DOCLOSE is no longer needed -- remove.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sun Nov 3 08:33:00 2013 UTC (11 years, 4 months ago) by hannken
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +24 -54 lines
cleanvnode():
- VC_XLOCK/VC_MASK are not used anymore, remove.
- If we get a reference while cleaning, there is no need to retry as
  these reference and this vnode will disappear soon.
- Make sure we run inside a fstrans transaction to prevent deadlocks
  against vget().

vrecycle():
- don't even try to recycle a vnode currently cleaning.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Tue Oct 29 09:53:51 2013 UTC (11 years, 4 months ago) by hannken
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +34 -36 lines
Vnode API cleanup pass 1.

- Make these defines and functions private to vfs_vnode.c:

  VC_MASK, VC_LOCK, DOCLOSE, VI_IANCTREDO and VI_INACTNOW
  vclean() and vrelel()

- Remove the long time unused lwp argument from vrecycle().

- Remove vtryget(), it is responsible for ugly hacks and doesn't
  look that effective.

Presented on tech-kern.

Welcome to 6.99.25

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Oct 25 20:39:40 2013 UTC (11 years, 4 months ago) by martin
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +4 -4 lines
Mark diagnostic-only variables

Revision 1.21: download - view: text, markup, annotated - select for diffs
Mon Sep 30 15:24:14 2013 UTC (11 years, 5 months ago) by hannken
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +2 -6 lines
Remove VI_INACTPEND. Last consumer was vcount() which got removed 2010-01-08.

Reviewed by: David Holland <dholland@netbsd.org>

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sat Sep 21 19:51:33 2013 UTC (11 years, 6 months ago) by dholland
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +4 -2 lines
In description of a locking mess, add reference to the PR for the bug
the mess is supposed to help with.

Revision 1.15.6.2: download - view: text, markup, annotated - select for diffs
Mon Feb 25 00:29:57 2013 UTC (12 years ago) by tls
Branches: tls-maxphys
Diff to: previous 1.15.6.1: preferred, colored; branchpoint 1.15: preferred, colored
Changes since revision 1.15.6.1: +5 -24 lines
resync with head

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed Feb 13 14:03:48 2013 UTC (12 years, 1 month ago) by hannken
Branches: MAIN
CVS tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +4 -23 lines
Make the spec_node table implementation private to spec_vnops.c.

To retrieve a spec_node, two new lookup functions (by device or by mount)
are implemented.  Both return a referenced vnode, for an opened block device
the opened vnode is returned so further diagnostic checks "vp == ... sd_bdevvp"
will not fire.  Otherwise any vnode matching the criteria gets returned.

No objections on tech-kern.

Welcome to 6.99.17

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sat Feb 9 00:31:21 2013 UTC (12 years, 1 month ago) by christos
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +3 -3 lines
printflike maintenance.

Revision 1.14.2.4: download - view: text, markup, annotated - select for diffs
Wed Jan 16 05:33:45 2013 UTC (12 years, 2 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.14.2.3: preferred, colored; branchpoint 1.14: preferred, colored
Changes since revision 1.14.2.3: +38 -4 lines
sync with (a bit old) head

Revision 1.15.8.1: download - view: text, markup, annotated - select for diffs
Thu Nov 22 18:51:14 2012 UTC (12 years, 4 months ago) by riz
Branches: netbsd-6-0
CVS tags: netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE
Diff to: previous 1.15: preferred, colored; next MAIN 1.16: preferred, colored
Changes since revision 1.15: +38 -4 lines
Pull up following revision(s) (requested by hannken in ticket #692):
	sys/kern/vfs_vnode.c: revision 1.17
	sys/kern/vfs_vnops.c: revision 1.186
Bring back Manuel Bouyers patch to resolve races between vget() and vrelel()
resulting in vget() returning dead vnodes.
It is impossible to resolve these races in vn_lock().
Needs pullup to NetBSD-6.

Revision 1.15.2.1: download - view: text, markup, annotated - select for diffs
Thu Nov 22 18:50:23 2012 UTC (12 years, 4 months ago) by riz
Branches: netbsd-6
CVS tags: netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1
Diff to: previous 1.15: preferred, colored; next MAIN 1.16: preferred, colored
Changes since revision 1.15: +38 -4 lines
Pull up following revision(s) (requested by hannken in ticket #692):
	sys/kern/vfs_vnode.c: revision 1.17
	sys/kern/vfs_vnops.c: revision 1.186
Bring back Manuel Bouyers patch to resolve races between vget() and vrelel()
resulting in vget() returning dead vnodes.
It is impossible to resolve these races in vn_lock().
Needs pullup to NetBSD-6.

Revision 1.15.6.1: download - view: text, markup, annotated - select for diffs
Tue Nov 20 03:02:45 2012 UTC (12 years, 4 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +52 -9 lines
Resync to 2012-11-19 00:00:00 UTC

Revision 1.17: download - view: text, markup, annotated - select for diffs
Mon Nov 12 11:00:07 2012 UTC (12 years, 4 months ago) by hannken
Branches: MAIN
CVS tags: yamt-pagecache-base8, yamt-pagecache-base7
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +38 -4 lines
Bring back Manuel Bouyers patch to resolve races between vget() and vrelel()
resulting in vget() returning dead vnodes.
It is impossible to resolve these races in vn_lock().

Needs pullup to NetBSD-6.

Revision 1.14.2.3: download - view: text, markup, annotated - select for diffs
Tue Oct 30 17:22:39 2012 UTC (12 years, 4 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.14.2.2: preferred, colored; branchpoint 1.14: preferred, colored
Changes since revision 1.14.2.2: +16 -7 lines
sync with head

Revision 1.16: download - view: text, markup, annotated - select for diffs
Fri Oct 12 21:10:55 2012 UTC (12 years, 5 months ago) by rmind
Branches: MAIN
CVS tags: yamt-pagecache-base6
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +16 -7 lines
Update comment on vnode life-cycle a little.

Revision 1.14.2.2: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:08:32 2012 UTC (12 years, 11 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.14.2.1: preferred, colored; branchpoint 1.14: preferred, colored
Changes since revision 1.14.2.1: +7 -7 lines
sync with head

Revision 1.14.6.1: download - view: text, markup, annotated - select for diffs
Sat Feb 18 07:35:35 2012 UTC (13 years, 1 month ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14: +9 -9 lines
merge to -current.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Tue Dec 20 16:49:37 2011 UTC (13 years, 3 months ago) by hannken
Branches: MAIN
CVS tags: yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10
Branch point for: tls-maxphys, netbsd-6-0, netbsd-6
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +9 -9 lines
Move the diagnostic check for a missing VOP_CLOSE() to the top of vrelel().
As long as we hold the vnode interlock there is no chance for this vnode
to gain new references.

Fixes false alarms observed by Thor Lancelot Simon and reported on tech-kern.

Ok: David Holland <dholland@netbsd.org>

Revision 1.14.2.1: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:32:19 2011 UTC (13 years, 4 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +4 -4 lines
remove uobj->memq

Revision 1.14: download - view: text, markup, annotated - select for diffs
Fri Oct 7 09:35:06 2011 UTC (13 years, 5 months ago) by hannken
Branches: MAIN
CVS tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +4 -16 lines
As vnalloc() always allocates with PR_WAITOK there is no longer the need
to test its result for NULL.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon Oct 3 10:30:13 2011 UTC (13 years, 5 months ago) by hannken
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +5 -7 lines
As getnewvnode() is prepared to wait for an allocation change vnalloc()
to always use PR_WAITOK.

No more 'WARNING: unable to allocate new vnode, retrying...' messages.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sun Oct 2 13:00:06 2011 UTC (13 years, 5 months ago) by hannken
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +74 -97 lines
The path getnewvnode()->getcleanvnode()->vclean()->VOP_LOCK() will panic
if the vnode we want to clean is a layered vnode and the caller already
locked its lower vnode.

Change getnewvnode() to always allocate a fresh vnode and add a helper
thread (vdrain) to keep the number of allocated vnodes within desiredvnodes.

Rename getcleanvnode() to cleanvnode() and let it take a vnode from the
lists, clean and free it.

Reviewed by: David Holland <dholland@netbsd.org>

Should fix:
PR #19110 (nullfs mounts over NFS cause lock manager problems)
PR #34102 (ffs panic in NetBSD 3.0_STABLE)
PR #45115 (lock error panic when build.sh*3 and daily script is running)
PR #45355 (Reader/writer lock error:  rw_vector_enter: locking against myself)

Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Sep 29 20:51:38 2011 UTC (13 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +17 -12 lines
rename vpanic() to vnpanic() and make it varyadic. While there, fix the
broken formats, always call panic() from vnpanic() and make all the calls
use vnpanic(). We only call vprint() on DIAGNOSTIC now.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Sep 1 09:04:08 2011 UTC (13 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +3 -3 lines
Check for v_type before v_rdev because it is cheaper and safer.

Revision 1.8.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 23 14:20:22 2011 UTC (13 years, 9 months ago) by cherry
Branches: cherry-xenmp
Diff to: previous 1.8: preferred, colored; next MAIN 1.9: preferred, colored
Changes since revision 1.8: +69 -43 lines
Catchup with rmind-uvmplock merge.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sun Jun 12 03:35:57 2011 UTC (13 years, 9 months ago) by rmind
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +69 -43 lines
Welcome to 5.99.53!  Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.

Revision 1.8.4.2: download - view: text, markup, annotated - select for diffs
Mon Jun 6 09:09:41 2011 UTC (13 years, 9 months ago) by jruoho
Branches: jruoho-x86intr
Diff to: previous 1.8.4.1: preferred, colored; branchpoint 1.8: preferred, colored; next MAIN 1.9: preferred, colored
Changes since revision 1.8.4.1: +1201 -0 lines
Sync with HEAD.

Revision 1.5.2.6: download - view: text, markup, annotated - select for diffs
Tue May 31 03:05:04 2011 UTC (13 years, 9 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.5.2.5: preferred, colored; next MAIN 1.6: preferred, colored
Changes since revision 1.5.2.5: +67 -33 lines
sync with head

Revision 1.5.2.5: download - view: text, markup, annotated - select for diffs
Mon May 30 14:57:48 2011 UTC (13 years, 9 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.5.2.4: preferred, colored
Changes since revision 1.5.2.4: +9 -9 lines
- Amend getnewvnode(9) to take the lock for sharing, not a vnode.
- Update tmpfs to perform vnode and UVM object lock sharing correctly.

Revision 1.5.2.4: download - view: text, markup, annotated - select for diffs
Sun May 22 04:29:04 2011 UTC (13 years, 10 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.5.2.3: preferred, colored
Changes since revision 1.5.2.3: +3 -2 lines
Fix vnode interlock sharing.

Revision 1.5.2.3: download - view: text, markup, annotated - select for diffs
Thu May 19 03:43:03 2011 UTC (13 years, 10 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.5.2.2: preferred, colored
Changes since revision 1.5.2.2: +30 -5 lines
Implement sharing of vnode_t::v_interlock amongst vnodes:
- Lock is shared amongst UVM objects using uvm_obj_setlock() or getnewvnode().
- Adjust vnode cache to handle unsharing, add VI_LOCKSHARE flag for that.
- Use sharing in tmpfs and layerfs for underlying object.
- Simplify locking in ubc_fault().
- Sprinkle some asserts.

Discussed with ad@.

Revision 1.8.4.1
Thu May 19 03:26:06 2011 UTC (13 years, 10 months ago) by jruoho
Branches: jruoho-x86intr
FILE REMOVED
Changes since revision 1.8: +0 -1201 lines
file vfs_vnode.c was added on branch jruoho-x86intr on 2011-06-06 09:09:41 +0000

Revision 1.8: download - view: text, markup, annotated - select for diffs
Thu May 19 03:26:06 2011 UTC (13 years, 10 months ago) by rmind
Branches: MAIN
CVS tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base
Branch point for: jruoho-x86intr, cherry-xenmp
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +51 -21 lines
Add some general description of vnode life-cycle.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Thu May 19 03:11:55 2011 UTC (13 years, 10 months ago) by rmind
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +6 -2 lines
Remove cache_purge(9) calls from reclamation routines in the file systems,
as vclean(9) performs it for us since Lite2 merge.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Fri May 13 22:16:44 2011 UTC (13 years, 10 months ago) by rmind
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +14 -14 lines
Sprinkle __cacheline_aligned and __read_mostly.

Revision 1.5.2.2: download - view: text, markup, annotated - select for diffs
Thu Apr 21 01:42:12 2011 UTC (13 years, 11 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.5.2.1: preferred, colored
Changes since revision 1.5.2.1: +1167 -0 lines
sync with head

Revision 1.5.2.1
Mon Apr 4 02:46:57 2011 UTC (13 years, 11 months ago) by rmind
Branches: rmind-uvmplock
FILE REMOVED
Changes since revision 1.5: +0 -1167 lines
file vfs_vnode.c was added on branch rmind-uvmplock on 2011-04-21 01:42:12 +0000

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Apr 4 02:46:57 2011 UTC (13 years, 11 months ago) by rmind
Branches: MAIN
Branch point for: rmind-uvmplock
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +24 -29 lines
getcleanvnode: make static, add few comments, convert checks to asserts.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Apr 2 07:33:49 2011 UTC (13 years, 11 months ago) by rmind
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +21 -20 lines
KNF, slightly improve few comments.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Apr 2 05:07:57 2011 UTC (13 years, 11 months ago) by rmind
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +6 -5 lines
vfs_drainvnodes: drop lwp argument, remove variable name in prototype.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sat Apr 2 04:45:24 2011 UTC (13 years, 11 months ago) by rmind
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +21 -7 lines
- Move vrele_list flush notify code into vrele_flush() routine.
- Make some structures static.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat Apr 2 04:28:57 2011 UTC (13 years, 11 months ago) by rmind
Branches: MAIN
Split off parts of vfs_subr.c into vfs_vnode.c and vfs_mount.c modules.

No functional change.  Discussed on tech-kern@.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>