dragonfly.git
13 years agokernel - Add MONITOR/MWAIT support to the LWKT scheduler
Matthew Dillon [Sun, 19 Dec 2010 17:25:17 +0000 (09:25 -0800)]
kernel - Add MONITOR/MWAIT support to the LWKT scheduler

* Adjust the FIFO contention resequencer (which deals with spinning
  on tokens) to use MONITOR/MWAIT when available instead of DELAY(1)
  when waiting to become the head of the queue.

* Adjust the x86-64 idle loop to use MONITOR/MWAIT when available when
  the idle halt mode (machdep.cpu_idle_hlt) is set to 1.  This
  significantly improves performance for event-oriented programs, including
  compile pipelines.

  NOTE: On the 48-core monster setting machdep.cpu_idle_hlt to 1 improves
  performance but at the cost of an additional 200W of power at idle vs
  the default value of 2 (ACPI idle halt).  Look for a hybrid approach in
  a future commit.

13 years agoMerge branch 'master' of git://git.dragonflybsd.org/dragonfly
Charlie [Sun, 19 Dec 2010 16:44:17 +0000 (11:44 -0500)]
Merge branch 'master' of git://git.dragonflybsd.org/dragonfly

13 years agoInterbench -- Do not compare strings with ==.
Venkatesh Srinivas [Sun, 19 Dec 2010 16:39:46 +0000 (11:39 -0500)]
Interbench -- Do not compare strings with ==.

13 years agoUpdate to libarchive-2.8.4.
Peter Avalos [Sun, 19 Dec 2010 11:46:45 +0000 (01:46 -1000)]
Update to libarchive-2.8.4.

This includes support for lzma and no longer relies on OpenSSL for hash
functions.

13 years agoMerge branch 'vendor/LIBARCHIVE' into HEAD
Peter Avalos [Sun, 19 Dec 2010 12:50:48 +0000 (02:50 -1000)]
Merge branch 'vendor/LIBARCHIVE' into HEAD

13 years agoAdd SHA384 functions to libmd.
Peter Avalos [Sun, 19 Dec 2010 10:32:24 +0000 (00:32 -1000)]
Add SHA384 functions to libmd.

13 years agojme: Rework software reset procedure
Sepherosa Ziehau [Sun, 19 Dec 2010 12:07:13 +0000 (20:07 +0800)]
jme: Rework software reset procedure

There is a wired TX/RX clock synchronization issues during software reset.
To address these issues we have to disable and enable TX/RX clocks several
times according to JMicron's document.

These clock synchronization issues seem to affect JMC250C/JMC260C chips,
however, it is claimed that these issues affact all JMC250/JMC260 chips.

Thank JMicron for providing JMC250C samples and detailed document.

13 years agoHook up liblzma, lzmainfo, xz, and xzdec to the build.
Peter Avalos [Sun, 19 Dec 2010 06:26:34 +0000 (20:26 -1000)]
Hook up liblzma, lzmainfo, xz, and xzdec to the build.

13 years agoMerge branch 'vendor/XZ' into HEAD
Peter Avalos [Sun, 19 Dec 2010 07:58:21 +0000 (21:58 -1000)]
Merge branch 'vendor/XZ' into HEAD

13 years agoRearrange lib/Makefile.
Peter Avalos [Sun, 19 Dec 2010 01:16:19 +0000 (15:16 -1000)]
Rearrange lib/Makefile.

Use one line per subdir.  This greatly improves readability.

Remove libraries we don't have any more from the comments.

13 years agoImport xz-5.0.0.
Peter Avalos [Sun, 19 Dec 2010 00:24:26 +0000 (14:24 -1000)]
Import xz-5.0.0.

This is from the XZ Utils project: http://tukaani.org/xz/

13 years agoRename cpu_mmw_pause(l) to cpu_mmw_pause_(int/long)
Venkatesh Srinivas [Sat, 18 Dec 2010 23:28:08 +0000 (15:28 -0800)]
Rename cpu_mmw_pause(l) to cpu_mmw_pause_(int/long)

13 years agoUse xorq, not xorl, for RAX on x64.
Venkatesh Srinivas [Sat, 18 Dec 2010 23:20:32 +0000 (15:20 -0800)]
Use xorq, not xorl, for RAX on x64.

13 years agokernel -- Replace cpu_mmw_mwait with _pause, which doesn't loop. Correct bugs.
Venkatesh Srinivas [Sat, 18 Dec 2010 23:18:52 +0000 (15:18 -0800)]
kernel -- Replace cpu_mmw_mwait with _pause, which doesn't loop. Correct bugs.

13 years agokernel -- Monitor/Mwait routine for x64; (untested!)
Venkatesh Srinivas [Sat, 18 Dec 2010 21:44:05 +0000 (13:44 -0800)]
kernel -- Monitor/Mwait routine for x64; (untested!)

13 years agokernel -- Correct bug in i386 monitor / mwait routine and change to long type.
Venkatesh Srinivas [Sat, 18 Dec 2010 21:43:13 +0000 (13:43 -0800)]
kernel -- Correct bug in i386 monitor / mwait routine and change to long type.

13 years agokernel -- Add MONITOR and MWAIT routine to i386 kernel.
Venkatesh Srinivas [Sat, 18 Dec 2010 15:24:58 +0000 (07:24 -0800)]
kernel -- Add MONITOR and MWAIT routine to i386 kernel.

Provides cpu_mmw_spin() and cpu_mmw_mwait(), both of which wait for a given
memory cell to contain a value different from an expected value. _spin()
merely spins on the cell; _mwait() uses the SSE3 MONITOR/MWAIT isns.

13 years agokernel - scheduler adjustments for large ncpus / 48-core monster
Matthew Dillon [Sat, 18 Dec 2010 08:42:52 +0000 (00:42 -0800)]
kernel - scheduler adjustments for large ncpus / 48-core monster

* Change the LWKT scheduler's token spinning algorithm.  It used to
  DELAY a short period of time and then simply retry, creating a lot
  of contention between cpus trying to acquire a token.

  Now the LWKT scheduler uses a FIFO index mechanic to resequence the
  contending cpus into 1uS retry slots using essentially just
  atomic_fetchadd_int(), so it is very cache friendly.  The spin-retry
  thus has a bounded cache management traffic load regardless of
  the number of cpus and contending cpus will not be tripping over
  each other.

  The new algorithm slightly regresses 4-cpu operation (~5% under heavy
  contention) but significantly improves 48-cpu operation.  It is also
  flexible enough for further work down the road.  The old algorithm
  simply did not scale very well.

  Add three sysctls:

  sysctl lwkt.spin_method=1

0    Allow a user thread to be scheduled on a cpu while kernel
     threads are contended on a token, using the IPI mechanic
     to interrupt the user thread and reschedule on decontention.

     This can potentially result in excessive IPI traffic.

1    Allow a user thread to be scheduled on a cpu while kernel
     threads are contended on a token, reschedule on the next clock
     tick (100 Hz typically).  Decontention will NOT generate
     any IPI traffic.  DEFAULT.

2    Do not allow a user thread to be scheduled on a cpu while
     kernel threads are contended.  Should not be used normally,
     for debugging only.

  sysctl lwkt.spin_delay=1

Slot time in microseconds, default 1uS.  Recommended values are
1 or 2 but not longer.

  sysctl lwkt.spin_loops=10

Number of times the LWKT scheduler loops on contended threads
before giving up and allowing an idle-thread HLT.  In order to
wake up from the HLT decontention will cause an IPI so you do
not want to set this value too small and.  Values between
10 and 100 are recommended.

* Redo the token decontention algorithm.  Use a new gd_reqflags flag,
  RQF_WAKEUP, coupled with RQF_AST_LWKT_RESCHED in the per-cpu globaldata
  structure to determine what cpus actually need to be IPId on token
  decontention (to wakeup their idle threads stuck in HLT).

  This requires that all gd_reqflags operations use locked atomic
  instructions rather than non-locked instructions.

* Decontention IPIs are a last-gasp effort if the LWKT scheduler has spun
  too many times.  Under normal conditions, even under heavy contention,
  actual IPIing should be minimal.

13 years agoutilities - Print the cpu id for running and runnable threads
Matthew Dillon [Sat, 18 Dec 2010 08:35:13 +0000 (00:35 -0800)]
utilities - Print the cpu id for running and runnable threads

* The cpuid was only being printed for the currently running thread on
  a cpu.  Also print it for any scheduled (runnable) threads on that cpu
  even if they aren't the currently running thread.

13 years agokernel - Fix M_NOWAIT's in e1000/if_igb driver
Matthew Dillon [Sat, 18 Dec 2010 08:34:27 +0000 (00:34 -0800)]
kernel - Fix M_NOWAIT's in e1000/if_igb driver

* M_NOWAITs should be M_INTWAITs.  Fixes numerous boot-time problems
  with the driver.

13 years agokernel -- Remove fo_poll.
Venkatesh Srinivas [Sat, 18 Dec 2010 01:08:22 +0000 (17:08 -0800)]
kernel -- Remove fo_poll.

13 years agoMerge branch 'master' of /repository/git/dragonfly
Venkatesh Srinivas [Fri, 17 Dec 2010 18:06:45 +0000 (10:06 -0800)]
Merge branch 'master' of /repository/git/dragonfly

13 years agokernel -- vnlru: Resolve minor race between vnlru_proc_wait and vnlru_proc.
Venkatesh Srinivas [Fri, 17 Dec 2010 17:46:46 +0000 (09:46 -0800)]
kernel -- vnlru: Resolve minor race between vnlru_proc_wait and vnlru_proc.

vnlru_proc_wait should have been using tsleep_interlock, not tsleep, to avoid
missed wakeups from the vnlru process.

13 years agomanpages: Remove some unneeded .Pp's.
Sascha Wildner [Fri, 17 Dec 2010 14:45:34 +0000 (15:45 +0100)]
manpages: Remove some unneeded .Pp's.

13 years agofortune - change dig to drill
Max Herrgård [Wed, 15 Dec 2010 20:28:09 +0000 (21:28 +0100)]
fortune - change dig to drill

13 years agolast - add forgotten files
Alex Hornung [Thu, 16 Dec 2010 17:35:43 +0000 (17:35 +0000)]
last - add forgotten files

13 years agoFix build of last(1).
Sascha Wildner [Thu, 16 Dec 2010 16:42:53 +0000 (17:42 +0100)]
Fix build of last(1).

13 years agossh - use utmpx
Alex Hornung [Sun, 5 Dec 2010 09:57:02 +0000 (09:57 +0000)]
ssh - use utmpx

13 years agoutmpx - Bring in utmpx,wtmpx and lastlogx support
Alex Hornung [Sun, 4 Oct 2009 17:44:56 +0000 (18:44 +0100)]
utmpx - Bring in utmpx,wtmpx and lastlogx support

* This commit introduces the necessary support for utmpx, wtmpx and
  lastlogx, as well as updating many base utils to work with these
  while mostly maintaining compatibility with the old utmp, wtmp and
  lastlog.

* The new last(1) supports wtmpx but defaults to wtmp as not all wtmp
  writers have been updated for wtmpx.

* All utmp readers support both utmp and utmpx now.

* lastlogin (the only lastlog reader) supports both lastlog and
  lastlogx.

* The utils who(1) and finger have been almost directly replaced by
  their NetBSD equivalent. In case of who(1) the only custom
  modification is the behaviour of '-b' to be as it has always been.

* Partially-Obtained-from: NetBSD

13 years agotzfile.h - install as include
Alex Hornung [Wed, 15 Dec 2010 19:05:47 +0000 (19:05 +0000)]
tzfile.h - install as include

13 years agotest
Sepherosa Ziehau [Thu, 16 Dec 2010 08:21:51 +0000 (16:21 +0800)]
test

13 years agotwe(4): Add some missing newlines in system messages.
Sascha Wildner [Thu, 16 Dec 2010 07:11:08 +0000 (08:11 +0100)]
twe(4): Add some missing newlines in system messages.

13 years agokernel - IPI subset of cpus on token de-collision.
Matthew Dillon [Wed, 15 Dec 2010 20:46:44 +0000 (12:46 -0800)]
kernel - IPI subset of cpus on token de-collision.

* Implement sysctl lwkt.token_ipi_dispatch and set the default value
  to 4, meaning when a token is released up to 4 conflicting cpus
  will be IPId to wake them up.

* Saves 20-40W under load on the 48-core monster (out of ~450W
  or so).

13 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 15 Dec 2010 20:32:54 +0000 (12:32 -0800)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

13 years agokern_proc - add kern.proc.cwd sysctl
Alex Hornung [Wed, 15 Dec 2010 11:38:25 +0000 (11:38 +0000)]
kern_proc - add kern.proc.cwd sysctl

* Add a kern.proc.cwd sysctl to be able to get the cwd of processes.
  Many terminal emulators need something this to set a window title.
  Right now, some simply don't work (konsole) and others (Terminal) use
  linprocfs.

13 years agokinfo.h - Document the units of some members
Alex Hornung [Wed, 15 Dec 2010 11:38:07 +0000 (11:38 +0000)]
kinfo.h - Document the units of some members

13 years agolibcrypt - install crypt.h header
Alex Hornung [Wed, 15 Dec 2010 11:37:21 +0000 (11:37 +0000)]
libcrypt - install crypt.h header

* Install the crypt.h header since some software (i.e. KDE) checks for
  crypt.h to decide whether it needs to link against libcrypt to be able
  to use crypt().

13 years agoif_clone: Don't destroy iface which is not create through if_clone mechanism
Sepherosa Ziehau [Tue, 14 Dec 2010 14:06:32 +0000 (22:06 +0800)]
if_clone: Don't destroy iface which is not create through if_clone mechanism

DragonFly-bug: http://bugs.dragonflybsd.org/issue1919

13 years agoSerialize IFADDR alteration by netisr0
Sepherosa Ziehau [Tue, 14 Dec 2010 13:13:21 +0000 (21:13 +0800)]
Serialize IFADDR alteration by netisr0

13 years agoImport libarchive-2.8.4.
Peter Avalos [Wed, 15 Dec 2010 08:07:20 +0000 (22:07 -1000)]
Import libarchive-2.8.4.

13 years agoRe-add README.DELETED to libarchive's vendor branch.
Peter Avalos [Wed, 15 Dec 2010 07:14:13 +0000 (21:14 -1000)]
Re-add README.DELETED to libarchive's vendor branch.

This was accidentally removed during the last import.

13 years agolibfsid(3): Make the filesystem type an enum and perform misc cleanup.
Sascha Wildner [Wed, 15 Dec 2010 07:03:16 +0000 (08:03 +0100)]
libfsid(3): Make the filesystem type an enum and perform misc cleanup.

13 years agomdoc: Add libfsid to the list of libraries.
Sascha Wildner [Wed, 15 Dec 2010 07:02:11 +0000 (08:02 +0100)]
mdoc: Add libfsid to the list of libraries.

13 years agomsdosfs: Add a define of 0x28 as extended boot record signature.
Sascha Wildner [Wed, 15 Dec 2010 07:01:03 +0000 (08:01 +0100)]
msdosfs: Add a define of 0x28 as extended boot record signature.

As per http://support.microsoft.com/kb/140418 (Detailed Explanation
of FAT Boot Sector), the "...extended boot record signature must be
either 0x28 or 0x29...".

13 years agoBump WARNS for latest import of ftp and adjust README.DRAGONFLY for git.
Peter Avalos [Wed, 15 Dec 2010 05:57:24 +0000 (19:57 -1000)]
Bump WARNS for latest import of ftp and adjust README.DRAGONFLY for git.

13 years agoMerge branch 'vendor/TNFTP'
Peter Avalos [Wed, 15 Dec 2010 05:54:39 +0000 (19:54 -1000)]
Merge branch 'vendor/TNFTP'

13 years agoSnyc tnftp with NetBSD:
Peter Avalos [Wed, 15 Dec 2010 05:40:35 +0000 (19:40 -1000)]
Snyc tnftp with NetBSD:

Fix numerous WARNS issues.

Rename internal getline() function to get_line() to prevent conflicts.

Rename argument from "bool" to "val".

Parse HTTP 'Date' entries in the `C' locale rather than the user's.

Avoid NULL dereference in log output if the command line parser
failed to extract a port number from the URL.

Use AF_INET instead of AF_UNSPEC as the default family if
!defined(INET6).

In ftpvis(), prevent incomplete escape sequences at end of dst,
and ensure NUL-termination of dst.  Also tweak for readibility.

13 years agoUpdate to zlib-1.2.5.
Peter Avalos [Tue, 14 Dec 2010 23:39:55 +0000 (13:39 -1000)]
Update to zlib-1.2.5.

This contains numerous bug fixes and improvements.  For more details,
see the ChangeLog.

Incorporated in this commit is removal of using patch files, and just
making the appropriate changes on master.

13 years agoMerge branch 'vendor/ZLIB'
Peter Avalos [Wed, 15 Dec 2010 01:52:43 +0000 (15:52 -1000)]
Merge branch 'vendor/ZLIB'

13 years agodm(4): Fix kernel compilation with 'device dm' in the config.
Sascha Wildner [Tue, 14 Dec 2010 23:38:41 +0000 (00:38 +0100)]
dm(4): Fix kernel compilation with 'device dm' in the config.

13 years agoImport zlib-1.2.5.
Peter Avalos [Tue, 14 Dec 2010 22:25:24 +0000 (12:25 -1000)]
Import zlib-1.2.5.

13 years agoDelete old version of zlib from vendor branch.
Peter Avalos [Tue, 14 Dec 2010 21:05:22 +0000 (11:05 -1000)]
Delete old version of zlib from vendor branch.

13 years ago.gitignore: Remove .depend again.
Sascha Wildner [Tue, 14 Dec 2010 20:04:42 +0000 (21:04 +0100)]
.gitignore: Remove .depend again.

If old .depend files are left lying around in /usr/src, this can
cause strange build failures.

Having .depend in .gitignore hides these files and makes the
failures hard to track. So it's not a good thing.

13 years agodm - add remove_all, refactor
Alex Hornung [Mon, 13 Dec 2010 18:17:08 +0000 (18:17 +0000)]
dm - add remove_all, refactor

* Refactor the dm dev creation and removal methods as to avoid
  duplication and, as a bonus, do things properly.

* Rename foo_destroy to foo_uninit, because that's what they really are,
  uninit functions.

* Add an experimental 'remove_all' method

* Move atoi64 into device-mapper so that the striped target works
  without loading the linear target.

13 years agocryptsetup - fix warning message
Alex Hornung [Mon, 13 Dec 2010 20:15:13 +0000 (20:15 +0000)]
cryptsetup - fix warning message

* Our module is called dm, not dm_mod.

13 years agolibfsid, fsid - bind into build system
Alex Hornung [Mon, 13 Dec 2010 20:09:07 +0000 (20:09 +0000)]
libfsid, fsid - bind into build system

13 years agofsid - Don't check floppies
Alex Hornung [Mon, 13 Dec 2010 07:42:52 +0000 (07:42 +0000)]
fsid - Don't check floppies

13 years agolibfsid - A new library to determine filesystems.
Ákos Kovács [Wed, 8 Dec 2010 19:35:28 +0000 (20:35 +0100)]
libfsid - A new library to determine filesystems.

* The idea is extracted from the sbin/fsid tool. The library provides an
  interface to probe a given device for a file system and get its volume
  label.

* fsid was changed to use libfsid functionality.

Sponsored-by: Google Code-In
13 years agoinclude - install ext2fs headers
Ákos Kovács [Sat, 11 Dec 2010 14:01:39 +0000 (15:01 +0100)]
include - install ext2fs headers

13 years agovkernel - Fix build
Matthew Dillon [Mon, 13 Dec 2010 04:00:04 +0000 (20:00 -0800)]
vkernel - Fix build

* Fix vkernel build after mplock->mp_token changes.  The vkernel was
  hitting an early panic due to not properly acquiring the new mp_token.

Reported-by: Venkatesh Srinivas <me@endeavour.zapto.org>
13 years agokernel - Mark kqfilters of several devices MPSAFE
Samuel J. Greear [Sun, 12 Dec 2010 23:27:19 +0000 (23:27 +0000)]
kernel - Mark kqfilters of several devices MPSAFE

* Memory I/O devices, Pipes, TTY's and PTY's

* Also correct MPSAFE'ty comment for kern_close()

13 years agokernel - Fix UP build
Thomas Nikolajsen [Sun, 12 Dec 2010 21:01:57 +0000 (22:01 +0100)]
kernel - Fix UP build

13 years agoarcmsr(4): Add missing cam_simq_release and creation of /dev/arcX alias.
Sascha Wildner [Sun, 12 Dec 2010 04:55:38 +0000 (05:55 +0100)]
arcmsr(4): Add missing cam_simq_release and creation of /dev/arcX alias.

13 years agoRemove KTR_GIANT_CONTENTION kernel option (no longer used).
Sascha Wildner [Sun, 12 Dec 2010 21:28:15 +0000 (22:28 +0100)]
Remove KTR_GIANT_CONTENTION kernel option (no longer used).

13 years agoUpdate for OpenSSL-1.0.0c.
Peter Avalos [Sun, 12 Dec 2010 00:32:54 +0000 (14:32 -1000)]
Update for OpenSSL-1.0.0c.

This primarily fixes CVE-2010-4180.  See NEWS and CHANGES for more details.

13 years agoMerge branch 'vendor/OPENSSL'
Peter Avalos [Sun, 12 Dec 2010 00:27:24 +0000 (14:27 -1000)]
Merge branch 'vendor/OPENSSL'

13 years agoImport OpenSSL-1.0.0c.
Peter Avalos [Sun, 12 Dec 2010 00:08:43 +0000 (14:08 -1000)]
Import OpenSSL-1.0.0c.

13 years agokernel - 48-core MP work
Matthew Dillon [Sat, 11 Dec 2010 23:47:01 +0000 (15:47 -0800)]
kernel - 48-core MP work

* Replace the cpu_contention_mask global with a per-token contention mask.

* Fold the lwkt.user_pri_sched feature into the scheduler and remove the
  sysctl.  The feature is now alwayws on.  The feature allows a lower
  priority non-contending thread to be scheduled in the face of a
  high-priority contending thread that would normally spin in the scheduler.

* A reschedule IPI is now performed when a high-priority contending thread
  might possibly resolve, which will kick the user process back into the
  kernel and allow rescheduling of the higher priority thread.

* Change the idle-cpu check semantics.  When a cpu's scheduler finds only
  contending threads it used to loop in the scheduler and the idle thread
  would be flagged to not halt.  We now allow the idle thread to halt in
  this case and expect to receive an IPI when any of the contending threads
  might possibly resolve.

  As a fringe benefit this should also benefit vkernels.

* lwkt_schedule() has been significantly simplified.  Or as I would say,
  decomplexified.

13 years agokernel - Have DDB print '?' for non-printable characters
Matthew Dillon [Sat, 11 Dec 2010 21:21:03 +0000 (13:21 -0800)]
kernel - Have DDB print '?' for non-printable characters

* When DDB prints something just use '?' for non-printable characters
  to try to avoid messing up the screen too much.

13 years agokernel - Change the discrete mplock into mp_token
Matthew Dillon [Sat, 11 Dec 2010 20:59:46 +0000 (12:59 -0800)]
kernel - Change the discrete mplock into mp_token

* Use a lwkt_token for the mp_lock.  This consolidates our longer-term
  spinnable locks (the mplock and tokens) into just tokens, making it
  easier to solve performance issues.

* Some refactoring of the token code was needed to guarantee the ordering
  when acquiring and releasing the mp_token vs other tokens.

* The thread switch code, lwkt_switch(), is simplified by this change
  though not necessarily faster.

* Remove td_mpcount, mp_lock, and other related fields.

* Remove assertions related to td_mpcount and friends, generally folding
  them into similar assertions for tokens.

13 years agokernel - Remove CACHE_*MPLOCK* macros & sysctl
Matthew Dillon [Sat, 11 Dec 2010 17:13:47 +0000 (09:13 -0800)]
kernel - Remove CACHE_*MPLOCK* macros & sysctl

* Remove the vfs.cache_mpsafe sysctl and related macros.  This has
  defaulted to 1 (mpsafe) for a while now and is no longer needed.

13 years agokernel - Mark pty devices D_MPSAFE
Matthew Dillon [Sat, 11 Dec 2010 17:09:39 +0000 (09:09 -0800)]
kernel - Mark pty devices D_MPSAFE

* Mark the pty devices D_MPSAFE.  They are protected by tty_token

13 years agoutilities - Fix top -M when the window does not have sufficient rows
Matthew Dillon [Sat, 11 Dec 2010 09:01:33 +0000 (01:01 -0800)]
utilities - Fix top -M when the window does not have sufficient rows

* Fixes a seg-fault.

13 years agokernel - Rearrange usched_bsd4.c a bit
Matthew Dillon [Sat, 11 Dec 2010 08:42:18 +0000 (00:42 -0800)]
kernel - Rearrange usched_bsd4.c a bit

* Rearrange the way the scheduler helpers are woken up.  This results in
  much better coverage on systems with large numbers of cpus.

  Tested on the 48-core opteron monster.

* Essentially we no longer do bogus wakeups of scheduler helpers, and the
  chaining has been fixed when a scheduler helper is unable to perform
  the operation it was scheduled for (it tries to find another idle cpu
  to forward to).

  Most cpumask operations are now performed while holding the spin lock.

13 years agokernel - Make swap, nullfs MPSAFE
Matthew Dillon [Sat, 11 Dec 2010 08:40:32 +0000 (00:40 -0800)]
kernel - Make swap, nullfs MPSAFE

* Mark the swap dummy mount as being MPSAFE so strategy operations do not
  acquire the mplock.

* Mark NULLFS mounts as being MPSAFE so operations do not acquire the
  mplock.  If the underlying VFS is not MPSAFE it will still acquire
  the mplock.

13 years agokernel - Record token & mplock collisions in thread->td_wmesg
Matthew Dillon [Sat, 11 Dec 2010 08:38:45 +0000 (00:38 -0800)]
kernel - Record token & mplock collisions in thread->td_wmesg

* Record token & mplock collisions which the lwkt thread schedule spins
  on in the thread wmesg, which will show up in ps, top, etc.

  This makes it a lot more obvious when a thread is stalling on a token
  or the mplock and is generally superior to the old per-cpu collision
  record.

13 years agokernel - Add debugging features
Matthew Dillon [Sat, 11 Dec 2010 08:35:29 +0000 (00:35 -0800)]
kernel - Add debugging features

* Add lwkt.mplock_backtrace to force the kernel to print a backtrace
  when it encounters a mplock collision.  This is a bit problematic
  though as the backtrace can sometimes crash the kernel.

* Allow lwkt.mplock_yield_delay to be set to 0.

13 years agokernel - Remove unnecessary mplock in sys_ofstat()
Matthew Dillon [Sat, 11 Dec 2010 08:31:19 +0000 (00:31 -0800)]
kernel - Remove unnecessary mplock in sys_ofstat()

* Remove get/rel_mplock around kern_fstat() in the 4.3 fstat compat
  function.

13 years agoamr(4): Some bugfixes.
Sascha Wildner [Sat, 11 Dec 2010 03:57:36 +0000 (04:57 +0100)]
amr(4): Some bugfixes.

* Add a missing devstat_end_transaction_buf(). Makes device stats actually
  work.

* Add a couple of missing cam_simq_release() calls.

13 years agokernel - Adjustments to if_igb
Matthew Dillon [Sat, 11 Dec 2010 02:10:22 +0000 (18:10 -0800)]
kernel - Adjustments to if_igb

* Change the spin lock to a token.  A spinlock is inappropriate here because
  the thread can block with it held (resulting in a panic).

* Use rid 0 when allocating a legacy interrupt, fixing an issue where
  the interrupt bus resource could not be allocated.

13 years agokernel - Set wmesg when spinning on a token or the mplock
Matthew Dillon [Sat, 11 Dec 2010 02:08:20 +0000 (18:08 -0800)]
kernel - Set wmesg when spinning on a token or the mplock

* When spinning on a token or the mplock set the wmesg so it shows up
  in ps and top output.

13 years agoutilities - Fix top formatting when > 9 cpus present
Matthew Dillon [Sat, 11 Dec 2010 01:38:21 +0000 (17:38 -0800)]
utilities - Fix top formatting when > 9 cpus present

* Change %1x format to %02d

13 years agoinstaller - Increase administrative swap size limit to 512G
Matthew Dillon [Fri, 10 Dec 2010 20:57:56 +0000 (12:57 -0800)]
installer - Increase administrative swap size limit to 512G

* Increase from 8G to 512G (which is the x86-64 default swap size limit).
  8G was too small either way.  Maybe the installer-enforced administrative
  limit should just be removed entirely.

13 years agoBring in an igb(4) manual page (from FreeBSD).
Sascha Wildner [Fri, 10 Dec 2010 12:04:36 +0000 (13:04 +0100)]
Bring in an igb(4) manual page (from FreeBSD).

13 years agomanual pages: Punctuation and whitespace cleanup.
Sascha Wildner [Fri, 10 Dec 2010 10:30:20 +0000 (11:30 +0100)]
manual pages: Punctuation and whitespace cleanup.

13 years agokernel - Fix MP system call performance regression
Matthew Dillon [Fri, 10 Dec 2010 07:53:44 +0000 (23:53 -0800)]
kernel - Fix MP system call performance regression

* The userland scheduler was unconditionally calling lwkt_switch()
  via userexit() (i.e. on every system call), creating unnecessary
  overhead and possibly also triggering a bsd4 scheduler event
  requiring a common spinlock.

* Rearrange the code slightly to reduce instances where lwkt_switch()
  is called.  We want to try to keep instances where a higher priority
  LWKT thread is potentially runnable or when the LWKT fairq accumulator
  for the current thread has been exhausted.

* This removes system call overhead multiplication on MP systems.  For
  example, on a 48-core box system call overhead when all 48 cpus are
  busy doing getuid() loops went from 10uS back down to 270nS (which
  is near the single-cpu test results).

13 years agokernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds (3)
Matthew Dillon [Fri, 10 Dec 2010 07:12:20 +0000 (23:12 -0800)]
kernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds (3)

* Correct compile-time errors in vkernel64 build.

13 years agokernel - Simplify AP CPU reporting on x86-64
Matthew Dillon [Fri, 10 Dec 2010 07:11:32 +0000 (23:11 -0800)]
kernel - Simplify AP CPU reporting on x86-64

* Simplify the AP CPU kprintf()s to reduce console spew.

13 years agokernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds (2)
Matthew Dillon [Fri, 10 Dec 2010 07:10:50 +0000 (23:10 -0800)]
kernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds (2)

* Fix mis-translation in previous commit

13 years agostyle(9) - Prefer a lack of case '?' fallthrough for getopt
Samuel J. Greear [Fri, 10 Dec 2010 06:35:33 +0000 (06:35 +0000)]
style(9) - Prefer a lack of case '?' fallthrough for getopt

* This also coincides with the example in getopt(3)

Discussed-with: swildner@

13 years agoMerge branch 'malloc_constructor'
Samuel J. Greear [Fri, 10 Dec 2010 06:16:57 +0000 (06:16 +0000)]
Merge branch 'malloc_constructor'

13 years agoMerge branch 'GCI2010'
Samuel J. Greear [Fri, 10 Dec 2010 06:16:48 +0000 (06:16 +0000)]
Merge branch 'GCI2010'

13 years agovkernel - Add usage()
Samuel J. Greear [Fri, 10 Dec 2010 04:58:22 +0000 (04:58 +0000)]
vkernel - Add usage()

* Adds a new argument -h, which prints extended usage information

* Prints typical usage information (same as manpage) when no arguments are
  specified or an invalid argument is given. Otherwise, error output is the
  same as before.

* Convert to sysexits(3)

Sponsored-By: Google Code-In
13 years agokernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds.
Matthew Dillon [Thu, 9 Dec 2010 22:09:17 +0000 (14:09 -0800)]
kernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds.

* Increase SMP_MAXCPU to 63 for 64-bit builds.

* cpumask_t is 64 bits on 64-bit builds now.  It remains 32 bits on 32-bit
  builds.

* Add #define's for atomic_set_cpumask(), atomic_clear_cpumask, and
  atomic_cmpset_cpumask().  Replace all use cases on cpu masks with
  these functions.

* Add CPUMASK(), BSRCPUMASK(), and BSFCPUMASK() macros.  Replace all
  use cases on cpu masks with these functions.

  In particular note that (1 << cpu) just doesn't work with a 64-bit
  cpumask.

  Numerous bits of assembly also had to be adjusted to use e.g. btq instead
  of btl, etc.

* Change __uint32_t declarations that were meant to be cpu masks to use
  cpumask_t (most already have).

  Also change other bits of code which work on cpu masks to be more agnostic.
  For example, poll_cpumask0 and lwp_cpumask.

* 64-bit atomic ops cannot use "iq", they must use "r", because most x86-64
  do NOT have 64-bit immediate value support.

* Rearrange initial kernel memory allocations to start from KvaStart and
  not KERNBASE, because only 2GB of KVM is available after KERNBASE.

  Certain VM allocations with > 32G of ram can exceed 2GB.  For example,
  vm_page_array[].  2GB was not enough.

* Remove numerous mdglobaldata fields that are not used.

* Align CPU_prvspace[] for now.  Eventually it will be moved into a
  mapped area.  Reserve sufficient space at MPPTDI now, but it is
  still unused.

* When pre-allocating kernel page table PD entries calculate the number
  of page table pages at KvaStart and at KERNBASE separately, since
  the KVA space starting at KERNBASE caps out at 2GB.

* Change kmem_init() and vm_page_startup() to not take memory range
  arguments.  Instead the globals (virtual_start and virtual_end) are
  manipualted directly.

13 years agoperiodic(8): Adjust the bsdstats script to use drill(1) instead of dig(1).
Sascha Wildner [Thu, 9 Dec 2010 05:12:16 +0000 (06:12 +0100)]
periodic(8): Adjust the bsdstats script to use drill(1) instead of dig(1).

The check_dns() check is still wrong which is due to the setting of
IFS but until scrappy@ reports back, I won't touch that. For the
moment, it will succeed, but would also not fail in check_dns() if
the network was down.

Reported-by: Tim Darby <t+dfbsd@timdarby.net>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1927>

13 years agomfiutil(8): Fix a in the interval argument to the 'patrol auto' command.
Sascha Wildner [Thu, 9 Dec 2010 04:10:26 +0000 (05:10 +0100)]
mfiutil(8): Fix a in the interval argument to the 'patrol auto' command.

13 years agoswapcache.8: Fix typos.
Sascha Wildner [Thu, 9 Dec 2010 04:09:03 +0000 (05:09 +0100)]
swapcache.8: Fix typos.

13 years agodevattr(8): Fix weird style and perform some general cleanup.
Sascha Wildner [Thu, 9 Dec 2010 04:08:33 +0000 (05:08 +0100)]
devattr(8): Fix weird style and perform some general cleanup.

13 years agoFix installworld.
Sascha Wildner [Wed, 8 Dec 2010 15:42:06 +0000 (16:42 +0100)]
Fix installworld.

13 years agobitstring(3): Describe bit_fls and bit_nsearch.
Venkatesh Srinivas [Wed, 8 Dec 2010 06:55:34 +0000 (22:55 -0800)]
bitstring(3): Describe bit_fls and bit_nsearch.