dragonfly.git
15 years agoBuild the installer as part of normal build-/installworld if WANT_INSTALLER
Sascha Wildner [Wed, 9 Jul 2008 07:21:03 +0000 (07:21 +0000)]
Build the installer as part of normal build-/installworld if WANT_INSTALLER
is set.

Clean up nrelease/Makefile to define WANT_INSTALLER if the 'installer'
target is specified.

15 years agoAdd description for CVS_UPDATE and update description for SUP* variables.
Thomas Nikolajsen [Tue, 8 Jul 2008 15:12:36 +0000 (15:12 +0000)]
Add description for CVS_UPDATE and update description for SUP* variables.

15 years agoMake et(4) aware ETHER_INPUT_CHAIN and ETHER_INPUT2
Sepherosa Ziehau [Tue, 8 Jul 2008 14:36:02 +0000 (14:36 +0000)]
Make et(4) aware ETHER_INPUT_CHAIN and ETHER_INPUT2

15 years agoata(4) isn't used in GENERIC anymore.
Thomas Nikolajsen [Tue, 8 Jul 2008 14:12:45 +0000 (14:12 +0000)]
ata(4) isn't used in GENERIC anymore.

15 years agoUpdate file list and description.
Thomas Nikolajsen [Tue, 8 Jul 2008 14:04:11 +0000 (14:04 +0000)]
Update file list and description.

15 years agoHandle MPLS on ETHER_INPUT2 code path
Sepherosa Ziehau [Tue, 8 Jul 2008 13:50:52 +0000 (13:50 +0000)]
Handle MPLS on ETHER_INPUT2 code path

15 years agoUpdate names of rc.d diskless scripts.
Thomas Nikolajsen [Tue, 8 Jul 2008 12:08:29 +0000 (12:08 +0000)]
Update names of rc.d diskless scripts.

15 years agoAdd description of DragonFly-src-supfile.
Thomas Nikolajsen [Tue, 8 Jul 2008 11:59:15 +0000 (11:59 +0000)]
Add description of DragonFly-src-supfile.
Expand TABs.

15 years agoHAMMER 60H/Many: Stabilization pass
Matthew Dillon [Tue, 8 Jul 2008 04:34:41 +0000 (04:34 +0000)]
HAMMER 60H/Many: Stabilization pass

* Fix races in the in-memory/B-Tree scanning code introduced by the
  mirror_tid update code.  This fixes two assertion panics.

* Remove compile-time reminder #warning that no longer applies.
  (Sascha will be happy).

15 years agoCleanup - move a warning so it doesn't spam the screen so much, cleanup
Matthew Dillon [Tue, 8 Jul 2008 03:34:27 +0000 (03:34 +0000)]
Cleanup - move a warning so it doesn't spam the screen so much, cleanup
some syntax.

15 years agoAdd the HAMMER filesystem to GENERIC and VKERNEL.
Matthew Dillon [Tue, 8 Jul 2008 01:39:27 +0000 (01:39 +0000)]
Add the HAMMER filesystem to GENERIC and VKERNEL.

15 years agoAdd 'options MPLS' to LINT.
Nuno Antunes [Mon, 7 Jul 2008 23:11:54 +0000 (23:11 +0000)]
Add 'options MPLS' to LINT.
Remove comment.

15 years agoThe behavior of -m introduced in r1.4 leads to an error message upon
Sascha Wildner [Mon, 7 Jul 2008 23:03:25 +0000 (23:03 +0000)]
The behavior of -m introduced in r1.4 leads to an error message upon
booting if (for example) a laptop with a mouse pad is booted with an
additional USB mouse attached and both moused_enable and usbd_enable
are set in rc.conf.

Therefore, go back to the old behavior again, which is to allow
enabling the mouse cursor more than once.

15 years agoHAMMER 60G/Many: Mirroring, bug fixes
Matthew Dillon [Mon, 7 Jul 2008 22:42:35 +0000 (22:42 +0000)]
HAMMER 60G/Many: Mirroring, bug fixes

* Fix a bug in the mirror_tid propagation that could cause a delete_range
  iteration to get way way off.  B-Tree insertions were not calling
  hammer_cursor_inserted_element().

* Fix an assertion in the delete_range iteration, delete-visibility could
  cause the assert to trigger when it shouldn't.

* Add a new assertion testing that the iteration is still within the
  inode object to catch any remaining mirror_tid propagation bugs.

* Minor code documentation adjustments.

Reported-by: Gergo Szakal <bastyaelvtars@gmail.com>
15 years agoIntroduce experimental MPLS over ethernet support. Add 'options MPLS'
Nuno Antunes [Mon, 7 Jul 2008 22:02:10 +0000 (22:02 +0000)]
Introduce experimental MPLS over ethernet support. Add 'options MPLS'
to the kernel config file to enable it. This modification increases
the footprint of each route in the FIB by 12 bytes, used to hold up
to 3 label operations per route.

Hints-from: Ayame, NiSTswitch implementations.
Reviewed-by: dillon@, sephe@, hsu@, hasso@.
15 years agoUFS+softupdates can build up thousands of dirty 1K buffers and run out
Matthew Dillon [Mon, 7 Jul 2008 17:31:07 +0000 (17:31 +0000)]
UFS+softupdates can build up thousands of dirty 1K buffers and run out
of buffers before it even hits the lodirtybufspace point.  The buf_daemon
is never triggered.  This case occurs rarely but can be triggered e.g.
by a cvs update.

Add dirtybufcount back in and flush if it exceeds (nbuf / 2) to handle
this degenerate case.

Reported-by: "Sepherosa Ziehau" <sepherosa@gmail.com>
15 years agoRename fid_reserved to fid_ext.
Matthew Dillon [Mon, 7 Jul 2008 16:02:36 +0000 (16:02 +0000)]
Rename fid_reserved to fid_ext.

15 years agoSync zoneinfo database with tzdata2008d from elsie.
Sascha Wildner [Mon, 7 Jul 2008 15:29:51 +0000 (15:29 +0000)]
Sync zoneinfo database with tzdata2008d from elsie.

africa:         8.11 -> 8.13
asia:           8.20 -> 8.21
australasia:    8.8  -> 8.9
europe:         8.12 -> 8.14
northamerica:   8.23 -> 8.24
southamerica:   8.19 -> 8.26
zone.tab:       8.16 -> 8.18

From Arthur David Olson's and Paul Eggert's comments:

Changes affecting current and future time stamps:

* africa: changes to reflect Mauritius' 2008-2009 DST experiment

* southamerica and zone.tab: changes to reflect Brazilian time zone
  realignments

* America/Eirunepe also changed from ACT (UTC-5) to AMT (UTC-4) on June 24

Changes affecting past time stamps:

* For Mauritius, also include the 1982/1983 DST as reported by
  Steffen Thorsen

* For America/Argentina/San_Luis, redo the history from 1990 through 2000
  to match what's in Shanks & Pottenger

The following changes should not affect externally visible behavior:

* australasia, europe and southamerica: changes by Halasz Sandor Viktor to
  fix URLs

* Redo comments about Brazil to make it clearer about what west Para contains

* Update Brazil comments to mention Decree 6,212 (2007-09-26)

* Make comments a bit more concise for Brazil and Mauritius

* Redo comments about Argentina to reflect the fact that San Luis is now
  separate

* Redo the daylight-saving rules for Berlin in 1945 to make it clearer that
  these are for the Soviet Zone, not for Berlin in general

* Redo Bahamas rules to make it clearer that the rules after 1975 are the
  same as the US

* Add comments about time in China from 1949 to 1980
  (Thanks to Thomas S. Mullaney for this.)

15 years agoDo copy{in,out} early in the {g,s}etsockopt system call paths
Aggelos Economopoulos [Mon, 7 Jul 2008 14:35:12 +0000 (14:35 +0000)]
Do copy{in,out} early in the {g,s}etsockopt system call paths
so the rest of the kernel can assume it's dealing with a
kernel address in ->sopt_val. This means that soopt{,_m}copy{in,out}
are now seriously misnamed and should be replaced by soopt_{from,to}_*

Suggested-by: dillon@
15 years agoIFF_BROADCAST will never be changed
Sepherosa Ziehau [Mon, 7 Jul 2008 13:14:23 +0000 (13:14 +0000)]
IFF_BROADCAST will never be changed

15 years agoWhite space
Sepherosa Ziehau [Mon, 7 Jul 2008 11:31:28 +0000 (11:31 +0000)]
White space

15 years agoThe MAC address of nfe(4), whose device id is above MCP55, is saved in
Sepherosa Ziehau [Mon, 7 Jul 2008 11:29:28 +0000 (11:29 +0000)]
The MAC address of nfe(4), whose device id is above MCP55, is saved in
different order than older ones.  Model numbers from forthdeth.

Reported-by: Michael Neumann <mneumann@ntecs.de>
15 years agoHAMMER Utilities: Sync with 60F
Matthew Dillon [Mon, 7 Jul 2008 03:51:29 +0000 (03:51 +0000)]
HAMMER Utilities: Sync with 60F

* Use sync_end_tid as the snapshot TID rather then sync_beg_tid.

* Initialize sync_beg_tid to 0 instead of 1 in PFS 0's pfsd structure.

* Reported the random fsid assigned by newfs_hammer to a new HAMMER
  filesystem.

15 years agoHAMMER 60F/Many: Mirroring
Matthew Dillon [Mon, 7 Jul 2008 03:49:51 +0000 (03:49 +0000)]
HAMMER 60F/Many: Mirroring

* Properly propagate mirror_tid when splitting B-Tree nodes.

* Arrange for the fsid reported as st_dev to be based on the shared_uuid,
  so the same value is reported on the slaves as on the master.

  Munge the fsid based on the asof timestamp to try to make snapshots look
  different from current filesystems, so programs like 'diff' don't get
  confused.

  This allows one to run (tar cf - directory@@<timestamp> | md5) on a
  slave and get the same answer as he got on the master.  Note, however,
  that the tar cannot include the root directory of the PFS or master
  because the root directory inode is not mirrored (only files and directories
  underneath it), and will mess up the MD5.

* Properly update vol0_next_tid when writing to a mirroring slave.

* Attempt to regenerate the inode for the root PFS when doing a name lookup
  based on the current latest snapshot.  This may need more work.

15 years agoWhen creating a new HAMMER filesystem also create a PFS record for it,
Matthew Dillon [Mon, 7 Jul 2008 01:29:32 +0000 (01:29 +0000)]
When creating a new HAMMER filesystem also create a PFS record for it,
setting the unique and shared uuids to the fsid in the volume header.

15 years agoHAMMER Utilities: Sync with 60E
Matthew Dillon [Mon, 7 Jul 2008 00:27:22 +0000 (00:27 +0000)]
HAMMER Utilities: Sync with 60E

* Change the cycle file to hold an entire B-Tree base key, plus an optional
  TID (used by the mirroring code).

* Flesh out the mirroring code.  Add timeout (-t) support.  Add cycle file
  support.

* When mirror-copy is used have the target sync the filesystem
  and acknowledge completion and store the completed TID in the cycle
  file.

* Incremental mirroring now works when using mirror-copy with a cycle file.

* Add mirror-dump, aka hammer mirror-read ... | hammer mirror-dump, for
  debugging.

15 years agoHAMMER 60E/Many: Mirroring, bug fixes
Matthew Dillon [Mon, 7 Jul 2008 00:24:31 +0000 (00:24 +0000)]
HAMMER 60E/Many: Mirroring, bug fixes

* Work on the mirror_tid propagation code.  The code now retries on
  EDEADLK so propagation is guaranteed to reach the root.

* Get most of the mirror_write code working.

* Add PFS support for NFS exports.  Change fid_reserved to fid_ext and use
  it to store the localization parameter that selects the PFS.  This isn't
  well tested yet.

* BUGFIX: Fix a bug in vol0_last_tid updates.  Flush sequences might
  not always update the field, creating issues with mirroring and snapshots.

* BUGFIX: Properly update the volume header CRC.

* CLEANUP: Fix some obj_id's that were u_int64_t's. They should be int64_t's.

* CLEANUP: #if 0 out unused code, remove other bits of unused code.

15 years agoEnsure AP is associated before we return.
Thomas Nikolajsen [Mon, 7 Jul 2008 00:00:56 +0000 (00:00 +0000)]
Ensure AP is associated before we return.

Otherwise further rc.d processing, eg dhclient,
can fail to get working network connection.

15 years agoFix typo.
Thomas Nikolajsen [Sun, 6 Jul 2008 23:56:32 +0000 (23:56 +0000)]
Fix typo.

15 years agoDescribe which FW package is causing error;
Thomas Nikolajsen [Sun, 6 Jul 2008 23:55:51 +0000 (23:55 +0000)]
Describe which FW package is causing error;
we have multiple FW packages in base system.

15 years agoUpdate etc/inetd.conf:
Thomas Nikolajsen [Sun, 6 Jul 2008 23:50:19 +0000 (23:50 +0000)]
Update etc/inetd.conf:
 - uucp removed from base system 5 years ago
 - kerberosIV removed from base system 4 years ago
 - pcnfsd removed from base system 14 years ago
 - change path in examples from /usr/local/ to /usr/pkg/
   as we changed from ports to pkgsrc several years ago

15 years agoChange soopt_mcopyin() and soopt_mcopyout() to not modify soopt_val and
Nicolas Thery [Sun, 6 Jul 2008 19:01:57 +0000 (19:01 +0000)]
Change soopt_mcopyin() and soopt_mcopyout() to not modify soopt_val and
soopt_valsize.  This fixes a "already free" panic when so_pru_ctloutput()
kfree()'s soopt_val.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
Reviewed-by: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
15 years agoAdd Makefile that compiles serial port enabled boot loader.
Michael Neumann [Sun, 6 Jul 2008 17:20:16 +0000 (17:20 +0000)]
Add Makefile that compiles serial port enabled boot loader.

15 years agoExtend boot loader so that it can be compiled to work over a serial port.
Michael Neumann [Sun, 6 Jul 2008 17:17:01 +0000 (17:17 +0000)]
Extend boot loader so that it can be compiled to work over a serial port.

Obtained-From: FreeBSD

15 years agoNuke unused macro and comment
Sepherosa Ziehau [Sun, 6 Jul 2008 09:17:12 +0000 (09:17 +0000)]
Nuke unused macro and comment

15 years agoPrint chip informantion in bge_attach() instead of bge_probe()
Sepherosa Ziehau [Sun, 6 Jul 2008 08:46:33 +0000 (08:46 +0000)]
Print chip informantion in bge_attach() instead of bge_probe()

15 years agoAdjust default interrupt moderation variables
Sepherosa Ziehau [Sun, 6 Jul 2008 08:13:46 +0000 (08:13 +0000)]
Adjust default interrupt moderation variables

15 years agoFor PCI Express devices:
Sepherosa Ziehau [Sun, 6 Jul 2008 06:47:10 +0000 (06:47 +0000)]
For PCI Express devices:
1) Adjust max read request size to 4Kbytes
2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()

Though 1) does not seem to have much to do with the poor TX performance (*)
observed on PCI Express bge(4), 2) does fix the problem.

Obtained-from: tg3

# (*)
# http://lists.freebsd.org/pipermail/freebsd-net/2007-June/014373.html
# FreeBSD kern/119361

15 years agoTX coalesce ticks can't be more than 1023
Sepherosa Ziehau [Sun, 6 Jul 2008 05:54:09 +0000 (05:54 +0000)]
TX coalesce ticks can't be more than 1023

Obtained-from: tg3

15 years agoAdd bits for PCI Express device control register
Sepherosa Ziehau [Sun, 6 Jul 2008 05:47:14 +0000 (05:47 +0000)]
Add bits for PCI Express device control register

15 years agoError out if no volumes are specified instead of core-dumping.
Matthew Dillon [Sat, 5 Jul 2008 23:59:38 +0000 (23:59 +0000)]
Error out if no volumes are specified instead of core-dumping.

Submitted-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
15 years agoHAMMER 60D/Many: Mirroring, bug fixes
Matthew Dillon [Sat, 5 Jul 2008 18:59:28 +0000 (18:59 +0000)]
HAMMER 60D/Many: Mirroring, bug fixes

* Add more mirroring infrastructure.

* Fix support for unix domain sockets.

Reported-by: Gergo Szakal <bastyaelvtars@gmail.com>,
     Rumko <rumcic@gmail.com>

15 years agoIf boot verbose, print asicrev, chiprev and bus type.
Sepherosa Ziehau [Sat, 5 Jul 2008 13:37:17 +0000 (13:37 +0000)]
If boot verbose, print asicrev, chiprev and bus type.

15 years ago- Add delay in MII registers reading
Sepherosa Ziehau [Sat, 5 Jul 2008 12:22:37 +0000 (12:22 +0000)]
- Add delay in MII registers reading
- Minor style changes

15 years agoUse hardware timer to simulate interrupt moderation.
Sepherosa Ziehau [Sat, 5 Jul 2008 07:29:44 +0000 (07:29 +0000)]
Use hardware timer to simulate interrupt moderation.

hw.nfeX.imtimer -> 0  no interrupt moderation at all.
hw.nfeX.imtimer -> -Y hardware timer simulated interrupt moderation,
                      the simultated interrupt moderation timer will
                      be set to Y.
hw.nfeX.imtimer -> Y  hardware timer only interrupt moderation,
                      hardware timer will be set to Y.

Set hw.nfeX.imtimer to -125 (8000Hz) should work on most system.

With heavier interrupt moderation (e.g. hw.nfeX.imtimer to -250), it is
recommended to increase hw.nfe.rx_ring_count tunable to a higher value
(e.g. 512), since the default value (128) is obviously too small.

15 years agoSplit hardware capabilities and softc flags
Sepherosa Ziehau [Sat, 5 Jul 2008 05:34:31 +0000 (05:34 +0000)]
Split hardware capabilities and softc flags

15 years agoFirst step to split hardware capabilities and softc flags
Sepherosa Ziehau [Sat, 5 Jul 2008 05:16:54 +0000 (05:16 +0000)]
First step to split hardware capabilities and softc flags

15 years agoNuke unused field
Sepherosa Ziehau [Sat, 5 Jul 2008 05:02:42 +0000 (05:02 +0000)]
Nuke unused field

15 years agoHAMMER 60C/many: Mirroring
Matthew Dillon [Fri, 4 Jul 2008 07:25:36 +0000 (07:25 +0000)]
HAMMER 60C/many: Mirroring

* Clean up the B-Tree mirror_tid update code, rewiring it a bit
  to reduce code pollution.

* Properly detect the mirroring mode (master, slave, or no-mirror mode)
  via the pfs configuration.

15 years agoHAMMER Utilities: Stabilization
Matthew Dillon [Fri, 4 Jul 2008 07:20:43 +0000 (07:20 +0000)]
HAMMER Utilities: Stabilization

* Fix a bug in mirror-copy that was causing extra process forks to occur.

15 years agoRegenerate the pciconf(8) database from the following files:
Sascha Wildner [Thu, 3 Jul 2008 10:42:37 +0000 (10:42 +0000)]
Regenerate the pciconf(8) database from the following files:

Hart:    Jan 22, 2008 (version 671)
Boemler: Jul  1, 2008
Mares:   Jul  1, 2008

15 years agoMake ip_forward public, so that it can be used from other places as well.
Simon Schubert [Thu, 3 Jul 2008 08:22:36 +0000 (08:22 +0000)]
Make ip_forward public, so that it can be used from other places as well.

Ok'ed:  sephe@

15 years agoHAMMER Utilities: Sync with recent work.
Matthew Dillon [Thu, 3 Jul 2008 06:36:27 +0000 (06:36 +0000)]
HAMMER Utilities: Sync with recent work.

* The masterid and slave options are now pseudo-fs options and not general
  mount options.

15 years agoHAMMER 60B/many: Stabilization
Matthew Dillon [Thu, 3 Jul 2008 04:24:51 +0000 (04:24 +0000)]
HAMMER 60B/many: Stabilization

* Redo the estimated space usage calculation, it was horribly broken.
  There may still be issues with read+write memory maps.

* Fix a bug in the reblocker that allowed it to exhaust all available
  space on the media.  While the reblocker eventually compacts the media
  it can actually require additional disk space while running.

Note that file deletions in normal history retention mode do not recover
any space unless followed by pruning, and may even require additional space.
If worse comes to worse a full filesystem might have to be remounted in
nohistory mode to recover space.

Reported-by: Gergo Szakal <bastyaelvtars@gmail.com>
15 years agoHAMMER Utilities: Mirroring and pseudo-fs directives
Matthew Dillon [Wed, 2 Jul 2008 22:05:59 +0000 (22:05 +0000)]
HAMMER Utilities: Mirroring and pseudo-fs directives

* Add mirror-read, mirror-write, and mirror-copy.

* Replace the pseudofs directive with pfs-status, pfs-create, and pfs-update.

  Create a pseudofs configuration infrastructure.  Configuration parameters
  can be specified via pfs-create and pfs-update for any HAMMER filesystem or
  HAMMER pseudo-filesystem.  This is basically how you tell HAMMER that
  a particular pfs is a master or slave, and allows both a unique and a shared
  uuid to be associated with the pfs.  The mirroring code will only mirror
  to targets with the same shared uuid as the master sourcing the data.

15 years agoHAMMER 60A/many: Mirroring work
Matthew Dillon [Wed, 2 Jul 2008 21:57:54 +0000 (21:57 +0000)]
HAMMER 60A/many: Mirroring work

* Add a pseudo-fs structure for tracking pseudo-fs configurations.

* Add pseudo-fs status and configuration ioctls

* Fix a b-tree node deletion race that could result in an
  assertion (reported by Rumko <rumcic@gmail.com>)

15 years agoDon't try to run newaliases at all. This happens anyways on boot.
Simon Schubert [Wed, 2 Jul 2008 05:40:43 +0000 (05:40 +0000)]
Don't try to run newaliases at all.  This happens anyways on boot.

15 years agoHAMMER 59J/Many: Features
Matthew Dillon [Tue, 1 Jul 2008 17:30:42 +0000 (17:30 +0000)]
HAMMER 59J/Many: Features

* The pruning code now disposes of any disconnected inodes it encounters.
  A disconnected inode can be created when a process holds an open
  descriptor on an unlink()'d file, and the machine then crashes.

15 years agoHAMMER 59I/Many: Stabilization pass
Matthew Dillon [Tue, 1 Jul 2008 16:48:51 +0000 (16:48 +0000)]
HAMMER 59I/Many: Stabilization pass

* Move calls to hammer_flusher_clean_loose_ios() to handle more cases.
  This fixes a kmalloc memory blowout that can occur when removing
  a 1.6TB file.

15 years agoFix [gs]etsockopt(IP_HDRINCL) which allows mere mortals like me to obtain
Hasso Tepper [Tue, 1 Jul 2008 08:21:25 +0000 (08:21 +0000)]
Fix [gs]etsockopt(IP_HDRINCL) which allows mere mortals like me to obtain
IP addresses via DHCP again.

15 years agoHAMMER 59H/Many: Stabilization pass
Matthew Dillon [Tue, 1 Jul 2008 04:54:25 +0000 (04:54 +0000)]
HAMMER 59H/Many: Stabilization pass

* Fix a bug introduced in 59G that will corrupt the filesystem when it
  becomes full.  A pointer was not being NULL'd out and caused
  hammer_blockmap_reserve() to return a bogus offset when the loop
  could find no free space.

15 years agoHAMMER 59G/Many: Stabilization pass (low memory issues)
Matthew Dillon [Tue, 1 Jul 2008 02:08:58 +0000 (02:08 +0000)]
HAMMER 59G/Many: Stabilization pass (low memory issues)

Make adjustments in an attempt to remove deadlocks from the pageout and
buffer flushing paths when a system is low on memory.

* Restructure the low level storage allocator to use layer2->append_off
  and to move the blockmap lock deeper into the routine, pass the buffer
  ops.

* Do kmalloc()'s of critical structures accessed by the backend with
  M_USE_RESERVE.

* Have hammer_vop_write() call bwillwrite() unconditionally, even if
  called from the pageout daemon.  Do not release or relock the vnode
  at all.

  Theoretically bwillwrite() in the pageout path should still allow
  strategy calls from the buf_daemon threads to proceed, and not deadlock.

Reported-by: Gergo Szakal <bastyaelvtars@gmail.com>
15 years agoFix numerous pageout daemon -> buffer cache deadlocks in the main system.
Matthew Dillon [Tue, 1 Jul 2008 02:02:56 +0000 (02:02 +0000)]
Fix numerous pageout daemon -> buffer cache deadlocks in the main system.
These issues usually only occur on systems with small amounts of ram
but it is possible to trigger them on any system.

* Get rid of the IO_NOBWILL hack.  Just have the VN device use IO_DIRECT,
  which will clean out the buffer on completion of the write.

* Add a timeout argument to vm_wait().

* Add a thread->td_flags flag called TDF_SYSTHREAD.  kmalloc()'s made
  from designated threads are allowed to dip into the system reserve
  when allocating pages.  Only the pageout daemon and buf_daemon[_hw] use
  the flag.

* Add a new static procedure, recoverbufpages(), which explicitly tries to
  free buffers and their backing pages on the clean queue.

* Add a new static procedure, bio_page_alloc(), to do all the nasty work
  of allocating a page on behalf of a buffer cache buffer.

  This function will call vm_page_alloc() with VM_ALLOC_SYSTEM to allow
  it to dip into the system reserve.  If the allocation fails this
  function will call recoverbufpages() to try to recycle from VM pages
  from clean buffer cache buffers, and will then attempt to reallocate
  using VM_ALLOC_SYSTEM | VM_ALLOC_INTERRUPT to allow it to dip into
  the interrupt reserve as well.

  Warnings will blare on the console.  If the effort still fails we
  sleep for 1/20 of a second and retry.  The idea though is for all
  the effort above to not result in a failure at the end.

Reported-by: Gergo Szakal <bastyaelvtars@gmail.com>
15 years agoWe are using 4.1.2 really.
Hasso Tepper [Mon, 30 Jun 2008 19:04:49 +0000 (19:04 +0000)]
We are using 4.1.2 really.

15 years agoBuild objc support.
Hasso Tepper [Mon, 30 Jun 2008 12:16:03 +0000 (12:16 +0000)]
Build objc support.

15 years agoMerge from vendor branch GCC:
Hasso Tepper [Mon, 30 Jun 2008 11:22:39 +0000 (11:22 +0000)]
Merge from vendor branch GCC:
Add objc to the gcc-4.1.2.

15 years agoAdd objc to the gcc-4.1.2.
Hasso Tepper [Mon, 30 Jun 2008 11:22:39 +0000 (11:22 +0000)]
Add objc to the gcc-4.1.2.

15 years agoHAMMER 59F/Many: Stabilization pass
Matthew Dillon [Mon, 30 Jun 2008 04:18:30 +0000 (04:18 +0000)]
HAMMER 59F/Many: Stabilization pass

* Use kmalloc_limit() to calculate a better record limit.  This fixes an
  issue on machines with limited system memory where HAMMER could blow
  out its kmalloc pool by allocating too many records.

15 years agoFix a low-memory deadlock in the VM system which can occur on systems
Matthew Dillon [Mon, 30 Jun 2008 03:57:41 +0000 (03:57 +0000)]
Fix a low-memory deadlock in the VM system which can occur on systems
with small amounts of system memory.  The pageout daemon uses LK_TIMELOCK
to avoid deadlocking on a vnode so it can continue operation.  This only
works if lk_timo is non-zero, but all filesystems initialize their vnodes
with a timeout of zero so the feature is defeated.  Adjust allocvnode()
to guarantee that lk_timo is never zero.

15 years agoAdd a new helper function, kmalloc_limit(). This function returns
Matthew Dillon [Mon, 30 Jun 2008 03:00:36 +0000 (03:00 +0000)]
Add a new helper function, kmalloc_limit().  This function returns
the number of bytes that can be held in a M_XXX kernel memory pool.

15 years agoHAMMER 59E/Many: Stabilization pass
Matthew Dillon [Mon, 30 Jun 2008 02:45:30 +0000 (02:45 +0000)]
HAMMER 59E/Many: Stabilization pass

* Sprinkle around calls to hammer_flusher_clean_loose_ios() to clean up
  hammer buffers with no buffer cache buffer associations, so they can't
  build up and blow out kernel memory.

* Fix a bug when deleting large files where not all records were being
  properly moved to the new flush group.

* Fix a bug when truncating large files where a trunction followed by
  write()s followed by another truncation would incorrectly reorder the
  writes() in the middle to occur after the second truncation.

15 years agoFix a buf_daemon performance issue when running on machines with small
Matthew Dillon [Mon, 30 Jun 2008 02:11:53 +0000 (02:11 +0000)]
Fix a buf_daemon performance issue when running on machines with small
amounts of ram.  The daemon was hitting a 1/2 sleep case that it should
not have been hitting.

15 years agoHAMMER 59D/Many: Stabilization pass
Matthew Dillon [Mon, 30 Jun 2008 00:03:55 +0000 (00:03 +0000)]
HAMMER 59D/Many: Stabilization pass

* Fix a panic that occurs when the crash recovery undo space is larger
  then conveniently fits in the buffer cache.

* Fix a bug in the truncation code (detected by fsx).  The bug was related
  to moving an inode from one flush group to another (which itself was done
  to fix a bug related to blowing out the buffer cache).

15 years agoClarify comment.
Simon Schubert [Sun, 29 Jun 2008 22:22:17 +0000 (22:22 +0000)]
Clarify comment.

15 years agoFix a NULL pointer dereference when a DDB 'ps' attempts to
Matthew Dillon [Sun, 29 Jun 2008 21:38:21 +0000 (21:38 +0000)]
Fix a NULL pointer dereference when a DDB 'ps' attempts to
list a process which has no LWPs associated with it.

15 years agoFix typo in sln(4) PCI ID.
Sascha Wildner [Sun, 29 Jun 2008 20:45:44 +0000 (20:45 +0000)]
Fix typo in sln(4) PCI ID.

15 years agoRegenerate
Sascha Wildner [Sun, 29 Jun 2008 20:43:49 +0000 (20:43 +0000)]
Regenerate

15 years agoFix typo in sln(4) PCI ID.
Sascha Wildner [Sun, 29 Jun 2008 20:33:57 +0000 (20:33 +0000)]
Fix typo in sln(4) PCI ID.

15 years agoFix an issue where CAM would attempt to illegally get a lockmgr() lock
Matthew Dillon [Sun, 29 Jun 2008 19:15:34 +0000 (19:15 +0000)]
Fix an issue where CAM would attempt to illegally get a lockmgr() lock
from an interrupt via xpt_done().  Use a spin lock instead.

Fix an issue where camisr_runqueue() was not protecting sim->sim_doneq
which could then race against an interrupt via xpt_done() and corrupt
the list.

15 years agoAdjust comments.
Matthew Dillon [Sun, 29 Jun 2008 19:04:02 +0000 (19:04 +0000)]
Adjust comments.

Reported-by: Jordan Gordeev <jgordeev@dir.bg>
15 years agoClean up stale comment and unused umount.
Simon Schubert [Sun, 29 Jun 2008 10:34:04 +0000 (10:34 +0000)]
Clean up stale comment and unused umount.

Noticed-by: swildner@
15 years agoDon't run binaries in the new built root, but use host binaries instead.
Simon Schubert [Sun, 29 Jun 2008 10:23:23 +0000 (10:23 +0000)]
Don't run binaries in the new built root, but use host binaries instead.

This allows us to do cross-builds (older host kernel) again, which was
broken for some time now.

The mkfontdir command was not changed yet, but this is no regression.

15 years agoHAMMER 59E/Many: Stabilization pass - fixes for large file issues
Matthew Dillon [Sun, 29 Jun 2008 07:50:40 +0000 (07:50 +0000)]
HAMMER 59E/Many: Stabilization pass - fixes for large file issues

* Correct a bug related to inodes moving between flush groups (when
  truncating a large file).  Some records were not being moved and
  cause an assertion later on.

* Fix a leak of B_LOCKED buffers which could occur under heavy loads.
  Eventually enough build up to deadlock the buffer cache.

15 years agoHAMMER 59D/Many: Sync with buffer cache changes in HEAD.
Matthew Dillon [Sat, 28 Jun 2008 23:50:37 +0000 (23:50 +0000)]
HAMMER 59D/Many: Sync with buffer cache changes in HEAD.

* Adjust hammer to limit dirty meta-data buffers based on total bytes
  rather then total buffers.

* Limit to 1/4 the buffer cache limit (for now)... a better solution
  is needed.

15 years agoFix hopefully all possible deadlocks that can occur when mixed block sizes
Matthew Dillon [Sat, 28 Jun 2008 23:45:20 +0000 (23:45 +0000)]
Fix hopefully all possible deadlocks that can occur when mixed block sizes
are used with the buffer cache.  The fix is simply to base the limiting
and flushing code on a byte count rather then a buffer count.

This will allow UFS to utilizes a greater number of dirty buffers and
will cause HAMMER to use fewer.  This also makes tuning the buffer cache
a whole lot easier.

15 years agoHAMMER 59C/Many: Stabilization pass - fixes for large file issues
Matthew Dillon [Sat, 28 Jun 2008 18:10:55 +0000 (18:10 +0000)]
HAMMER 59C/Many: Stabilization pass - fixes for large file issues

* Rename hammer_delete_range_all() to hammer_delete_clean().  This function
  is no longer responsible for deleting data and db records when a file
  is removed.  The normal hammer_delete_range() function now does that for
  all cases.

* Adjust hammer_delete_range() to not restart at offset 0 when it hits a
  deadlock or must defer the remainder of the operation to another flush
  cycle.  When removing very large files (greater then 500GB) the constant
  restarts resulted in exponential delays.

  Instead the function restarts near where it had left off the previous try.

* Change ip->sync_trunc_off's dynamics so it can be used to cache the
  restart offset.  The truncation state can now be left intact on the
  backend and the frontend will merge new truncations into it instead
  of replacing the truncation.

  Add a new field, ip->save_trunc_off to handle the append overwrite
  check optimization (sync_trunc_off used to be used for that, no longer).

* Fix minor bugs, and use the new bwillwrite() API.

* Remove the #if 0'd out cluster_write() code entirely (it never worked
  anyway).  The new buffer cache subsystem in the kernel allows bdwrite()
  to be used with no real penalty.

15 years agoReplace the bwillwrite() subsystem to make it more fair to processes.
Matthew Dillon [Sat, 28 Jun 2008 17:59:51 +0000 (17:59 +0000)]
Replace the bwillwrite() subsystem to make it more fair to processes.

* Add new API functions, bwillread(), bwillwrite(), bwillinode() which
  the kernel calls when it intends to read, write, or make inode
  modifications.

* Redo the backend.  Add bd_heatup() and bd_wait().  bd_heatup() heats up
  the buf_daemon, starting it flushing before we hit any blocking conditions
  (similar to the previous algorith).

* The new bwill*() blocking functions no longer introduce escalating delays
  to keep the number of dirty buffers under control.  Instead it takes a page
  from HAMMER and estimates the load caused by the caller, then waits for a
  specific number of dirty buffers to complete their write I/O's before
  returning.  If the buffers can be retired quickly these functions will
  return more quickly.

15 years agoRemove extra '.'
Sascha Wildner [Sat, 28 Jun 2008 14:51:50 +0000 (14:51 +0000)]
Remove extra '.'

15 years ago* Use literal displays instead of .Li
Sascha Wildner [Sat, 28 Jun 2008 14:48:50 +0000 (14:48 +0000)]
* Use literal displays instead of .Li

* Comment out empty section

* Sync SYNOPSIS

* Use .Pa for paths, .Xr for manual page references and .Ex for exit status

15 years ago* Remove empty lines and trailing whitespace.
Sascha Wildner [Sat, 28 Jun 2008 14:23:59 +0000 (14:23 +0000)]
* Remove empty lines and trailing whitespace.

* Bump date for r1.26.

15 years agostyle(9)
Sascha Wildner [Sat, 28 Jun 2008 14:18:00 +0000 (14:18 +0000)]
style(9)

15 years agoBump the sortq_lost check from 8 to 128, letting the disk optimally read or
Matthew Dillon [Sat, 28 Jun 2008 01:41:32 +0000 (01:41 +0000)]
Bump the sortq_lost check from 8 to 128, letting the disk optimally read or
write a larger swath before forcing through long-delayed requests.

15 years agoFix a system performance issue created by ata_sort_queue(). This function
Matthew Dillon [Sat, 28 Jun 2008 01:06:40 +0000 (01:06 +0000)]
Fix a system performance issue created by ata_sort_queue().  This function
implements an elevator sort but it also allows requests to be delayed
indefinitely when other requests continually get inserted in front of them.
HAMMER's almost log-linear writing really exposes this issue.

The fix is to count how many times a request got delayed due to an insertion.
If the count exceeds 8, the new request is placed at the end of the queue and
set as the new freeze point.

15 years agoHAMMER 59B/Many: Stabilization pass - fixes for large file issues
Matthew Dillon [Fri, 27 Jun 2008 20:56:59 +0000 (20:56 +0000)]
HAMMER 59B/Many: Stabilization pass - fixes for large file issues

* The flusher was trying to flush whole inodes in one pass.  If a large
  (in the 100GB range) file is deleted or truncated this single pass could
  blow out the UNDO FIFO and cause a panic.

  Detect the case and only do a partial flush, then requeue the inode to
  the next flush group and reflush.  This continues until the file is
  completely eradicated or the truncation has completed.

* In addition, the same flusher issue could exhaust the kernel's buffer
  cache with unflushable dirty buffers.  The same fix applies.

* The UNDO FIFO code was calculating available space based on the next
  flush's start position instead of the last flush's start position,
  allowing areas of the UNDO FIFO still subject to a recovery pass
  (if a crash were to occur right then) to be overwritten too soon.

* The pruner and reblocker were doing insufficient UNDO FIFO space checks
  and could blow out the UNDO FIFO.  Fixed.

15 years agoRework stop path.
Sepherosa Ziehau [Fri, 27 Jun 2008 17:03:40 +0000 (17:03 +0000)]
Rework stop path.

Obtained-from: forcedeth

15 years ago- Rename NFE_RXTX_V[32]MAGIC to NFE_RXTX_DESC_V[32].
Sepherosa Ziehau [Fri, 27 Jun 2008 16:30:53 +0000 (16:30 +0000)]
- Rename NFE_RXTX_V[32]MAGIC to NFE_RXTX_DESC_V[32].
- Change NFE_RXTX_DESC_V3 from 0x2200 to 0xc02200; it is quite interesting
  the thing actually worked.
- Add rxtxctl_desc in softc, which stores the desc type of rxtxctl.  Set
  it up during attach.
- Add power control fixes on attach and init path.

Obtained-from: forcedeth

15 years agoFix a typo so that old netgraph builds again.
Sascha Wildner [Fri, 27 Jun 2008 14:02:14 +0000 (14:02 +0000)]
Fix a typo so that old netgraph builds again.

15 years ago- Disable WOL during attach, don't mess with it during init
Sepherosa Ziehau [Fri, 27 Jun 2008 13:47:36 +0000 (13:47 +0000)]
- Disable WOL during attach, don't mess with it during init
- NFE_WOL_MAGIC -> NFE_WOL_ENABLE

Obtained-from: forthdeth

15 years agoAdd flag to indicate that the NIC does not have power control capability.
Sepherosa Ziehau [Fri, 27 Jun 2008 13:30:56 +0000 (13:30 +0000)]
Add flag to indicate that the NIC does not have power control capability.
Model numbers from forcedeth.

15 years agoAdd nfe(4)
Sepherosa Ziehau [Fri, 27 Jun 2008 12:49:34 +0000 (12:49 +0000)]
Add nfe(4)

Suggested-by: Chris Turner <c.turner@199technologies.org>