dragonfly.git
14 years agodevfs - Add new make_dev_covering
Alex Hornung [Fri, 11 Sep 2009 06:10:09 +0000 (07:10 +0100)]
devfs - Add new make_dev_covering

* Add a new make_dev_covering which is used by systems such as the disk
  subsystem, that make_dev for an underlying device.

14 years agokgdb - Add -D_KERNEL_STRUCTURES to access kernel structures properly.
Matthew Dillon [Fri, 11 Sep 2009 05:54:06 +0000 (22:54 -0700)]
kgdb - Add -D_KERNEL_STRUCTURES to access kernel structures properly.

Reported-by: Stathis Kamperis
14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 11 Sep 2009 02:16:49 +0000 (19:16 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoKERNEL - Implement a poor man's ioscheduler using sys/iosched.h
Matthew Dillon [Fri, 11 Sep 2009 02:12:08 +0000 (19:12 -0700)]
KERNEL - Implement a poor man's ioscheduler using sys/iosched.h

* Move struct iosched_data from the LWP to the TD.

* Expand bd_wait()'s wakeup array from 128 entries to 16384 entries
  to cover a larger portion of the buffer cache's dirty space.

* bwillwrite() now adds to iosched_data->iowbytes and the ticks
  global is used to decay it.

  Total iowbytes is kept in per-cpu structures.  Each cpu does not
  necessarily match the threads assigned to it, but in aggregate
  the sum of iowbytes for all cpus will match the sum of iowbytes
  for all threads in the system.

* bwillwrite() now calculates a relative I/O write load for each thread
  in the system and passes a fractional calculation to bd_wait().

  This causes processes with low I/O loads to have a higher priority
  (as in, NOT stall in bd_wait() anywhere near as long), and processes
  with high I/O loads to have a lower priority (stall longer in bd_wait()),
  when the buffer cache is saturated with dirty data.

14 years agoHAMMER - Try to improve backend stalls due to heavy write activity.
Matthew Dillon [Fri, 11 Sep 2009 02:05:00 +0000 (19:05 -0700)]
HAMMER - Try to improve backend stalls due to heavy write activity.

* Call hammer_inode_waitreclaims() instead of hammer_inode_waithard(),
  and disable hammer_inode_waithard().

  hammer_inode_waithard() waits for an entire flush cycle but can get
  called by fairly innocuous VNOPS, causing a large number of processes
  to stall for no good reason.

* Change hammer_inode_waitreclaims() to wait for only one reclaim to occur
  before returning, instead of 2.

14 years agoIPV6 - Attempt to fix tcp46 compatibility listen sockets
Matthew Dillon [Thu, 10 Sep 2009 04:52:01 +0000 (21:52 -0700)]
IPV6 - Attempt to fix tcp46 compatibility listen sockets

* When creating the accepted socket via the syncache, if the
  listen socket is INET6 but allows compatibility connections
  the inp created via sonewconn() will probably set IN6P_IPV6_V6ONLY.

  This flag must be cleared if the incoming connection is
  actually IPV4, otherwise tcp6_soport() will not properly
  fall through to tcp_soport().

* NOTE: Even though the connection is IPV4 the socket's protocol
  is copied from the listen socket which is INET6.  This seems
  to work ok but it isn't ideal.

* When connecting make sure that IPV6 connections use cpu 0 for
  now (we don't have a proper hash for IPV6 addresses yet).

Reported-by: corecode
14 years agogcc44/gmp: fix last commit
Simon Schubert [Wed, 9 Sep 2009 19:25:55 +0000 (21:25 +0200)]
gcc44/gmp: fix last commit

14 years agoKernel - Enable the TCP inflight limiter by default, but with generous values.
Matthew Dillon [Wed, 9 Sep 2009 16:34:13 +0000 (09:34 -0700)]
Kernel - Enable the TCP inflight limiter by default, but with generous values.

The inflight limiter is now turned on by default, but with generous values
which should allow maximal bandwidth.  In particular, the slop defaults to
50 (5 packets), meaning that the TCP connection will allow up to N+5 packets
in-flight instead of just N, where N is the number of packets calculated
for the bandwidth-delay product of the connection.

The reason for doing this is that the limiter is the only mechanism we
have which seems to do a really good job preventing receiver RX rings
on network interfaces from getting blown out.  Even though GigE/10GigE
is supposed to flow control it looks like either it doesn't actually
do it or Open Source drivers do not properly enable it.  Large packet
bursts appear to be able to blow out the receiver's rx ring.

People using the limiter to reduce bottlenecks on slower WAN connections
should set the slop to 20 (2 packets).

14 years agoMBUF - Do not limit an objcache common pool to 10 magazines.
Matthew Dillon [Wed, 9 Sep 2009 16:17:57 +0000 (09:17 -0700)]
MBUF - Do not limit an objcache common pool to 10 magazines.

* An objcache's common magazine pool was limited to 10 in order to return
  memory to the system sooner rather then later.

  This created a situation with the mbuf allocator where high-rate
  mbuf producers (GigE, 10GigE) would sometimes not be able to allocate
  a large enough batch of mbufs and drop packets.  10 magazines x 64 is
  only 640 mbufs.

* Increase the limit from 10 to 1000.

Tested-with: 10GigE setup from Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>

14 years agoMBUF - Account for failed allocations so netstat -m reports properly.
Matthew Dillon [Wed, 9 Sep 2009 16:17:18 +0000 (09:17 -0700)]
MBUF - Account for failed allocations so netstat -m reports properly.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 9 Sep 2009 16:13:22 +0000 (09:13 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoNFE - Change default RX ring size from 128 -> 256, Adjust moderation timer.
Matthew Dillon [Wed, 9 Sep 2009 16:10:58 +0000 (09:10 -0700)]
NFE - Change default RX ring size from 128 -> 256, Adjust moderation timer.

* NFE does not seem to be able to flow control the phy.  TCP reception
  using window scaling and large socket bufs can blow out the receiver ring
  before the interrupt has a chance to drain it.

  This results in the receiver dropping a packet and the transmitter
  seeing bursts of duplicate TCP acks and having to go into recovery.

* Shorten the moderation timer from 500uS to 250uS, increasing its
  frequency from 2000Hz to 4000Hz.  Note that the moderation timer
  only kicks in when the discrete interrupt rate exceeds the frequency.

* The problem still occurs with the larger RX ring and shorter moderation
  timer, but not nearly as often.

14 years agogcc44/gmp: make directories before populating them
Simon Schubert [Wed, 9 Sep 2009 15:23:39 +0000 (17:23 +0200)]
gcc44/gmp: make directories before populating them

The snapshot build seems to have uncovered a race in the depend stage.
This is a tentative, unverified fix.

14 years agoRevert "Move isonum_ declaration to iso.h"
Alexander Polakov [Wed, 9 Sep 2009 09:43:08 +0000 (13:43 +0400)]
Revert "Move isonum_ declaration to iso.h"

This reverts commit f5ff88dca23b1b8f4b9287fb7c59959eb976a808. It
broke sysutils/hal and maybe something else.

Requested-by: Hasso Tepper
14 years agonfs: fix real/effective id mismatch in nfs_access
Nicolas Thery [Wed, 9 Sep 2009 07:39:02 +0000 (09:39 +0200)]
nfs: fix real/effective id mismatch in nfs_access

When access(2) or faccessat(2) without AT_EACCESS are called on
NFS file, use real uid/gid.

When faccessat(2) with AT_EACCESS set is called on NFS file, use
effective uid/gid.

14 years agopowernow - only build for i386, BIOS macros currently broken for 64-bit.
Matthew Dillon [Wed, 9 Sep 2009 04:03:05 +0000 (21:03 -0700)]
powernow - only build for i386, BIOS macros currently broken for 64-bit.

14 years agoUSB - Reintroduce OHCI fixes without the larger polling infrastructure fixes
Matthew Dillon [Tue, 8 Sep 2009 23:52:33 +0000 (16:52 -0700)]
USB - Reintroduce OHCI fixes without the larger polling infrastructure fixes

* Fix the OHCI interrupt livelock issue.

* Don't fix races with turning polling on and off yet as there appear
  to be other issues with OHCI that break whene we do.

14 years agoNFS - Fix panic if the readdir base offset is beyond the directory EOF
Matthew Dillon [Tue, 8 Sep 2009 21:31:20 +0000 (14:31 -0700)]
NFS - Fix panic if the readdir base offset is beyond the directory EOF

* A calculation could cause an signed underflow into unsigned if
  the base offset in a getdirentries call exceeds the directory
  EOF offset.

14 years agoSILI - Merge Alex's ATA pass-through ioctls from AHCI driver into SILI driver.
Matthew Dillon [Tue, 8 Sep 2009 21:00:11 +0000 (14:00 -0700)]
SILI - Merge Alex's ATA pass-through ioctls from AHCI driver into SILI driver.

* Basically an exact copy from the AHCI code.

14 years agoahci(4) - Add support for ATA passthrough
Alex Hornung [Tue, 8 Sep 2009 07:48:30 +0000 (08:48 +0100)]
ahci(4) - Add support for ATA passthrough

* Add support for ATA_PASS_{12,16} cam commands to pass through
  an ATA command directly to the device.
  Incidentally, this will make smartmontools work again when used
  with device type 'sat'.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1412
Reported-By: Hasso Tepper
14 years agoiscontrol.8: A little cleanup.
Sascha Wildner [Tue, 8 Sep 2009 16:39:51 +0000 (18:39 +0200)]
iscontrol.8: A little cleanup.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 8 Sep 2009 18:36:25 +0000 (11:36 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoPIPE - Fix a panic introduced by the last commit.
Matthew Dillon [Tue, 8 Sep 2009 18:28:14 +0000 (11:28 -0700)]
PIPE - Fix a panic introduced by the last commit.

* Forgot to release a token on the Re-tests.

Reported-by: Tobias Weingartner <weingart@tepid.org>
14 years agopowernow: AMD K8 frequency control.
Alexander Polakov [Tue, 8 Sep 2009 18:15:36 +0000 (22:15 +0400)]
powernow: AMD K8 frequency control.

14 years agoISCSI - Minor module handling
Antonio Huete [Fri, 4 Sep 2009 22:18:21 +0000 (00:18 +0200)]
ISCSI - Minor module handling

  - Rename iscsi module name to iscsi_initiator
  - iscontrol now loads automatically iscsi_initiator module

14 years agoSync zoneinfo database with tzdata2009m from elsie.
Sascha Wildner [Tue, 8 Sep 2009 14:19:30 +0000 (16:19 +0200)]
Sync zoneinfo database with tzdata2009m from elsie.

asia:           8.36 -> 8.40
australasia:    8.12 -> 8.13

* Palestine will go back to winter time on Sep 4, 2009.

* Samoa will start DST on Oct 4, 2009 and end on Mar 28, 2010.

14 years agocd9660_util.c: fix a typo.
Alexander Polakov [Tue, 8 Sep 2009 13:11:10 +0000 (17:11 +0400)]
cd9660_util.c: fix a typo.

14 years agocd9660_util.c: ANSIfy, no functional changes.
Alexander Polakov [Tue, 8 Sep 2009 12:20:35 +0000 (16:20 +0400)]
cd9660_util.c: ANSIfy, no functional changes.

14 years agosound: mmap returns page number, not byte offset
Simon Schubert [Tue, 8 Sep 2009 11:58:28 +0000 (13:58 +0200)]
sound: mmap returns page number, not byte offset

Noticed-by: hasso@
14 years agomodules: remove KMODDEPS, it is not used anymore
Simon Schubert [Tue, 8 Sep 2009 10:29:04 +0000 (12:29 +0200)]
modules: remove KMODDEPS, it is not used anymore

14 years agomodules: add/correct module versions and depends
Simon Schubert [Tue, 8 Sep 2009 10:15:13 +0000 (12:15 +0200)]
modules: add/correct module versions and depends

14 years agosys/module.h: include sys/linker_set.h
Simon Schubert [Tue, 8 Sep 2009 10:13:49 +0000 (12:13 +0200)]
sys/module.h: include sys/linker_set.h

14 years agoig_hal: add module version
Simon Schubert [Tue, 8 Sep 2009 09:44:22 +0000 (11:44 +0200)]
ig_hal: add module version

14 years agoadd tools/chkmoddeps
Simon Schubert [Tue, 8 Sep 2009 09:40:17 +0000 (11:40 +0200)]
add tools/chkmoddeps

chkmoddeps is a tool to check for unsatisfied module dependencies.
invoke with pathnames to be searched for kernel and modules.

14 years agoRevert "usbd - Do not start moused by default when a usb mouse is connected"
Simon Schubert [Tue, 8 Sep 2009 06:59:46 +0000 (08:59 +0200)]
Revert "usbd - Do not start moused by default when a usb mouse is connected"

This reverts commit 409ca8073a5e4b42c5f75f3fa5d9be5cdab83c2e, as
discussed on the mailing lists.

14 years agoRevert "USB - Formalize polling mode and fix ohci interrupt storm"
Matthew Dillon [Tue, 8 Sep 2009 06:59:18 +0000 (23:59 -0700)]
Revert "USB - Formalize polling mode and fix ohci interrupt storm"

This reverts commit 727afe75ef752829158e906c5b86991478fece53.  It broke
too many things, so the OHCI storm will have to be fixed another way.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 8 Sep 2009 02:23:48 +0000 (19:23 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoRemove nearly all MP contention from ip_randomid()
Matthew Dillon [Tue, 8 Sep 2009 02:21:34 +0000 (19:21 -0700)]
Remove nearly all MP contention from ip_randomid()

* Instead of using two global spinlocks split the id space up into
  ncpus_fit independant sections and shuffle within each section.

* Aggregate the random number generation into blocks of 32, on a
  per-cpu basis, to reduce cpu contention there.

Using-test-output-by: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
14 years agoAdd the make_autoclone_dev(9) manual page.
Sascha Wildner [Mon, 7 Sep 2009 14:56:21 +0000 (16:56 +0200)]
Add the make_autoclone_dev(9) manual page.

Submitted-by: alexh
14 years agosio(4) - Fix double make_dev if used as console
Alex Hornung [Mon, 7 Sep 2009 11:34:45 +0000 (12:34 +0100)]
sio(4) - Fix double make_dev if used as console

* sio was calling another make_dev for ttyd0 if it was being used as
  console. This is no longer valid with devfs, so we look for the
  existing ttyd0, as it must exist already if the device has been
  attached.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1485
Reported-by: Hasso Tepper, Jordan Gordeev
14 years agoUSB - Formalize polling mode and fix ohci interrupt storm
Matthew Dillon [Mon, 7 Sep 2009 06:05:09 +0000 (23:05 -0700)]
USB - Formalize polling mode and fix ohci interrupt storm

* Formalize entering and leaving polling mode via usb_set_polling().

* Call bus->methods->do_poll() once when leaving polling mode to
  catch-up any lost interrupts.

* OHCI now acknowledges interrupts from the interrupt handler when
  it finds itself in polling mode to prevent the interrupt from
  storming.  The interrupts are recorded for later use.

14 years agoUSB - Preallocate umass buffers to avoid interrupt deadlock
Matthew Dillon [Mon, 7 Sep 2009 02:37:55 +0000 (19:37 -0700)]
USB - Preallocate umass buffers to avoid interrupt deadlock

* Try to avoid usb allocations made from the interrupt servicer.
  These can deadlock the interrupt handler and any other device
  sharing that irq as well as cause USB panics due to the broken
  critical section.

* This is only a temporary fix.  Another unaddressed issue is
  contigmalloc()'s inability to allocate large physically contiguous
  buffers after the machine has been up a while.

Reported-by: Rumko and multiple others over time
14 years agoUSB - Avoid unnecessary reprobes.
Matthew Dillon [Sun, 6 Sep 2009 21:53:51 +0000 (14:53 -0700)]
USB - Avoid unnecessary reprobes.

* Do not unconditionally setdiskinfo when a removable DA* device is
  opened.  It takes time for the kernel to reprobe the drive and this
  seriously messes up mountroot during kernel boot or attempts to
  access partitions in slices (instant open + access partition).

  If the size hasn't changed, do not call setdiskinfo again.

* This is a bad hack.  A better solution (detect actual device
  replacement) is needed.

14 years agoLINT: Mention KTR_CTXSW.
Sascha Wildner [Sun, 6 Sep 2009 18:19:21 +0000 (20:19 +0200)]
LINT: Mention KTR_CTXSW.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 5 Sep 2009 23:17:59 +0000 (16:17 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoMFS - Use mmap() instead of malloc().
Matthew Dillon [Sat, 5 Sep 2009 23:17:10 +0000 (16:17 -0700)]
MFS - Use mmap() instead of malloc().

* mmap does not have the dataspace limitations which malloc does, allowing
  us to create a much larger MFS filesystem.

14 years agosmbfs: use libiconv v.2
Alexander Polakov [Sat, 5 Sep 2009 21:25:00 +0000 (01:25 +0400)]
smbfs: use libiconv v.2

14 years agosys/conf/files: Remove duplicates.
Sascha Wildner [Sat, 5 Sep 2009 21:18:02 +0000 (23:18 +0200)]
sys/conf/files: Remove duplicates.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 5 Sep 2009 20:15:53 +0000 (13:15 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoPIPE - Fix more races in the pipe code
Matthew Dillon [Sat, 5 Sep 2009 20:12:49 +0000 (13:12 -0700)]
PIPE - Fix more races in the pipe code

* Numerous additional races can occur with the setting and clearing of
  PIPE_SEL.

* EOF must be retested after getting the second token lock because the
  acquisition of the second lock can temporarily release the first one.

Reported-by: Tobias Weingartner <weingart@tepid.org>, Rumko
14 years agonetbt: add MODULE_VERSION
Alexander Polakov [Sat, 5 Sep 2009 19:49:14 +0000 (23:49 +0400)]
netbt: add MODULE_VERSION

Reported-by: Rumko <rumcic@gmail.com>
DragonFly-bug: http://bugs.dragonflybsd.org/issue1487

14 years agoOops, revert the GENERIC part of f5ff88dca23b1b8f4b9287fb7c59959eb976a808
Alexander Polakov [Sat, 5 Sep 2009 17:55:29 +0000 (21:55 +0400)]
Oops, revert the GENERIC part of f5ff88dca23b1b8f4b9287fb7c59959eb976a808

14 years agomount_msdos: remove conversion tables.
Alexander Polakov [Sat, 5 Sep 2009 16:33:38 +0000 (20:33 +0400)]
mount_msdos: remove conversion tables.

14 years agomsdosfs: add MODULE_VERSION.
Alexander Polakov [Sat, 5 Sep 2009 10:53:43 +0000 (14:53 +0400)]
msdosfs: add MODULE_VERSION.

14 years agomissing type in iso.h
Alexander Polakov [Sat, 11 Jul 2009 04:27:42 +0000 (08:27 +0400)]
missing type in iso.h

14 years agocitrus: ooops, actually build utf1632.
Alexander Polakov [Fri, 4 Sep 2009 10:39:04 +0000 (14:39 +0400)]
citrus: ooops, actually build utf1632.

14 years agoMove isonum_ declaration to iso.h
Alexander Polakov [Fri, 10 Jul 2009 21:35:56 +0000 (01:35 +0400)]
Move isonum_ declaration to iso.h

14 years agolibiconv: we can now link mount_cd9660 and mount_msdos statically.
Alexander Polakov [Thu, 3 Sep 2009 22:21:41 +0000 (02:21 +0400)]
libiconv: we can now link mount_cd9660 and mount_msdos statically.

14 years agolibkiconv: make libkiconv work when statically linked.
Alexander Polakov [Thu, 3 Sep 2009 22:18:30 +0000 (02:18 +0400)]
libkiconv: make libkiconv work when statically linked.

14 years agocitrus: compile in UTF16/32 support for iconv.
Alexander Polakov [Thu, 3 Sep 2009 22:15:49 +0000 (02:15 +0400)]
citrus: compile in UTF16/32 support for iconv.

14 years agoConnect cd9660_iconv msdosfs_iconv to the build.
Alexander Polakov [Thu, 3 Sep 2009 22:14:15 +0000 (02:14 +0400)]
Connect cd9660_iconv msdosfs_iconv to the build.

14 years agolibiconv: change mount_cd9660 to use libkiconv.
Alexander Polakov [Tue, 7 Jul 2009 16:07:50 +0000 (20:07 +0400)]
libiconv: change mount_cd9660 to use libkiconv.

Add "-L locale" option like mount_msdos.

14 years agolibiconv: convert cd9660 to libiconv.
Alexander Polakov [Thu, 3 Sep 2009 21:09:33 +0000 (01:09 +0400)]
libiconv: convert cd9660 to libiconv.

14 years agolibiconv conversion: add libkiconv to the build, fix header path in mount_msdos.
Alexander Polakov [Fri, 5 Jun 2009 10:14:28 +0000 (14:14 +0400)]
libiconv conversion: add libkiconv to the build, fix header path in mount_msdos.

14 years agoStage 5/5: Change mount_msdos to use libkiconv
Alexander Polakov [Fri, 5 Jun 2009 08:29:46 +0000 (12:29 +0400)]
Stage 5/5: Change mount_msdos to use libkiconv

mount_msdos should be linked shared now, that's unusual for
/sbin.

14 years agoStage 4/5: Import libkiconv from FreeBSD.
Alexander Polakov [Fri, 5 Jun 2009 08:24:06 +0000 (12:24 +0400)]
Stage 4/5: Import libkiconv from FreeBSD.

libkiconv user space library is used by mount_msdos.

14 years agoStage 3/5: Add msdosfs_iconv.
Alexander Polakov [Fri, 5 Jun 2009 08:18:02 +0000 (12:18 +0400)]
Stage 3/5: Add msdosfs_iconv.

Contains actual code to do conversion.
It seems like unloading is broken. Should be fixed later.

14 years agoStage 2/5: Change msdosfs to use libiconv in case.
Alexander Polakov [Fri, 5 Jun 2009 08:10:38 +0000 (12:10 +0400)]
Stage 2/5: Change msdosfs to use libiconv in case.

Code mostly from FreeBSD, ported by me. Still works with old
userspace (if mounted without conversion).

14 years agolibiconv: Uncomment iconv_vfs_refcount.
Alexander Polakov [Fri, 5 Jun 2009 08:04:28 +0000 (12:04 +0400)]
libiconv: Uncomment iconv_vfs_refcount.

14 years agoStage 1/5: Update libiconv to support multibyte encodings.
Alexander Polakov [Fri, 5 Jun 2009 07:59:03 +0000 (11:59 +0400)]
Stage 1/5: Update libiconv to support multibyte encodings.

Code from FreeBSD, ported by Alexander Polakov, fixed by Simon
Schubert.

14 years agocitrus: iconv support for static binaries
Alexander Polakov [Thu, 3 Sep 2009 18:51:10 +0000 (22:51 +0400)]
citrus: iconv support for static binaries

Compile iconv into libc.a.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 5 Sep 2009 04:10:41 +0000 (21:10 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agosoopt_from_kbuf: Use szmin(), since both len and sopt_valsize is size_t
Sepherosa Ziehau [Sat, 5 Sep 2009 03:52:32 +0000 (11:52 +0800)]
soopt_from_kbuf: Use szmin(), since both len and sopt_valsize is size_t

Mainly to avoid integer truncation on 64bit platform.

Reminded-by: dillon@
14 years agosockopt: Short circuit most of the code in soopt_from_kbuf(), if len == 0
Sepherosa Ziehau [Sat, 5 Sep 2009 03:27:25 +0000 (11:27 +0800)]
sockopt: Short circuit most of the code in soopt_from_kbuf(), if len == 0

Current kva_p() does not work w/ zero sized kmalloced memory.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1481

14 years agoadd KTR_CTXSW option to log context switches
Aggelos Economopoulos [Sat, 5 Sep 2009 00:46:14 +0000 (03:46 +0300)]
add KTR_CTXSW option to log context switches

This logs the current thread and the thread we switch
to on every context switch or thread preemption event
when enabled.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 5 Sep 2009 01:04:40 +0000 (18:04 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agotop(1): Silence gcc warnings.
Stathis Kamperis [Fri, 4 Sep 2009 17:22:49 +0000 (20:22 +0300)]
top(1): Silence gcc warnings.

The ORDERKEY_XXX() macros build up a deeply nested set of if-statements.
E.g.,

if (expr)
   if (expr)
      if (expr)
        if (expr)

The last if-statement needs to contain nothing (every expression has
its own side effect, so the whole cascade is actually meaningful). Using
a ; though, makes gcc generate warnings regarding 'empty body in if
statements'. That's why we, instead, use:

ORDERKEY_FOO1
ORDERKEY_FOO2
...
ORDERKEY_FOO3
{}

We could have embedded the {} in the definition of the macro itself, but
that would break if someone rearranged the macros' call order.

Reviewed-by: dillon@
14 years agonrelease.7: /dev/da8 is the default IMGUSBDEV.
Sascha Wildner [Fri, 4 Sep 2009 20:32:37 +0000 (22:32 +0200)]
nrelease.7: /dev/da8 is the default IMGUSBDEV.

Reported-by: Johannes Hofmann
14 years agoAMD64 - Make machine/endian.h work properly when compiled -m32.
Matthew Dillon [Fri, 4 Sep 2009 03:56:40 +0000 (20:56 -0700)]
AMD64 - Make machine/endian.h work properly when compiled -m32.

* Fixes issues compiling sys/boot in a 64-bit native environment.

Reported-by: corecode
14 years agomodules: Kill debugging.
Matthew Dillon [Thu, 3 Sep 2009 23:53:50 +0000 (16:53 -0700)]
modules: Kill debugging.

Requested-by: corecode
14 years agomodules: correct dependencies / version declarations
Simon Schubert [Thu, 3 Sep 2009 22:47:11 +0000 (00:47 +0200)]
modules: correct dependencies / version declarations

14 years agotest/amd64: build and install modules
Simon Schubert [Thu, 3 Sep 2009 20:42:52 +0000 (22:42 +0200)]
test/amd64: build and install modules

also don't try to install gcc44 since we don't build it.

14 years agoloader: update elf module code from FreeBSD
Simon Schubert [Thu, 3 Sep 2009 21:59:53 +0000 (23:59 +0200)]
loader: update elf module code from FreeBSD

14 years agomodules: add elf_obj linker for amd64
Simon Schubert [Thu, 3 Sep 2009 21:58:17 +0000 (23:58 +0200)]
modules: add elf_obj linker for amd64

Obtained-from:  FreeBSD

14 years agomodules: pull in most of FreeBSD's module linker changes
Simon Schubert [Thu, 3 Sep 2009 23:17:18 +0000 (01:17 +0200)]
modules: pull in most of FreeBSD's module linker changes

The big user-visible difference is that the module dependency
system changed.  Module dependencies are now the same as for
the loader, and the hack linker (and Makefile) magic is not
needed anymore.

Obtained-from:  FreeBSD

14 years agomodules: disable dummy module declarations
Simon Schubert [Thu, 3 Sep 2009 20:45:30 +0000 (22:45 +0200)]
modules: disable dummy module declarations

dummy modules serve a questionable goal and conflict with the
module linker update.

14 years agomodules: drop a.out module support
Simon Schubert [Thu, 3 Sep 2009 20:29:02 +0000 (22:29 +0200)]
modules: drop a.out module support

14 years agoamd64: declare initializecpu outside of SMP
Simon Schubert [Thu, 3 Sep 2009 20:41:01 +0000 (22:41 +0200)]
amd64: declare initializecpu outside of SMP

initializecpu() is not a SMP-only function; we have to
always declare it.  smp.h is the wrong file, but I didn't
find any better location.

14 years agoacpi: restructure genwakecode.sh
Simon Schubert [Thu, 3 Sep 2009 20:34:03 +0000 (22:34 +0200)]
acpi: restructure genwakecode.sh

genwakecode.sh used some obscure hexdump/sed magic to embed a binary
into source.  The specific usage of sed breaks in at least the UTF-8
locale.  Rework the script to use hexdump and sed in a less obscure
way.

14 years agoHAMMER Util - hammer iostats now reports undo space used.
Matthew Dillon [Thu, 3 Sep 2009 20:37:20 +0000 (13:37 -0700)]
HAMMER Util - hammer iostats now reports undo space used.

14 years agoHAMMER - Add vfs.hammer.stats_undo
Matthew Dillon [Thu, 3 Sep 2009 20:36:32 +0000 (13:36 -0700)]
HAMMER - Add vfs.hammer.stats_undo

* Statistics on number of bytes of undo space written.

14 years agoCAM - Check DA media on open, basic suppor for removable DA media (vs CD).
Matthew Dillon [Thu, 3 Sep 2009 15:26:26 +0000 (08:26 -0700)]
CAM - Check DA media on open, basic suppor for removable DA media (vs CD).

* Install setdiskinfo on probe for DA if no media is present, similar to how
  the CD works.  This allows open() to function.

* Recheck media presence on open().

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 3 Sep 2009 15:25:26 +0000 (08:25 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoHAMMER - Fix lost inode issue (primarily with nohistory mounts)
Matthew Dillon [Thu, 3 Sep 2009 15:18:43 +0000 (08:18 -0700)]
HAMMER - Fix lost inode issue (primarily with nohistory mounts)

* When a HAMMER cursor is unlocked it becomes tracked and unrelated
  B-Tree operations will cause the tracked cursor's nodes and indices
  to be updated.  The cursor structure also has a leaf element pointer
  which was not being properly updated.  This could lead to panics and
  lost inodes.

  Properly adjust the leaf element pointer in tracked cursors.

* The bug primarily occurs with nohistory mounts or nohistory sub-trees
  due to the larger number of physical deletions made to the B-Tree, but
  could also occur (rarely) with normal mounts.

* Add additional assertions to catch any further occurrences (though I
  think all the cases have been covered now).

* Add a new sysctl vfs.hammer.error_panic which can be set to e.g. 9 to
  cause critical errors to panic immediately instead of returning
  through the call stack, making debugging possible.

Reported-by: Numerous people
14 years agosubr_disk - add debug info
Alex Hornung [Thu, 3 Sep 2009 13:18:25 +0000 (14:18 +0100)]
subr_disk - add debug info

* Add tunable and sysctl int kern.disk_debug which enables debug info
  in critical parts of subr_disk (probing, creating, unprobing,
  destroying).

14 years agoacpi_wakeup - Mark used vars with attribute used
Alex Hornung [Thu, 3 Sep 2009 07:57:34 +0000 (08:57 +0100)]
acpi_wakeup - Mark used vars with attribute used

* Mark obscurely used variables (such as variables only used from inside
  inline assembly) with __attribute__((used)).
  This also solves an issue with llvm/clang.

14 years agomxge - Avoid using #cpu
Alex Hornung [Thu, 3 Sep 2009 07:54:41 +0000 (08:54 +0100)]
mxge - Avoid using #cpu

* Don't use #cpu preprocessor macro, as it isn't needed. CPU is detected
  properly by defines as CPU __CPU__ __CPU.
  This also fixes compilation problems with llvm/clang.

14 years agolinuxemu - fix typo
Alex Hornung [Thu, 3 Sep 2009 09:33:22 +0000 (10:33 +0100)]
linuxemu - fix typo

* Commit e54488bbec5c9f80e95cedd395b0e3d31fde253d introduced a typo
  in linux_file breaking anything using linux getdents stuff.
  This also fixes issue 1471 and brings linuxulator back into working
  condition.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1471
Reported-By: ftigeot
14 years agoTCP - Reduce context switching when handling large send*() or write()'s
Matthew Dillon [Thu, 3 Sep 2009 05:15:12 +0000 (22:15 -0700)]
TCP - Reduce context switching when handling large send*() or write()'s

* Large sends or writes would cause sosend() to sleep and wakeup for every
  tcp segment acknowledged, resulting in massive inefficiencies.  To deal
  with this, if no LOWAT is set we automatically set the LOWAT to 1/2 the
  send buffer size and adjust the wakeup code.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 3 Sep 2009 05:12:06 +0000 (22:12 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly