dragonfly.git
15 years agoSync with FreeBSD.
Sascha Wildner [Sun, 22 Jun 2008 20:34:46 +0000 (20:34 +0000)]
Sync with FreeBSD.

15 years agoAdd a pnpbios(4) manpage.
Sascha Wildner [Sun, 22 Jun 2008 20:00:23 +0000 (20:00 +0000)]
Add a pnpbios(4) manpage.

Taken-from: FreeBSD

15 years agos/Fx/Dx/
Sascha Wildner [Sun, 22 Jun 2008 19:33:55 +0000 (19:33 +0000)]
s/Fx/Dx/

15 years agoSort alphabetically.
Sascha Wildner [Sun, 22 Jun 2008 16:14:44 +0000 (16:14 +0000)]
Sort alphabetically.

15 years agoMention aggelos' lwn.net article.
Sascha Wildner [Sun, 22 Jun 2008 11:11:09 +0000 (11:11 +0000)]
Mention aggelos' lwn.net article.

15 years agoHAMMER 56F/Many: Stabilization pass
Matthew Dillon [Sat, 21 Jun 2008 20:21:58 +0000 (20:21 +0000)]
HAMMER 56F/Many: Stabilization pass

* When data is reblocked any related direct-io offsets cached in front-end
  buffer cache buffers must be cleaned out.  This also requires running
  through any snapshotted inodes referencing the same object.

* The flusher must check that the cached B-Tree node has not been flagged
  as deleted (HAMMER_NODE_DELETED) before seeking to it.

* hammer_io_direct_read() now requires and asserts that the second-level
  cached offset in the BIO is a zone-2 offset.

* hammer_io_direct_write() no longer overwrites the second-level cached
  offset with the third level raw disk offset.  It pushes a third level
  to set the raw disk offset.

* When creating a directory entry, set the localization field for pseudo-fs
  support (which isn't quite working yet anyway so no biggy).

* Move the Red-Black tree generator for inodes from hammer_ondisk.c to
  hammer_inode.c.

15 years agoSilence -Wold-style-definition.
Sascha Wildner [Sat, 21 Jun 2008 20:05:04 +0000 (20:05 +0000)]
Silence -Wold-style-definition.

15 years agoSilence -Wold-style-definition.
Sascha Wildner [Sat, 21 Jun 2008 20:01:14 +0000 (20:01 +0000)]
Silence -Wold-style-definition.

15 years agoFix -Wold-style-definition warnings in the scanner skeleton.
Sascha Wildner [Sat, 21 Jun 2008 19:32:14 +0000 (19:32 +0000)]
Fix -Wold-style-definition warnings in the scanner skeleton.

15 years agoAnsify
Sascha Wildner [Sat, 21 Jun 2008 19:29:21 +0000 (19:29 +0000)]
Ansify

15 years agoFix paths.
Sascha Wildner [Sat, 21 Jun 2008 17:15:57 +0000 (17:15 +0000)]
Fix paths.

15 years agoUpdate FILES section.
Sascha Wildner [Sat, 21 Jun 2008 17:08:20 +0000 (17:08 +0000)]
Update FILES section.

15 years agoFix path in comment.
Sascha Wildner [Sat, 21 Jun 2008 16:05:06 +0000 (16:05 +0000)]
Fix path in comment.

15 years agoMore copy{in,out} removal for ctloutput routines
Aggelos Economopoulos [Sat, 21 Jun 2008 12:30:19 +0000 (12:30 +0000)]
More copy{in,out} removal for ctloutput routines

15 years agoSince either hardware or ether input code will strip packet's vlan tag,
Sepherosa Ziehau [Sat, 21 Jun 2008 06:47:29 +0000 (06:47 +0000)]
Since either hardware or ether input code will strip packet's vlan tag,
before the packet could reach ether level ipfw filtering, we will have
to change the packet's ether type to VLAN, if the packet was vlan tagged,
so ipfw could see the correct packet mac-type.

15 years agoUse __func__, instead of hardcode the function name.
Sepherosa Ziehau [Sat, 21 Jun 2008 05:55:46 +0000 (05:55 +0000)]
Use __func__, instead of hardcode the function name.

15 years agoWhite space
Sepherosa Ziehau [Sat, 21 Jun 2008 03:58:09 +0000 (03:58 +0000)]
White space

15 years agoMinor style change
Sepherosa Ziehau [Sat, 21 Jun 2008 03:39:20 +0000 (03:39 +0000)]
Minor style change

15 years agoHAMMER 56E/Many: Correct bug in 56D
Matthew Dillon [Sat, 21 Jun 2008 01:24:12 +0000 (01:24 +0000)]
HAMMER 56E/Many: Correct bug in 56D

* Fix a bug related to fsync that could result in an infinite loop.

15 years agoHAMMER 56D/Many: Media structure finalization, atime/mtime, etc.
Matthew Dillon [Fri, 20 Jun 2008 21:24:53 +0000 (21:24 +0000)]
HAMMER 56D/Many: Media structure finalization, atime/mtime, etc.

* Move the atime and mtime fields to the end of struct hammer_inode_data.
  CRCs on hammer_inode_data no longer include atime or mtime, allowing
  them to be updated without having to update the related B-Tree node.

* Change the time format for ctime, atime, and mtime.  These 64 bit fields
  now store microseconds in real time instead of transaction ids.

* atime is now updated asynchronously, and mtime is now updated with
  UNDO records only.  Split the ITIMES flag into ATIME and MTIME and
  no longer set the DDIRTY (inode_data generally dirty) flag when the
  mtime changes.

* Finish on-media structural components for pseudo-fs support inside a
  HAMMER filesystem.

* Finish on-media structural components for adding a serial number to
  the B-Tree element structures, for mirroring support.

* Make fsync() wait for the flush to complete, issue extra flushes as
  needed to take the UNDO FIFO's start position past the fsync'd data
  so a crash does not undo it.

15 years agoHAMMER Utilities: Sync with 56D
Matthew Dillon [Fri, 20 Jun 2008 21:18:11 +0000 (21:18 +0000)]
HAMMER Utilities: Sync with 56D

* Time fields moved and format changed to disassociate them from transaction
  ids.

15 years agoDon't do copy{in,out} in ctloutput any more
Aggelos Economopoulos [Fri, 20 Jun 2008 20:58:37 +0000 (20:58 +0000)]
Don't do copy{in,out} in ctloutput any more

15 years agoUpdate bluetooth ctloutput functions not to use copy{in,out}
Aggelos Economopoulos [Fri, 20 Jun 2008 20:52:29 +0000 (20:52 +0000)]
Update bluetooth ctloutput functions not to use copy{in,out}

15 years agoFix a bug in cluster_read(). An error returned by the call to
Matthew Dillon [Fri, 20 Jun 2008 05:40:04 +0000 (05:40 +0000)]
Fix a bug in cluster_read().  An error returned by the call to
VOP_BMAP() in the late read-ahead code is unrelated to the success
of the call and should be ignored.

15 years agoHAMMER 56C/Many: Performance tuning - MEDIA STRUCTURES CHANGED!
Matthew Dillon [Fri, 20 Jun 2008 05:38:26 +0000 (05:38 +0000)]
HAMMER 56C/Many: Performance tuning - MEDIA STRUCTURES CHANGED!

* Implement variable block sizes.  Records at offsets < 1MB use 16K buffers
  while records at offsets >= 1MB use 64K buffers.  This improves performance
  primarily by reducing the number of B-Tree elements we have to stuff.

* Mess around with the deadlock handling code a bit.  It still needs
  a re-think but it works.  Implement low-priority shared locks.
  A low priority shared lock can only be acquired if no other locks are
  held by the thread.

* Implement slow-down code for the record backlog to the flusher and
  reimplement the slow-down code that deals with reclaimed inodes queued
  to the flusher.  This should hopefully fix the kernel memory exhaustion
  issues for M_HAMMER.

* Update layer2->append_off.  It isn't implemented yet but doing this now
  will prevent media incompatibilities later on when it does get implemented.

* Split hammer_blockmap_free() into hammer_blockmap_free() and
  hammer_blockmap_finalize().

* Fix a bug in the delayed-CRC handling related to reblocking.  When
  throwing away a modified buffer, pending CRC requests must also be
  thrown away.

* Fix a bug in the record overlap compare code.  If we cannot return 0
  due to an overlap because the record has been deleted, we must still
  return an appropriate formal code so the scan progresses in the
  correct direction down the red-black tree.

* Make data in the meta-data zone a meta-data buffer structure type so
  it gets synced to disk at the appropriate time.  This may be temporary,
  it's needed to deal with the atime/mtime code but another commit may
  soon make it moot.

* Bump the seqcount so cluster_read() does the right thing when reading
  into a large UIO just after opening a file.

* Do a better job calculating vap->va_bytes.  It's still fake, but its a
  more accurate fake.

* Fix an issue in the BMAP code related to ranges that do not cover the
  requested logical offset.

* Fix a bug in the blockmap code.  If a reservation is released without
  finalizing any allocations within that big-block, another zone can steal
  it out from under the current zone's next_offset, resulting in a zone
  mismatch panic.

15 years agoPrototype declarations don't have an initializer.
YONETANI Tomokazu [Fri, 20 Jun 2008 01:23:27 +0000 (01:23 +0000)]
Prototype declarations don't have an initializer.

15 years agoHAMMER Utilities: Bug fixes
Matthew Dillon [Thu, 19 Jun 2008 23:30:30 +0000 (23:30 +0000)]
HAMMER Utilities: Bug fixes

* The initial layer1->blocks_free was not properly accounting for
  allocations made during newfs_hammer.

15 years agoMiscellanious performance adjustments to the kernel
Matthew Dillon [Thu, 19 Jun 2008 23:27:39 +0000 (23:27 +0000)]
Miscellanious performance adjustments to the kernel

* Add an argument to VOP_BMAP so VFSs can discern the type of operation
  the BMAP is being done for.

* Normalize the variable name denoting the blocksize to 'blksize' in
  vfs_cluster.c.

* Fix a bug in the cluster code where a stale bp->b_error could wind up
  getting returned when B_ERROR is not set.

* Do not B_AGE cluster bufs.

* Pass the block size to both cluster_read() and cluster_write() instead
  of those routines getting the block size from
  vp->v_mount->mnt_stat.f_iosize.  This allows different areas of a file
  to use a different block size.

* Properly initialize bp->b_bio2.bio_offset to doffset in cluster_read().
  This fixes an issue where VFSs were making an extra, unnecessary call
  to BMAP.

* Do not recycle vnodes on the free list until numvnodes has reached
  desiredvnodes.  Vnodes were being recycled when their resident page count
  had dropped to zero, but this is actually too early as the VFS may cache
  important information in the vnode that would otherwise require a number
  of I/O's to re-acquire.  This mainly helps HAMMER (whos inode lookups are
  fairly expensive).

* Do not VAGE vnodes.

* Remove the minvnodes test.  There is no reason not to load the vnode cache
  all the way through to its max.

* buf_cmd_t visibility for the new BMAP argument.

15 years agoProvide MP_LOCK_HELD() for UP builds as well
Aggelos Economopoulos [Thu, 19 Jun 2008 21:32:55 +0000 (21:32 +0000)]
Provide MP_LOCK_HELD() for UP builds as well

15 years agoDuring bridge destroy, dispatch bridge member/span deletion to netisr0
Sepherosa Ziehau [Thu, 19 Jun 2008 15:51:57 +0000 (15:51 +0000)]
During bridge destroy, dispatch bridge member/span deletion to netisr0

15 years agoDispatch whole bridge_ifdetach() to netisr0, since it will touch
Sepherosa Ziehau [Thu, 19 Jun 2008 15:26:47 +0000 (15:26 +0000)]
Dispatch whole bridge_ifdetach() to netisr0, since it will touch
member interface's if_bridge

15 years ago- In bridge_delete_member(), release bridge's serializer when configure
Sepherosa Ziehau [Thu, 19 Jun 2008 14:33:36 +0000 (14:33 +0000)]
- In bridge_delete_member(), release bridge's serializer when configure
  member interface to avoid possible deadlock.  Add comment about it.
  Clear member interface's if_bridge early.
- In bridge_ifdetach(), hold proper bridge interface's serializer before
  calling various deletion functions.

15 years agoChange suseconds_t to long as it is in most of systems. Fixes a lot of
Hasso Tepper [Thu, 19 Jun 2008 12:23:51 +0000 (12:23 +0000)]
Change suseconds_t to long as it is in most of systems. Fixes a lot of
printf related warnings everywhere.

Noticed-by: swildner@
15 years agoMinor style change
Sepherosa Ziehau [Thu, 19 Jun 2008 11:56:04 +0000 (11:56 +0000)]
Minor style change

15 years ago- Don't dispatch bridge 'get' ioctl to netisr0, there are copyouts down
Sepherosa Ziehau [Thu, 19 Jun 2008 11:33:07 +0000 (11:33 +0000)]
- Don't dispatch bridge 'get' ioctl to netisr0, there are copyouts down
  deep inside certain bridge ioctl functions.  Add comment about it.
- Dispatch bridge 'set' ioctl to netisr0, i.e. 'set' ioctls are serialized
  by netisr0.

15 years agoRemove KKASSERT() from the code block where not all callers' CPU own
YONETANI Tomokazu [Thu, 19 Jun 2008 05:34:23 +0000 (05:34 +0000)]
Remove KKASSERT() from the code block where not all callers' CPU own
the LWP, occasionally leading to a panic because of race between CPUs.

Explained-by: dillon@
15 years agoupdate unix domain socket option retrieval
Aggelos Economopoulos [Thu, 19 Jun 2008 00:03:45 +0000 (00:03 +0000)]
update unix domain socket option retrieval

Noticed-by: Andras Voroskoi
15 years agoRemove extra parenthesis.
Sascha Wildner [Wed, 18 Jun 2008 11:38:37 +0000 (11:38 +0000)]
Remove extra parenthesis.

15 years agoMove timeval struct into its own header and include it from headers where
Hasso Tepper [Wed, 18 Jun 2008 09:36:07 +0000 (09:36 +0000)]
Move timeval struct into its own header and include it from headers where
needed or defined by standards plus from sys/types.h. This makes several
pkgsrc packages more happy.

Including just sys/types.h to use struct timeval works there in every BSD,
Linux and Solaris, so we can't just ignore it.

Also make struct timeval standards compilant in progress.

Inspired-by: FreeBSD
15 years agoLink libarchive against libbz2 and libz to be compatible with upstream.
Hasso Tepper [Wed, 18 Jun 2008 06:28:21 +0000 (06:28 +0000)]
Link libarchive against libbz2 and libz to be compatible with upstream.
In this way third party applications linking against libarchive don't need
a special care.

15 years agoHAMMER Utilities: Sync with 56B
Matthew Dillon [Wed, 18 Jun 2008 01:13:52 +0000 (01:13 +0000)]
HAMMER Utilities: Sync with 56B

* Change the way atime is stored.

15 years agoHAMMER 56B/Many: Performance tuning - MEDIA STRUCTURES CHANGED!
Matthew Dillon [Wed, 18 Jun 2008 01:13:30 +0000 (01:13 +0000)]
HAMMER 56B/Many: Performance tuning - MEDIA STRUCTURES CHANGED!

* MEDIA CHANGE: The atime has been moved back into the inode data proper.
  The nlinks field has also been moved.

* PERFORMANCE: The CRC for cached B-Tree nodes was being run on every access
  instead of just the first time.  This was the cause of HAMMER's poor
  directory scanning performance and cpu-intensive write flushes.

  Adjusted to only check the CRC on the initial load into the buffer cache.

* PERFORMANCE: The CRC for modified B-Tree nodes was being regenerated every
  time the node was modified, so a large number of insertions or deletions
  modifying the same B-Tree need needlessly regenerated the CRC each time.

  Adjusted to delay generation of the CRC until just before the buffer is
  flushed to the physical media.

  Just for the record, B-Tree nodes are 4K and it takes ~25uS to run a CRC
  on them.  Needless to say removing the unnecessary calls solved a lot of
  performance issues.

* PERFORMANCE: Removed limitations in the node caching algorithms.  Now more
  then one inode can cache pointers to the same B-Tree node.

* PERFORMANCE: When calculating the parent B-Tree node we have to scan the
  element array to locate the index that points back to the child.  Use a
  power-of-2 algorithm instead of a linear scan.

* PERFORMANCE: Clean up the selection of ip->cache[0] or ip->cache[1] based
  on whether we are trying to cache the location of the inode or the
  location of the file object's data.

15 years agodo early copyin / delayed copyout for socket options
Aggelos Economopoulos [Tue, 17 Jun 2008 20:50:12 +0000 (20:50 +0000)]
do early copyin / delayed copyout for socket options

15 years agoTemporarly comment out message based bridge control; there are copyout deep
Sepherosa Ziehau [Tue, 17 Jun 2008 12:45:55 +0000 (12:45 +0000)]
Temporarly comment out message based bridge control; there are copyout deep
inside of certain bridge_ioctl functions

15 years agoRelease bridge serializer before calling bridge_control
Sepherosa Ziehau [Tue, 17 Jun 2008 12:24:30 +0000 (12:24 +0000)]
Release bridge serializer before calling bridge_control

15 years ago- Release bridge interface's serializer when configuring member interface
Sepherosa Ziehau [Tue, 17 Jun 2008 11:49:11 +0000 (11:49 +0000)]
- Release bridge interface's serializer when configuring member interface
- Set member interface's ifnet.if_bridge only after everything on the bridge
  has been setup
- Minor style change

15 years agoChange number of TX desc back to 256. 512 TX desc does not work on 88E8036.
Sepherosa Ziehau [Tue, 17 Jun 2008 11:00:13 +0000 (11:00 +0000)]
Change number of TX desc back to 256.  512 TX desc does not work on 88E8036.

Reported-by: Ferruccio Zamuner <nonsolosoft@diff.org>
15 years agoHAMMER Utilities: sync with 56A
Matthew Dillon [Tue, 17 Jun 2008 04:03:38 +0000 (04:03 +0000)]
HAMMER Utilities: sync with 56A

* New 'hammer bstats <interval>' command to monitor B-Tree statistics.

* newfs_hammer and related code significantly changed with regards to
  media changes in commit 56A.

15 years agoHAMMER 56A/Many: Performance tuning - MEDIA STRUCTURES CHANGED!
Matthew Dillon [Tue, 17 Jun 2008 04:02:38 +0000 (04:02 +0000)]
HAMMER 56A/Many: Performance tuning - MEDIA STRUCTURES CHANGED!

* MEDIA CHANGE: The blockmaps have been folded into the freemap.  Allocations
  are now made directly out of the freemap.  More work is expected here.

  The blockmaps are still used to sequence allocations, but no block
  number translation is required any more.  This didn't improve performance
  much but it will make it easier for future optimizations to localize
  allocations.

* PERFORMANCE: Removed the holes recording code.  Another commit will
  soon take over the functionality.

* PERFORMANCE: The flusher's slave threads now collect a number of inodes
  into a batch before starting their work, in an attempt to reduce
  deadlocks between slave threads from adjacent inodes.

* PERFORMANCE: B-Tree positional caching now works much better, greatly
  reducing the cpu overhead when accessing the filesystem.

* PERFORMANCE: Added a write-append optimization.  Do not do a
  lookup/iteration to locate records being overwritten when no such
  records should exist.  This cuts the cpu overhead of write-append
  flushes in half.

* PERFORMANCE: Add a vfs.hammer.write_mode sysctl feature to test out
  two different ways of queueing write I/O's.

* Added B-Tree statistics (hammer bstats 1).

15 years agoSerialize bridge configuration operations by netisr0, so that "test and set"
Sepherosa Ziehau [Mon, 16 Jun 2008 14:48:01 +0000 (14:48 +0000)]
Serialize bridge configuration operations by netisr0, so that "test and set"
member interface's if_bridge field could be safe.

15 years agoUpdate build structure for libarchive update.
Peter Avalos [Mon, 16 Jun 2008 08:20:23 +0000 (08:20 +0000)]
Update build structure for libarchive update.

15 years agoMerge from vendor branch LIBARCHIVE:
Peter Avalos [Mon, 16 Jun 2008 08:12:40 +0000 (08:12 +0000)]
Merge from vendor branch LIBARCHIVE:
Import libarchive-2.5.4b.

Requested-by: hasso
15 years agoImport libarchive-2.5.4b.
Peter Avalos [Mon, 16 Jun 2008 08:12:40 +0000 (08:12 +0000)]
Import libarchive-2.5.4b.

Requested-by: hasso
15 years agoWe must process incoming IPI messages when spinning in the thread
Matthew Dillon [Mon, 16 Jun 2008 02:00:05 +0000 (02:00 +0000)]
We must process incoming IPI messages when spinning in the thread
cpu acquisition code.  This avoids a deadlock which can occur between
the cpu whos thread is trying to exit and the cpu receiving the thread.

Reported-by: Gary Allan <dragonfly@gallan.co.uk>
15 years agoThe default value of net.inet6.ip6.v6only is 'on'.
Sascha Wildner [Sun, 15 Jun 2008 19:20:05 +0000 (19:20 +0000)]
The default value of net.inet6.ip6.v6only is 'on'.

Noticed-by: Jordan Gordeev <jgordeev@dir.bg>
15 years ago- In if_up(), purge ifnet.if_snd before turning on IFF_UP, this is used to
Sepherosa Ziehau [Sun, 15 Jun 2008 12:15:08 +0000 (12:15 +0000)]
- In if_up(), purge ifnet.if_snd before turning on IFF_UP, this is used to
  clean up packets that sneaked into ifnet.if_snd after if_down()
- Strip blank line

15 years ago- Don't turn on IFF_OACTIVE when dequeuing ifnet.if_snd; it no longer
Sepherosa Ziehau [Sun, 15 Jun 2008 12:01:32 +0000 (12:01 +0000)]
- Don't turn on IFF_OACTIVE when dequeuing ifnet.if_snd; it no longer
  makes sense
- If parent interface is NULL, purge ifnet.if_snd

15 years ago- Fix a possible race between getting vlan media and changing vlan parent
Sepherosa Ziehau [Sun, 15 Jun 2008 11:41:40 +0000 (11:41 +0000)]
- Fix a possible race between getting vlan media and changing vlan parent
- White space cleanup

15 years agoAdd missing return
Sepherosa Ziehau [Sun, 15 Jun 2008 11:19:15 +0000 (11:19 +0000)]
Add missing return

15 years ago- Add FXP_USABLE_TXCB, which equals (FXP_NTXCB - 1)
Sepherosa Ziehau [Sun, 15 Jun 2008 10:41:00 +0000 (10:41 +0000)]
- Add FXP_USABLE_TXCB, which equals (FXP_NTXCB - 1)
- Turn off IFF_OACTIVE if queued TCBs is less than FXP_USABLE_TXCB
- Call if_devstart() in fxp_tick(), if ifnet.if_snd is not empty
- Remove unnecessary comment about ifnet.if_timer in fxp_init()

15 years agoDon't assume RV2P page size is always 4Kbytes; at least 8Kbytes page size
Sepherosa Ziehau [Sun, 15 Jun 2008 05:14:41 +0000 (05:14 +0000)]
Don't assume RV2P page size is always 4Kbytes; at least 8Kbytes page size
works too.

15 years agoBreak long line
Sepherosa Ziehau [Sun, 15 Jun 2008 02:32:38 +0000 (02:32 +0000)]
Break long line

15 years agoRemove the old FreeBSD logo screen saver.
Sascha Wildner [Sat, 14 Jun 2008 20:09:18 +0000 (20:09 +0000)]
Remove the old FreeBSD logo screen saver.

It has not been built for >4 years now.

15 years agoAdd missing ;
Matthias Schmidt [Sat, 14 Jun 2008 15:30:19 +0000 (15:30 +0000)]
Add missing ;

Reported-by: trevorjk
15 years agoIn the final code block of in_control_internal, remove ia from the hash table
Sepherosa Ziehau [Sat, 14 Jun 2008 08:40:16 +0000 (08:40 +0000)]
In the final code block of in_control_internal, remove ia from the hash table
only if cmd is SIOCDIFADDR.  Add assertions and comment about it.

15 years ago- Check cached ifnet.if_bridge again in bridge_{input,output}()
Sepherosa Ziehau [Sat, 14 Jun 2008 07:58:46 +0000 (07:58 +0000)]
- Check cached ifnet.if_bridge again in bridge_{input,output}()
- Pass cached ifnet.if_bridge to bstp_input()
- Pass the located bif to bstp_input(), so we won't need to locate bif again

These changes make it possible to use following sequence
    ifp->if_bridge = NULL;
    netmsg_service_sync();
to protect ifnet.if_bridge

15 years agoMinor style change
Sepherosa Ziehau [Sat, 14 Jun 2008 06:34:37 +0000 (06:34 +0000)]
Minor style change

15 years agoChange the namecache lock warning delay from 1 to 5 seconds.
Matthew Dillon [Sat, 14 Jun 2008 05:34:06 +0000 (05:34 +0000)]
Change the namecache lock warning delay from 1 to 5 seconds.

15 years agoMember iface's serializer does not need to be held when calling bridge_output()
Sepherosa Ziehau [Sat, 14 Jun 2008 04:35:32 +0000 (04:35 +0000)]
Member iface's serializer does not need to be held when calling bridge_output()

15 years agoRemove unused parameters to bridge_output
Sepherosa Ziehau [Sat, 14 Jun 2008 04:00:51 +0000 (04:00 +0000)]
Remove unused parameters to bridge_output

15 years agoHAMMER Utilities: Sync with commit 55 - MEDIA STRUCTURES CHANGED!
Matthew Dillon [Sat, 14 Jun 2008 01:44:13 +0000 (01:44 +0000)]
HAMMER Utilities: Sync with commit 55 - MEDIA STRUCTURES CHANGED!

* newfs_hammer now creates a new blockmap zone for meta-data

* The hammer utility has been enhanced and brought up-to-date.  One
  can now reblock directories separately from other data.

* The hammer show command now properly understands the B-Tree element
  localization field (fixed improper reporting of 'B'ad B-Tree elements).

15 years agoHAMMER 55: Performance tuning and bug fixes - MEDIA STRUCTURES CHANGED!
Matthew Dillon [Sat, 14 Jun 2008 01:42:13 +0000 (01:42 +0000)]
HAMMER 55: Performance tuning and bug fixes - MEDIA STRUCTURES CHANGED!

* BUG-FIX: Fix a race in hammer_rel_mem_record() which could result in a
  machine lockup.  The code could block at an inappropriate time with both
  the record and a dependancy inode pointer left unprotected.

* BUG-FIX: The direct-write code could assert on (*error != 0) due to an
  incorrect conditional in the in-memory record scanning code.

* Inode data and directory entry data has been given its own zone as a
  stop-gap until the low level allocator can be rewritten.

* Increase the directory object-id cache from 128 entries to 1024 entries.

* General cleanup.

* Introduce a separate reblocking domain for directories: 'hammer reblock-dirs'.

15 years agoStrip "serialized" suffix
Sepherosa Ziehau [Fri, 13 Jun 2008 12:30:19 +0000 (12:30 +0000)]
Strip "serialized" suffix

15 years agoHAMMER 54D/Many: Performance tuning.
Matthew Dillon [Fri, 13 Jun 2008 00:25:33 +0000 (00:25 +0000)]
HAMMER 54D/Many: Performance tuning.

* Remove major barriers to write performance and fix hicups revealed by
  blogbench.

  Change the HAMMER reclaim-delay algorithm to operate like a FIFO instead
  of as a free-for-all.  The idea of introducing a dynamic delay helped some,
  but the addition of the wakeup FIFO allows burst completions by the flusher
  to immediately wakeup processes that were waiting for the reclaim count to
  drain.  The result is far, far smoother operation.

* Remove a major blocking conflict between the buffer cache daemon and
  HAMMER.  The buffer cache was getting stuck on trying to overwrite dirty
  records that had already been queued to the flusher.  The flusher might
  not act on the record(s) for a long period of time, causing the buffer
  cache daemon to stall.

  Fix the problem by properly using the HAMMER_RECF_INTERLOCK_BE flag,
  which stays on only for a very short period of time, instead of testing
  the record's flush state (record->flush_state), which can stay in
  the HAMMER_FST_FLUSH state for a very long time.

* The parent B-Tree node does not need to be locked when inserting
  into the child.

* Use the new B_AGE semantics to keep meta-data intact longer.  This results
  in another big improvement in random read and write performance.

15 years agoLWPHOLD/LWPRELE must be atomic ops because an IPI can call LWPRELE.
Matthew Dillon [Fri, 13 Jun 2008 00:25:01 +0000 (00:25 +0000)]
LWPHOLD/LWPRELE must be atomic ops because an IPI can call LWPRELE.

15 years agoReimplement B_AGE. Have it cycle the buffer in the queue twice instead of
Matthew Dillon [Thu, 12 Jun 2008 23:26:37 +0000 (23:26 +0000)]
Reimplement B_AGE.  Have it cycle the buffer in the queue twice instead of
placing buffers at the head of the queue (which causes them to be run-down
backwards).  Leave B_AGE set through the write cycle and have the bufdaemon
set the flag when flushing dirty buffers.  B_AGE no longer effects the
ordering of the actual write and is allowed to slide through to the clean
queue when the write completes.

15 years agoAdd missing LWPHOLD/LWPRELE in kinfo code.
Matthew Dillon [Thu, 12 Jun 2008 23:25:02 +0000 (23:25 +0000)]
Add missing LWPHOLD/LWPRELE in kinfo code.

15 years agoFix probable cut-n-paste error.
Hasso Tepper [Thu, 12 Jun 2008 07:09:31 +0000 (07:09 +0000)]
Fix probable cut-n-paste error.

Obtained-from: NetBSD

15 years agoHAMMER 54C/Many: Performing tuning, bug fixes
Matthew Dillon [Thu, 12 Jun 2008 01:55:58 +0000 (01:55 +0000)]
HAMMER 54C/Many: Performing tuning, bug fixes

* Adjust the reclaims delay code

* Fix a direct-read bug.  Truncations were not being properly handled.

15 years agoHAMMER 54B/Many: Performance tuning.
Matthew Dillon [Thu, 12 Jun 2008 00:16:10 +0000 (00:16 +0000)]
HAMMER 54B/Many: Performance tuning.

* Fix a major performance issue in the UNDO generation code.  The code
  was calling hammer_bread() instead of hammer_bnew() for 'new' undo buffers,
  meaning it was doing a read-modify-write on the disk instead of just a
  write.

  This fix results in a MAJOR improvement in performance across the board.

* Replace the only lockmgr lock in the module with a hammer_lock.

* Tweak hammer_inode_waitreclaims().  This will probably need even more
  tweaking as time passes.

15 years agoHAMMER 54/Many: Performance tuning
Matthew Dillon [Wed, 11 Jun 2008 22:33:21 +0000 (22:33 +0000)]
HAMMER 54/Many: Performance tuning

* Implement hammer_vop_bmap().

* Implement cluster_read() support.  This should jump up linear read
  performance almost to the platter speed.  I get 100 MB/sec testing
  vs 35 MB/sec previously.

* Do a better job kicking an inode into the flusher when writing
  sequentially.  This hops up write rate at least +50%.  It isn't
  quite able to run at the platter speed due to B-Tree overheads
  which will be addressed in a later patch.

* Do not create data fragments at the ends of files greater then 16K, use
  a full 16K block.  The reason is that fragments in HAMMER are allocated
  out of a wholely different zone and we do not want to lose the chance of
  making the tail end of the file contiguous.

  Files less then 16K still use data fragments.

* Fix a machine lockup related to an interrupt race with biodone() and
  insertions and deltions from hmp->lose_list.

* Fix a memory exhaustion issue.

Reported-by: Francois Tigeot <ftigeot@wolfpond.org> (machine lockup)
Credit-also: Jonathan Stuart on the 0 byte sized file bug fix.

15 years agoFix a path in the comment.
Sascha Wildner [Wed, 11 Jun 2008 20:01:31 +0000 (20:01 +0000)]
Fix a path in the comment.

15 years agoHAMMER 53H/Many: Performance tuning, bug fixes
Matthew Dillon [Tue, 10 Jun 2008 22:30:21 +0000 (22:30 +0000)]
HAMMER 53H/Many: Performance tuning, bug fixes

* CHANGE THE ON-MEDIA B-TREE STRUCTURE.  The number of elements per node has
  been increased from 16 to 64.  The intent is to reduce the number of seeks
  required in a heavy random-access loading situation.

* Add a shortcut to the B-Tree node scanning code (requires more testing).
  Instead of scanning linearly we do a power-of-2 narrowing search.

* Only do clustered reads for DATA types.  Do not cluster meta-data (aka
  B-Tree) I/O.  Note that the inode data structure is considered to be
  a DATA type.  Reduce the cluster read side from 256K to 64K to avoid
  blowing out the buffer cache.

* Augment hammer locks so one can discern between a normal lock blockage
  and one that is recovering from a deadlock.

* Change the slave work threads for the flusher to pull their work off a
  single queue.  This fixes an issue where one slave work thread would
  sometimes get a disproportionate percentage of the work and the
  master thread then had to wait for it to finish while the other work
  threads were twiddling their thumbs.

* Adjust the wait reclaims code to solve a long standing performance issue.
  The flusher could get so far behind that the system's buffer cache buffers
  would no longer have any locality of reference to what was being flushed,
  causing a massive drop in performance.

* Do not queue a dirty inode to the flusher unconditionally in the strategy
  write code.  Only do it if system resources appear to be stressed.
  The inode will get flushed when the filesystem syncs.

* Code cleanup.

* Fix a bug reported by Antonio Huete Jimenez related to 0-length writes
  not working properly.

15 years agoSwitch from bioq_insert_tail() to bioqdisksort(). When the kernel is
Matthew Dillon [Tue, 10 Jun 2008 17:20:52 +0000 (17:20 +0000)]
Switch from bioq_insert_tail() to bioqdisksort().  When the kernel is
juggling hundreds of I/O requests the on-disk controllers, which have limited
queue sizes, are unable to completely optimize the accesses.

This seems to make a pretty big difference on the twe device I tested with
when running blogbench on HAMMER, which can approach 1000 simultaniously
queued I/O's.

15 years agoMake sure host controller interrupts are not enabled until all
Hasso Tepper [Tue, 10 Jun 2008 10:08:11 +0000 (10:08 +0000)]
Make sure host controller interrupts are not enabled until all
initialisation is finished.

Obtained-from: NetBSD

15 years agoRemove the code which disables port status change interrupts for 1 second
Hasso Tepper [Tue, 10 Jun 2008 10:04:06 +0000 (10:04 +0000)]
Remove the code which disables port status change interrupts for 1 second
when one occured. It meant that event get lost or delayed until the next
change leaving the port dead under some circumstances.

Obtained-from: NetBSD

15 years agoHAMMER 53G/Many: Performance tuning.
Matthew Dillon [Tue, 10 Jun 2008 08:51:02 +0000 (08:51 +0000)]
HAMMER 53G/Many: Performance tuning.

* Implement multiple flusher threads.

* Move the call to hammer_inode_waitreclaims() yet again.  Call it from
  hammer_vop_reclaim().

15 years agoHAMMER 53F/Many: Fix deadlock.
Matthew Dillon [Tue, 10 Jun 2008 08:06:28 +0000 (08:06 +0000)]
HAMMER 53F/Many: Fix deadlock.

* Do not sleep waiting for reclaimed inodes to drain while holding
  an inode lock.

15 years agoRemove superfluous recursive lock. This little change makes possible (safe)
Hasso Tepper [Tue, 10 Jun 2008 06:35:59 +0000 (06:35 +0000)]
Remove superfluous recursive lock. This little change makes possible (safe)
to use spinlock(9) instead of lockmgr(9).

15 years agoFix ordering mismatch between KERN_* values and CTL_KERN_NAMES array.
Nicolas Thery [Tue, 10 Jun 2008 05:20:10 +0000 (05:20 +0000)]
Fix ordering mismatch between KERN_* values and CTL_KERN_NAMES array.

15 years agoHAMMER 53E/Many: Performance tuning
Matthew Dillon [Tue, 10 Jun 2008 05:06:20 +0000 (05:06 +0000)]
HAMMER 53E/Many: Performance tuning

* Change the code which waits for reclaims to drain to be more inline with
  the new bwillwrite().  Impose a dynamic delay instead of blocking outright.

* Move the hammer_inode_waitreclaims() call from hammer_vop_open() to
  hammer_get_inode(), and only call it when we would otherwise have to
  create a new inode.

* Sort HAMMER's file list in conf/files.

15 years agoChange bwillwrite() to smooth out performance under heavy loads. Blocking
Matthew Dillon [Tue, 10 Jun 2008 05:02:09 +0000 (05:02 +0000)]
Change bwillwrite() to smooth out performance under heavy loads.  Blocking
based on strict hystersis was being used to try to gang flushes together
but filesystems can still blow out the buffer cache and cause processes
to block for long periods of time waiting for the dirty count to drop
significantly.

Instead, as the number of dirty buffers exceeds the desired maximum
bwillwrite() imposes a dynamic delay which increases as the number of
dirty buffers increase.  This improves the stall behavior under heavy loads
and keeps the system responsive.

TODO: The algorithm needs to have a per-LWP heuristic to penalize heavy
writers more then light ones.

15 years agoHAMMER 53D/Many: Stabilization
Matthew Dillon [Tue, 10 Jun 2008 00:40:31 +0000 (00:40 +0000)]
HAMMER 53D/Many: Stabilization

* Fix an overwrite bug with direct write which could result in file
  corruption.

* Reserve just-freed big blocks for two flush cycles to prevent HAMMER from
  overwriting destroyed data so it does not become corrupt if the system
  crashes.  This is needed because the recover code does not record UNDOs
  for data (nor do we want it to).

* More I/O subsystem work.  There may still be an ellusive panic related
  to calls to regetblk().

15 years agoAdd an extern for hidirtybuffers.
Matthew Dillon [Mon, 9 Jun 2008 16:54:45 +0000 (16:54 +0000)]
Add an extern for hidirtybuffers.

Reported-by: Michael Neumann <mneumann@ntecs.de>
15 years agoParallelize in_ifaddrhashtbl
Sepherosa Ziehau [Mon, 9 Jun 2008 11:24:24 +0000 (11:24 +0000)]
Parallelize in_ifaddrhashtbl

15 years agoMove stack variable near its usage
Sepherosa Ziehau [Mon, 9 Jun 2008 04:59:22 +0000 (04:59 +0000)]
Move stack variable near its usage

15 years agoFix a SMP race in signotify_remote(). LWPHOLD() the lwp being
Matthew Dillon [Mon, 9 Jun 2008 04:33:08 +0000 (04:33 +0000)]
Fix a SMP race in signotify_remote().  LWPHOLD() the lwp being
passed from one cpu to another over an IPI to prevent it from exiting
in the mean time and causing the IPI to panic.

15 years agoHAMMER 53C/Many: Stabilization
Matthew Dillon [Mon, 9 Jun 2008 04:19:10 +0000 (04:19 +0000)]
HAMMER 53C/Many: Stabilization

* HAMMER queues dirty inodes reclaimed by the kernel to the backend for
  their final sync.  Programs like blogbench can overload the backend and
  generate more new inodes then the backend can dispose of, running
  M_HAMMER out of memory.

  Add code to stall on vop_open() when this condition is detected to
  give the backend a chance to catch-up.  (see NOTE 1 below).

* HAMMER could build up too many meta-data buffers and cause the system
  to deadlock in newbuf.  Recode the flusher to allow a block of UNDOs,
  the volume header, and all related meta-data buffers to be flushed
  piecemeal, and then continue the flush loop without closing out the
  transaction.   If a crash occurs the recovery code will undo the partial
  flushes.

* Fix an issue located by FSX under load.  The in-memory/on-disk record
  merging code was not dealing with in-memory data records properly
  The key field for data records is (base_offset + data_len), not just
  (base_off), so a 'match' between an in-memory data record and an on-disk
  data records requires a special case test.  This is the case where the
  in-memory record is intended to overwrite the on-disk record, so the
  in-memory record must be chosen and the on-disk record discarded for
  the purposes of read().

* Fix a bug in hammer_io.c related to the handling of B_LOCKED buffers
  that resulted in an assertion at umount time.  Buffer cache buffers
  were not being properly disassociated from their hammer_buffer countparts
  in the direct-write case.

* The frontend's direct-write capability for truncated buffers (such as
  used with small files) was causing an assertion to occur on the backend.
  Add an interlock on the related hammer_buffer to prevent the frontend
  from attempting to modify the buffer while the backend is trying to
  write it to the media.

* Dynamically size the dirty buffer limit.  This still needs some work.

(NOTE 1): On read/write performance issues.  Currently HAMMER's frontend
VOPs are massively disassociated from modifying B-Tree updates.  Even though
a direct-write capability now exists, it applies only to bulk data writes
to disk and NOT to B-Tree updates.  Each direct write creates a record
which must be queued to the backend to do the B-Tree update on the
media.  The flusher is currently single-threaded and when HAMMER gets
too far behind doing these updates the current safeties will cause
performance to degrade drastically.  This is a known issue that
will be addressed.

15 years agoFix typo.
Sascha Wildner [Sun, 8 Jun 2008 20:40:38 +0000 (20:40 +0000)]
Fix typo.

15 years agoFix typos.
Sascha Wildner [Sun, 8 Jun 2008 20:40:15 +0000 (20:40 +0000)]
Fix typos.