]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
20 years agoMark td_generation as volatile.
Bruce M Simpson [Sun, 5 Oct 2003 11:15:18 +0000 (11:15 +0000)]
Mark td_generation as volatile.

20 years agoRetire vslock() and vsunlock() with extreme prejudice.
Bruce M Simpson [Sun, 5 Oct 2003 09:47:54 +0000 (09:47 +0000)]
Retire vslock() and vsunlock() with extreme prejudice.

Discussed with: pete

20 years ago - Further simplify ffs_sync(). The vnode lock is required for UFS_UPDATE()
Jeff Roberson [Sun, 5 Oct 2003 09:42:24 +0000 (09:42 +0000)]
 - Further simplify ffs_sync().  The vnode lock is required for UFS_UPDATE()
   so make the code slightly more uniform.  The vnode lock is acquired in
   all cases and now the only difference between VCHR and other is we
   call UFS_UPDATE instead of VOP_FSYNC().

20 years ago - In ffs_update() assert that either the vnode lock or the XLOCK is held.
Jeff Roberson [Sun, 5 Oct 2003 09:39:02 +0000 (09:39 +0000)]
 - In ffs_update() assert that either the vnode lock or the XLOCK is held.

20 years agoFix a security problem in sysctl() the long way round.
Bruce M Simpson [Sun, 5 Oct 2003 09:37:47 +0000 (09:37 +0000)]
Fix a security problem in sysctl() the long way round.

Use pre-emption detection to avoid the need for wiring a userland buffer
when copying opaque data structures.

sysctl_wire_old_buffer() is now a no-op. Other consumers of this
API should use pre-emption detection to notice update collisions.

vslock() and vsunlock() should no longer be called by any code
and should be retired in subsequent commits.

Discussed with: pete, phk
MFC after: 1 week

20 years agoAdd a pre-emption counter, td_generation, so that threads can notice
Bruce M Simpson [Sun, 5 Oct 2003 09:35:08 +0000 (09:35 +0000)]
Add a pre-emption counter, td_generation, so that threads can notice
when they have been pre-empted by other threads. This is bumped from
within mi_switch() every time a context switch takes place.

Discussed with: pete

20 years agoAdd a sentence forgotten in the previous commit.
Hiroki Sato [Sun, 5 Oct 2003 09:17:25 +0000 (09:17 +0000)]
Add a sentence forgotten in the previous commit.

20 years agoMFi386: revisions 1.572, 1.573 and 1.574.
Yoshihiro Takahashi [Sun, 5 Oct 2003 09:05:45 +0000 (09:05 +0000)]
MFi386: revisions 1.572, 1.573 and 1.574.

20 years agoMFi386: revision 1.205
Yoshihiro Takahashi [Sun, 5 Oct 2003 08:56:49 +0000 (08:56 +0000)]
MFi386: revision 1.205

20 years agoFold the vslock() and vsunlock() calls in this file with #if 0's; they will
Bruce M Simpson [Sun, 5 Oct 2003 08:38:22 +0000 (08:38 +0000)]
Fold the vslock() and vsunlock() calls in this file with #if 0's; they will
go away in due course. Involuntary pre-emption means that we can't count
on wiring of pages alone for consistency when performing a SYSCTL_OUT()
bigger than PAGE_SIZE.

Discussed with: pete, phk

20 years agoNew release note: SA-03:18.
Hiroki Sato [Sun, 5 Oct 2003 08:17:53 +0000 (08:17 +0000)]
New release note: SA-03:18.

20 years agoNew errata: SA-03:14, SA-03:17, SA-03:18.
Hiroki Sato [Sun, 5 Oct 2003 08:15:54 +0000 (08:15 +0000)]
New errata:  SA-03:14, SA-03:17, SA-03:18.

20 years agoInclude <sys/mutex.h>. Don't depend on namespace pollution in <sys/vnode.h>.
Bruce Evans [Sun, 5 Oct 2003 07:44:45 +0000 (07:44 +0000)]
Include <sys/mutex.h>.  Don't depend on namespace pollution in <sys/vnode.h>.

Fixed a nearby style bug.  The include of vcoda.h used angle brackets and
was not used.

20 years ago - Check the XLOCK before inspecting v_data.
Jeff Roberson [Sun, 5 Oct 2003 07:16:45 +0000 (07:16 +0000)]
 - Check the XLOCK before inspecting v_data.
 - Slightly rewrite the fsync loop to be more lock friendly.  We must
   acquire the vnode interlock before dropping the mnt lock.  We must
   also check XLOCK to prevent vclean() races.
 - Use LK_INTERLOCK in the vget() in ffs_sync to further prevent vclean()
   races.
 - Use a local variable to store the results of the nvp == TAILQ_NEXT
   test so that we do not access the vp after we've vrele()d it.
 - Add an XXX comment about UFS_UPDATE() not being protected by any lock
   here.  I suspect that it should need the VOP lock.

20 years ago - Apply a big giant lock around the namecache. This has been sitting in
Jeff Roberson [Sun, 5 Oct 2003 07:13:50 +0000 (07:13 +0000)]
 - Apply a big giant lock around the namecache.  This has been sitting in
   my tree since BSDcon.

20 years ago - Fix an XXX. Check the error of vn_lock() in vflush(). Don't specify
Jeff Roberson [Sun, 5 Oct 2003 07:12:38 +0000 (07:12 +0000)]
 - Fix an XXX.  Check the error of vn_lock() in vflush().  Don't specify
   LK_RETRY either, we don't want this vnode if it turns into another.
 - Remove the code that checks the mount point after acquiring the lock
   we are guaranteed to either fail or get the vnode that we wanted.

20 years agoAssert that the containing vm object's lock is held in
Alan Cox [Sun, 5 Oct 2003 06:58:07 +0000 (06:58 +0000)]
Assert that the containing vm object's lock is held in
vm_page_set_invalid().

20 years ago - Skip over xvp if XLOCK is set.
Jeff Roberson [Sun, 5 Oct 2003 06:48:37 +0000 (06:48 +0000)]
 - Skip over xvp if XLOCK is set.

20 years ago - Remove an incorrect XXX comment. This code does respect the XLOCK since
Jeff Roberson [Sun, 5 Oct 2003 06:47:56 +0000 (06:47 +0000)]
 - Remove an incorrect XXX comment.  This code does respect the XLOCK since
   it uses vget() which will fail if the identity changes.

20 years ago - Check the XLOCK before we inspect the vnode.
Jeff Roberson [Sun, 5 Oct 2003 06:46:45 +0000 (06:46 +0000)]
 - Check the XLOCK before we inspect the vnode.

20 years ago - We don't need to cache_purge() in nfs_reclaim(), vclean() does it for us.
Jeff Roberson [Sun, 5 Oct 2003 06:46:02 +0000 (06:46 +0000)]
 - We don't need to cache_purge() in nfs_reclaim(), vclean() does it for us.

20 years ago - Check the XLOCK prior to inspecting v_data.
Jeff Roberson [Sun, 5 Oct 2003 06:44:53 +0000 (06:44 +0000)]
 - Check the XLOCK prior to inspecting v_data.

20 years ago - Check XLOCK prior to accessing v_data.
Jeff Roberson [Sun, 5 Oct 2003 06:43:30 +0000 (06:43 +0000)]
 - Check XLOCK prior to accessing v_data.

20 years ago - File systems that wish to inspect the vnode contents or their private
Jeff Roberson [Sun, 5 Oct 2003 06:43:03 +0000 (06:43 +0000)]
 - File systems that wish to inspect the vnode contents or their private
   v_data field before calling vget/vn_lock must check VI_XLOCK manually to
   be sure that v_data is still valid.  Implement this check in two places
   here.

20 years agoCorrect a typo on line 552 of revision 1.92 which was breaking GENERIC:-
Bruce M Simpson [Sun, 5 Oct 2003 06:06:09 +0000 (06:06 +0000)]
Correct a typo on line 552 of revision 1.92 which was breaking GENERIC:-
_FreeBSD_version should be __FreeBSD_version.

20 years agoRemove magic numbers surrounding locking state in the sysctl module, and
Bruce M Simpson [Sun, 5 Oct 2003 05:38:30 +0000 (05:38 +0000)]
Remove magic numbers surrounding locking state in the sysctl module, and
replace them with more meaningful defines.

20 years ago - Rename vcanrecycle() to vtryrecycle() to reflect its new role.
Jeff Roberson [Sun, 5 Oct 2003 05:35:41 +0000 (05:35 +0000)]
 - Rename vcanrecycle() to vtryrecycle() to reflect its new role.
 - In vtryrecycle() try to vgonel the vnode if all of the previous checks
   passed.  We won't vgonel if someone has either acquired a hold or usecount
   or started the vgone process elsewhere.  This is because we may have been
   removed from the free list while we were inspecting the vnode for
   recycling.
 - The VI_TRYLOCK stops two threads from entering getnewvnode() and recycling
   the same vnode.  To further reduce the likelyhood of this event, requeue
   the vnode on the tail of the list prior to calling vtryrecycle().  We can
   not actually remove the vnode from the list until we know that it's
   going to be recycled because other interlock holders may see the VI_FREE
   flag and try to remove it from the free list.
 - Kill a bogus XXX comment.  If XLOCK is set we shouldn't wait for it
   regardless of MNT_WAIT because the vnode does not actually belong to
   this filesystem.

20 years ago - Don't cache_purge() in getnewvnode. It's done in vclean(). With this
Jeff Roberson [Sun, 5 Oct 2003 02:48:04 +0000 (02:48 +0000)]
 - Don't cache_purge() in getnewvnode.  It's done in vclean().  With this
   purge, the purge in vclean, and the filesystems purge, we had 3 purges
   per vnode.
 - Move the insmntque(vp, 0) to vclean() so that we may remove it from the
   two vgone() functions and reduce the number of lock operations required.

20 years ago - Don't cache_purge() in cd9660_reclaim. vclean() does it for us so
Jeff Roberson [Sun, 5 Oct 2003 02:45:36 +0000 (02:45 +0000)]
 - Don't cache_purge() in cd9660_reclaim.  vclean() does it for us so
   this is redundant.

20 years ago - Don't cache_purge() in ufs_reclaim. vclean() does it for us so
Jeff Roberson [Sun, 5 Oct 2003 02:45:00 +0000 (02:45 +0000)]
 - Don't cache_purge() in ufs_reclaim.  vclean() does it for us so
   this is redundant.

20 years ago - Don't cache_purge() in ext2_reclaim. vclean() does it for us so
Jeff Roberson [Sun, 5 Oct 2003 02:44:22 +0000 (02:44 +0000)]
 - Don't cache_purge() in ext2_reclaim.  vclean() does it for us so
   this is redundant.

20 years ago - Don't cache_purge() in *_reclaim routines. vclean() does it for us so
Jeff Roberson [Sun, 5 Oct 2003 02:43:30 +0000 (02:43 +0000)]
 - Don't cache_purge() in *_reclaim routines.  vclean() does it for us so
   this is redundant.

20 years agoUpdate the page_req classes VM_ALLOC_NOOBJ and VM_ALLOC_ZERO.
Bruce M Simpson [Sun, 5 Oct 2003 01:31:51 +0000 (01:31 +0000)]
Update the page_req classes VM_ALLOC_NOOBJ and VM_ALLOC_ZERO.

Suggested by: alc

20 years ago - Solve a LOR with the sync_mtx by using the VI_ONWORKLST flag to determine
Jeff Roberson [Sun, 5 Oct 2003 00:35:41 +0000 (00:35 +0000)]
 - Solve a LOR with the sync_mtx by using the VI_ONWORKLST flag to determine
   whether or not the sync failed.  This could potentially get set between
   the time that we VOP_UNLOCK and VI_LOCK() but the race would harmelssly
   lead to the sync being delayed by an extra 30 seconds.  If we do not move
   the vnode it could cause an endless loop if it continues to fail to sync.
 - Use vhold and vdrop to stop the vnode from changing identities while we
   have it unlocked.  Other internal vfs lists are likely to follow this
   scheme.

20 years agoDon't bother setting a page table page's valid field. It is unused and
Alan Cox [Sun, 5 Oct 2003 00:12:16 +0000 (00:12 +0000)]
Don't bother setting a page table page's valid field.  It is unused and
not setting it is consistent with other uses of VM_ALLOC_NOOBJ pages.

20 years ago - Move the xlock 'locking' code into vx_lock() and vx_unlock().
Jeff Roberson [Sun, 5 Oct 2003 00:02:41 +0000 (00:02 +0000)]
 - Move the xlock 'locking' code into vx_lock() and vx_unlock().
 - Create a new function, vgonechrl(), which performs vgone for an in-use
   character device.  Move the code from vflush() that did this into
   vgonechrl().
 - Hold the xlock across the entirety of vgonel() and vgonechrl() so that
   at no point will an invalid vnode exist on any list without XLOCK set.
 - Move the xlock code out of vclean() now that it is in the vgone*()
   functions.

20 years agoSynchronize access to a vm page's valid field using the containing
Alan Cox [Sat, 4 Oct 2003 23:37:38 +0000 (23:37 +0000)]
Synchronize access to a vm page's valid field using the containing
vm object's lock.

20 years agoEliminate some unnecessary uses of the vm page queues lock around the
Alan Cox [Sat, 4 Oct 2003 22:47:20 +0000 (22:47 +0000)]
Eliminate some unnecessary uses of the vm page queues lock around the
vm page's valid field.  This field is being synchronized using the
containing vm object's lock.

20 years agoMake it easier to run this code on RELENG_4.
Josef Karthauser [Sat, 4 Oct 2003 22:13:21 +0000 (22:13 +0000)]
Make it easier to run this code on RELENG_4.

Submitted by: luoqi

20 years agoFix the apm problem for real. We leave the first 4K page for the bios to
Peter Wemm [Sat, 4 Oct 2003 22:04:54 +0000 (22:04 +0000)]
Fix the apm problem for real.  We leave the first 4K page for the bios to
work in, but we had it mapped read-only.  While this has always been the
case, the PG_PS enable hack hid it and the apm bios code ended up taking
advantage of it.

20 years agoAssert that the containing vm object's lock is held in
Alan Cox [Sat, 4 Oct 2003 21:56:27 +0000 (21:56 +0000)]
Assert that the containing vm object's lock is held in
vm_page_zero_invalid().

20 years agoMake it easier to run this code on RELENG_4.
Josef Karthauser [Sat, 4 Oct 2003 21:41:01 +0000 (21:41 +0000)]
Make it easier to run this code on RELENG_4.

Submitted by: luoqi

20 years agoSynchronize access to a vm page's valid field using the containing
Alan Cox [Sat, 4 Oct 2003 21:35:48 +0000 (21:35 +0000)]
Synchronize access to a vm page's valid field using the containing
vm object's lock.

20 years agoSynchronize access to a vm page's valid field using the containing
Alan Cox [Sat, 4 Oct 2003 20:38:32 +0000 (20:38 +0000)]
Synchronize access to a vm page's valid field using the containing
vm object's lock.

20 years ago - Extend the scope the vm object lock to cover calls to
Alan Cox [Sat, 4 Oct 2003 19:23:29 +0000 (19:23 +0000)]
 - Extend the scope the vm object lock to cover calls to
   vm_page_is_valid().
 - Assert that the lock on the containing vm object is held in
   vm_page_is_valid().

20 years agoSynchronize access to a vm page's valid field using the containing
Alan Cox [Sat, 4 Oct 2003 19:13:27 +0000 (19:13 +0000)]
Synchronize access to a vm page's valid field using the containing
vm object's lock.

20 years agoRetired the "most" and "installmost" targets -- they just
Ruslan Ermilov [Sat, 4 Oct 2003 18:53:38 +0000 (18:53 +0000)]
Retired the "most" and "installmost" targets -- they just
do not have a chance to work nowadays as we have a lot of
internal libraries in lib/.

Discussed with: marcel, wollman

20 years agoany -> ? for new entry (to allow time for people to upgrade their pccardd)
Warner Losh [Sat, 4 Oct 2003 18:44:29 +0000 (18:44 +0000)]
any -> ? for new entry (to allow time for people to upgrade their pccardd)

20 years agoOoops. Committed sin number 1: updating the code w/o updating the comments.
Warner Losh [Sat, 4 Oct 2003 18:43:21 +0000 (18:43 +0000)]
Ooops.  Committed sin number 1: updating the code w/o updating the comments.
Update the comments too.

20 years agoI've been burned about half a dozen times by the old PAO syntax for
Warner Losh [Sat, 4 Oct 2003 18:40:36 +0000 (18:40 +0000)]
I've been burned about half a dozen times by the old PAO syntax for
'any' interrupt.  There's no reason not to be liberal here and accept
the PAO syntax.

MFC After: 2 weeks

20 years ago - In sched_sync() test our preconditions prior to dropping the sync_mtx.
Jeff Roberson [Sat, 4 Oct 2003 18:03:53 +0000 (18:03 +0000)]
 - In sched_sync() test our preconditions prior to dropping the sync_mtx.
   This is so that we may grab the interlock while still holding the
   sync_mtx.  We have to VI_TRYLOCK() because in all other cases the lock
   order runs the other way.
 - If we don't meet any of the preconditions, reinsert the vp into the
   list for the next second.
 - We don't need to panic if we fail to sync here because each FSYNC
   function handles this case.  Removing this redundant code also
   simplifies locking.

20 years ago - Consistently set sopt_dir.
Jeff Roberson [Sat, 4 Oct 2003 17:41:59 +0000 (17:41 +0000)]
 - Consistently set sopt_dir.

Pointed out by: pete@isilon.com

20 years ago - Change a lame iterative algorithm to a constant time algorithm. Remove
Jeff Roberson [Sat, 4 Oct 2003 17:41:13 +0000 (17:41 +0000)]
 - Change a lame iterative algorithm to a constant time algorithm.  Remove
   the XXX that complains about it as well.

Submitted by: ThomasWuerfl@gmx.de

20 years ago - Set the sopt_dir member of the sockopt structure, otherwise, this parameter
Jeff Roberson [Sat, 4 Oct 2003 17:37:51 +0000 (17:37 +0000)]
 - Set the sopt_dir member of the sockopt structure, otherwise, this parameter
   will not actually be set even though we're calling sosetopt.  sosetopt
   calls down to a single ctloutput function if the name or level is
   implemented by a specific protocol.

Submitted by: pete@isilon.com

20 years ago - Don't use vrecycle() call vgonel() directly after grabing the vnode
Jeff Roberson [Sat, 4 Oct 2003 16:09:40 +0000 (16:09 +0000)]
 - Don't use vrecycle() call vgonel() directly after grabing the vnode
   interlock.  We do this so that we still hold the interlock when we lock
   the vnode later.  This prevents races with the mnt vnode list.

20 years ago - The VI assert in getdirtybuf() is only valid if we're not on a VCHR
Jeff Roberson [Sat, 4 Oct 2003 15:57:05 +0000 (15:57 +0000)]
 - The VI assert in getdirtybuf() is only valid if we're not on a VCHR
   vnode.  VCHR vnodes don't do background writes.

Reported by: kan

20 years agomissing word
Christian Weisgerber [Sat, 4 Oct 2003 15:43:22 +0000 (15:43 +0000)]
missing word

20 years agoAssorted minor fixes, mostly style(9):
Yaroslav Tykhiy [Sat, 4 Oct 2003 15:17:08 +0000 (15:17 +0000)]
Assorted minor fixes, mostly style(9):
- PID should be pid_t, not int;
- sort #include's and local variables;
- don't overuse initializers;
- use warn(3) instead of perror(3) consistently;
- amplify the comment on signals.

20 years ago - In a Giantless world, the vn_lock() in vcanrecycle() could legitimately
Jeff Roberson [Sat, 4 Oct 2003 15:10:40 +0000 (15:10 +0000)]
 - In a Giantless world, the vn_lock() in vcanrecycle() could legitimately
   fail.  Remove the panic from that case and document why it might fail.
 - Document the reason for calling cache_purge() on a newly created vnode.
 - In insmntque() order the operations so that we can call mtx_unlock()
   one fewer times.  This makes the code somewhat clearer as well.
 - Add XXX comments in sched_sync() and vflush().
 - In vget(), do not sleep while waiting for XLOCK to clear if LK_NOWAIT is
   set.
 - In vclean() we don't need to acquire a lock around a single TAILQ_FIRST
   call.  It's ok if we race here, the vinvalbuf will just do nothing.
 - Increase the scope of the lock in vgonel() to reduce the number of lock
   operations that are performed.

20 years agoreference ntpd(8)
Christian Weisgerber [Sat, 4 Oct 2003 15:07:27 +0000 (15:07 +0000)]
reference ntpd(8)

20 years agoDon't dump core from the time(1) process itself
Yaroslav Tykhiy [Sat, 4 Oct 2003 14:42:03 +0000 (14:42 +0000)]
Don't dump core from the time(1) process itself
if the child process has exited on a signal
whose default action is to dump core.

20 years ago - If we are called with LK_NOWAIT in vn_lock() we may be holding a mutex
Jeff Roberson [Sat, 4 Oct 2003 14:35:22 +0000 (14:35 +0000)]
 - If we are called with LK_NOWAIT in vn_lock() we may be holding a mutex
   and should not sleep while waiting for XLOCK to clear.  Care needs to be
   taken in functions that use this capability to avoid spinning.

20 years ago - Document more of the vnode locking strategy.
Jeff Roberson [Sat, 4 Oct 2003 14:32:55 +0000 (14:32 +0000)]
 - Document more of the vnode locking strategy.

20 years ago - Increase the scope of the interlock in ffs_reload(). Acquire it before
Jeff Roberson [Sat, 4 Oct 2003 14:27:49 +0000 (14:27 +0000)]
 - Increase the scope of the interlock in ffs_reload().  Acquire it before
   we release the mntvnode_mtx.
 - Call vgonel() directly instead of going through vrecycle() since we own
   the interlock now.
 - Remove a few cases where we locked the interlock just so that we could
   call VOP_UNLOCK with interlock held.

20 years ago - Fix an unlocked call to GETATTR by slightly shuffling the code in
Jeff Roberson [Sat, 4 Oct 2003 14:25:45 +0000 (14:25 +0000)]
 - Fix an unlocked call to GETATTR by slightly shuffling the code in
   ffs_snapshot() around.
 - Acquire the interlock before releasing the mntvnode_mtx.  Use the
   interlock to protect v_usecount access.

20 years ago - Use the UMA_ZONE_VM flag on the fakepg and object zones to prevent
Jeff Roberson [Sat, 4 Oct 2003 14:21:53 +0000 (14:21 +0000)]
 - Use the UMA_ZONE_VM flag on the fakepg and object zones to prevent
   vm recursion and LORs.  This may be necessary for other zones created in
   the vm but this needs to be verified.

20 years ago - Use the VI_LOCK macro in two places where we directly called mtx_lock()
Jeff Roberson [Sat, 4 Oct 2003 14:03:28 +0000 (14:03 +0000)]
 - Use the VI_LOCK macro in two places where we directly called mtx_lock()
   before.  Direct calls indicated places that needed review and these have
   now been reviewed.

20 years ago - Properly acquire the vnode interlock before releasing the
Jeff Roberson [Sat, 4 Oct 2003 14:02:32 +0000 (14:02 +0000)]
 - Properly acquire the vnode interlock before releasing the
   mntvnode_mtx.
 - Use a local variable to store the results of the test to see if the
   next vnode on the mount list has changed.  This is so that we no longer
   acess the vnode after we vput() it.

20 years ago - Acquire the vnode interlock prior to dropping the mntvnode_mtx.
Jeff Roberson [Sat, 4 Oct 2003 13:44:51 +0000 (13:44 +0000)]
 - Acquire the vnode interlock prior to dropping the mntvnode_mtx.
 - Make a note of the lack of XLOCK protection in this code.  We would access
   a vnode while it is changing identities without Giant.

20 years ago - Make proper use of the mntvnode_mtx. We do not need the loop label
Jeff Roberson [Sat, 4 Oct 2003 13:16:54 +0000 (13:16 +0000)]
 - Make proper use of the mntvnode_mtx.  We do not need the loop label
   because we do not drop the mntvnode_mtx.  If this code had ever executed
   and hit the loop condition it would have spun forever.

20 years ago - The proper test is CPU_ENABLE_SSE and not CPU_ENABLED_SSE. This
Jeff Roberson [Sat, 4 Oct 2003 13:07:53 +0000 (13:07 +0000)]
 - The proper test is CPU_ENABLE_SSE and not CPU_ENABLED_SSE.  This
   effectively disabled the sse2_pagezero() code.

Spotted by: bde

20 years ago - Acquire the vnode interlock prior to droping the mntvnode_mtx. This does
Jeff Roberson [Sat, 4 Oct 2003 12:52:37 +0000 (12:52 +0000)]
 - Acquire the vnode interlock prior to droping the mntvnode_mtx.  This does
   not eliminate races where the vnode could be reclaimed and end up with
   a NULL v_data pointer but Giant is protecting us from that at the moment.

20 years ago - Remove a mp_fixme() and some locks that weren't necessary. I now
Jeff Roberson [Sat, 4 Oct 2003 11:06:43 +0000 (11:06 +0000)]
 - Remove a mp_fixme() and some locks that weren't necessary.  I now
   understand how this works.

20 years agoSynchronize access to a page's valid field by using the lock from its
Alan Cox [Sat, 4 Oct 2003 09:20:00 +0000 (09:20 +0000)]
Synchronize access to a page's valid field by using the lock from its
containing object.

20 years ago - Remove the backtrace() call from the *_vinvalbuf() functions. Thanks to a
Jeff Roberson [Sat, 4 Oct 2003 08:51:50 +0000 (08:51 +0000)]
 - Remove the backtrace() call from the *_vinvalbuf() functions.  Thanks to a
   stack trace supplied by phk, I now understand what's going on here.  The
   check for VI_XLOCK stops us from calling vinvalbuf once the vnode has been
   partially torn down in vclean().  It is not clear that this would cause
   a problem.  Document this in nfs_bio.c, which is where the other two
   filesystems copied this code from.

20 years agoCheck for write errors; report and exit with error value.
Diomidis Spinellis [Sat, 4 Oct 2003 07:16:40 +0000 (07:16 +0000)]
Check for write errors; report and exit with error value.

20 years agoEmulate bugs in the old PSE code so that apm works again.
Peter Wemm [Sat, 4 Oct 2003 06:30:56 +0000 (06:30 +0000)]
Emulate bugs in the old PSE code so that apm works again.

I do not yet understand why, but apm *depended* on the fact that the old
PSE code caused the first 1MB of ram to be mapped read/write because it
was in the same 4MB page as the kernel text+data+bss blob.

If anybody ever tried DISABLE_PSE before, apm would not work.

If your cpu did not have PSE, apm would not work there either (eg: 486).

This bug has been around for a Very Long Time.

The Pentium-4-fix commits did not emulate this unintended side effect of
the PSE post-early-boot fixup, and thus apm blew up.  I've added a hack to
emulate the bug until either apm is fixed or we set fire to our bridges.

This is bad though because it gives kernel mode code the opportunity
to accidently write to the first few megs of the general page pool
which is remapped at KERNBASE.  It needs to be fixed properly.

20 years agoLocking for updates to routing table entries. Each rtentry gets a mutex
Sam Leffler [Sat, 4 Oct 2003 03:44:50 +0000 (03:44 +0000)]
Locking for updates to routing table entries.  Each rtentry gets a mutex
that covers updates to the contents.  Note this is separate from holding
a reference and/or locking the routing table itself.

Other/related changes:

o rtredirect loses the final parameter by which an rtentry reference
  may be returned; this was never used and added unwarranted complexity
  for locking.
o minor style cleanups to routing code (e.g. ansi-fy function decls)
o remove the logic to bump the refcnt on the parent of cloned routes,
  we assume the parent will remain as long as the clone; doing this avoids
  a circularity in locking during delete
o convert some timeouts to MPSAFE callouts

Notes:

1. rt_mtx in struct rtentry is guarded by #ifdef _KERNEL as user-level
   applications cannot/do-no know about mutex's.  Doing this requires
   that the mutex be the last element in the structure.  A better solution
   is to introduce an externalized version of struct rtentry but this is
   a major task because of the intertwining of rtentry and other data
   structures that are visible to user applications.
2. There are known LOR's that are expected to go away with forthcoming
   work to eliminate many held references.  If not these will be resolved
   prior to release.
3. ATM changes are untested.

Sponsored by: FreeBSD Foundation
Obtained from: BSD/OS (partly)

20 years agoHandle a 'const' parameter without using __DECONST().
Garance A Drosehn [Sat, 4 Oct 2003 02:24:47 +0000 (02:24 +0000)]
Handle a 'const' parameter without using __DECONST().

MFC after: 14 days

20 years agoadd a stub for bpfattach2 so bpf is not required with the 802.11
Sam Leffler [Sat, 4 Oct 2003 01:32:28 +0000 (01:32 +0000)]
add a stub for bpfattach2 so bpf is not required with the 802.11
module or related drivers

Spotted by: Dan Lukes <dan@obluda.cz>

20 years agoRemove the pmap_prefault(9) page as it is no longer required.
Bruce M Simpson [Sat, 4 Oct 2003 01:32:25 +0000 (01:32 +0000)]
Remove the pmap_prefault(9) page as it is no longer required.

20 years agoUpdate the pmap(9) documentation to reflect the movement of pmap_prefault()
Bruce M Simpson [Sat, 4 Oct 2003 01:30:01 +0000 (01:30 +0000)]
Update the pmap(9) documentation to reflect the movement of pmap_prefault()
to the machine-independent VM layer, as per alc's recent commit.
Add a definition for the new pmap_is_prefaultable() helper function.

20 years agoMigrate pmap_prefault() into the machine-independent virtual memory layer.
Alan Cox [Fri, 3 Oct 2003 22:46:53 +0000 (22:46 +0000)]
Migrate pmap_prefault() into the machine-independent virtual memory layer.

A small helper function pmap_is_prefaultable() is added.  This function
encapsulate the few lines of pmap_prefault() that actually vary from
machine to machine.  Note: pmap_is_prefaultable() and pmap_mincore() have
much in common.  Going forward, it's worth considering their merger.

20 years agohookup ctlinput for fast ipsec versions of esp+ah protocols
Sam Leffler [Fri, 3 Oct 2003 22:06:36 +0000 (22:06 +0000)]
hookup ctlinput for fast ipsec versions of esp+ah protocols

Supported by: FreeBSD Foundation

20 years agoWhile make has been fixed to grok this construct, the new make hasn't
Warner Losh [Fri, 3 Oct 2003 22:00:06 +0000 (22:00 +0000)]
While make has been fixed to grok this construct, the new make hasn't
been widely deploy and that's causing us a lot of pain.  Back out the
last commit for a few weeks so that we can lessen the support load in
current@ asking why they can't build kernels anymore.  Instructions in
UPDATING have been updated, but this should be more effective.

Revert the reverting: November 1st, 2003

20 years agoDefault ntpd to write a "driftfile" in /var/db/ntpd.drift.
Poul-Henning Kamp [Fri, 3 Oct 2003 21:33:40 +0000 (21:33 +0000)]
Default ntpd to write a "driftfile" in /var/db/ntpd.drift.

A "driftfile" caches the oscillator offset estimate from boot to boot,
having this means faster and less bumpy time synchronization.  Will
be overridden by any value in the config file.

20 years agoMake the -q option DTRT in the compat mode.
Ruslan Ermilov [Fri, 3 Oct 2003 21:33:39 +0000 (21:33 +0000)]
Make the -q option DTRT in the compat mode.

PR: 48210

20 years agoremove unused variable
Sam Leffler [Fri, 3 Oct 2003 21:06:17 +0000 (21:06 +0000)]
remove unused variable

Supported by: FreeBSD Foundation

20 years agoremove unneeded include of route.h
Sam Leffler [Fri, 3 Oct 2003 21:05:08 +0000 (21:05 +0000)]
remove unneeded include of route.h

Supported by: FreeBSD Foundation

20 years agoremove include of route.h now that ip_dummynet.h no longer exposes
Sam Leffler [Fri, 3 Oct 2003 21:01:48 +0000 (21:01 +0000)]
remove include of route.h now that ip_dummynet.h no longer exposes
data structures that have an embedded struct route

Sponsored by: FreeBSD Foundation

20 years agoplace some kernel-specific data structures under #ifdef _KERNEL
Sam Leffler [Fri, 3 Oct 2003 20:58:56 +0000 (20:58 +0000)]
place some kernel-specific data structures under #ifdef _KERNEL

Sponsored by: FreeBSD Foundation

20 years agoRemoved the ancient .LIBS setting that causes non-existent
Ruslan Ermilov [Fri, 3 Oct 2003 20:47:37 +0000 (20:47 +0000)]
Removed the ancient .LIBS setting that causes non-existent
libraries to be reported as up-to-date.

Before:

# make -f /dev/null nonexistent.a
`nonexistent.a' is up to date.

After:

# make -f /dev/null nonexistent.a
make: don't know how to make nonexistent.a. Stop

PR: bin/44137 (part of)

20 years agoFix typo.
Poul-Henning Kamp [Fri, 3 Oct 2003 19:57:58 +0000 (19:57 +0000)]
Fix typo.

Spotted by: "Bjoern A. Zeeb" <bzeeb@zabbadoz.net>

20 years agoMake PAGE_SIZE and related quantities signed on sparc64. (They are signed
Alan Cox [Fri, 3 Oct 2003 19:49:08 +0000 (19:49 +0000)]
Make PAGE_SIZE and related quantities signed on sparc64.  (They are signed
quantities on every other architecture.)  This change is required in order
to move pmap_prefault() out of the pmap and into the machine-independent
layer.

20 years agoOnly install .k5login if people have not set NO_KERBEROS.
Poul-Henning Kamp [Fri, 3 Oct 2003 19:38:21 +0000 (19:38 +0000)]
Only install .k5login if people have not set NO_KERBEROS.

20 years agoStyle fixes: shell script indentation, if/then style, plus a lot
Diomidis Spinellis [Fri, 3 Oct 2003 19:31:55 +0000 (19:31 +0000)]
Style fixes: shell script indentation, if/then style, plus a lot
of comments in C code (capitalized, end with full stop).

Submitted by: schweikh

20 years agoCreate a driver that will compile without warnings on -CURRENT
Diomidis Spinellis [Fri, 3 Oct 2003 19:15:07 +0000 (19:15 +0000)]
Create a driver that will compile without warnings on -CURRENT
More changes are probably needed to create a correct driver.

Reviewed by: markm
Approved by: schweikh (mentor)

20 years agoMore checking if kenv actually know something.
Poul-Henning Kamp [Fri, 3 Oct 2003 19:07:31 +0000 (19:07 +0000)]
More checking if kenv actually know something.

Guard against test(1)-unfriendly outputs from kenv.

20 years agoFixed the "To build a kernel" section to mention -DALWAYS_CHECK_MAKE
Ruslan Ermilov [Fri, 3 Oct 2003 18:29:06 +0000 (18:29 +0000)]
Fixed the "To build a kernel" section to mention -DALWAYS_CHECK_MAKE
as the new sys/conf/kmod.mk depends on a make(1) bugfix now.

Reported by: current

20 years agoWhen direct dispatching an netisr (net.isr.enable=1), if there are already
Robert Watson [Fri, 3 Oct 2003 18:27:24 +0000 (18:27 +0000)]
When direct dispatching an netisr (net.isr.enable=1), if there are already
any queued packets for the isr, process those packets before the newly
submitted packet, maintaining ordering of all packets being delivered
to the netisr.  Remove the bypass counter since we don't bypass anymore.
Leave the comment about possible problems and options since later
performance optimization may change the strategy for addressing ordering
problems here.

Specifically, this maintains the strong isr ordering guarantee; additional
parallelism and lower latency may be possible by moving to weaker
guarantees (per-interface, for example).  We will probably at some point
also want to remove the one instance netisr dispatch limit currently
enforced by a mutex, but it's not clear that's 100% safe yet, even in
the netperf branch.

Reviewed by: sam, others