dragonfly.git
3 years agomptutil.8: Remove trailing whitespace.
Sascha Wildner [Sat, 24 Apr 2010 14:07:35 +0000 (16:07 +0200)]
mptutil.8: Remove trailing whitespace.

3 years agomount_nfs.8: Write "RFC xxxx" instead of "RFCxxxx".
Sascha Wildner [Sat, 24 Apr 2010 14:07:09 +0000 (16:07 +0200)]
mount_nfs.8: Write "RFC xxxx" instead of "RFCxxxx".

3 years agopthread.3: Add missing section.
Sascha Wildner [Sat, 24 Apr 2010 14:06:21 +0000 (16:06 +0200)]
pthread.3: Add missing section.

3 years agoAdjust manual page installation for the 802.11 upgrade.
Sascha Wildner [Sat, 24 Apr 2010 13:17:39 +0000 (15:17 +0200)]
Adjust manual page installation for the 802.11 upgrade.

4 years agoevtr: ktrfmt.tab.h is not supposed to be installed to /usr/include.
Sascha Wildner [Sat, 24 Apr 2010 10:32:21 +0000 (12:32 +0200)]
evtr: ktrfmt.tab.h is not supposed to be installed to /usr/include.

4 years agomanpages: Fix some mdoc issues and remove trailing whitespace.
Sascha Wildner [Sat, 24 Apr 2010 01:47:23 +0000 (03:47 +0200)]
manpages: Fix some mdoc issues and remove trailing whitespace.

4 years agoxstr(1): Sync with FreeBSD.
Sascha Wildner [Sat, 24 Apr 2010 01:45:23 +0000 (03:45 +0200)]
xstr(1): Sync with FreeBSD.

4 years agodsched - serno support
Alex Hornung [Fri, 23 Apr 2010 10:17:09 +0000 (10:17 +0000)]
dsched - serno support

* Add support for serno loader tunables, e.g. dsched.policy.WD1293193 =
  "fq".

* Incidentally do another name change on the loader tunables from
  kern.dsched.* to dsched.* to have the same namespace as the sysctls.

* Add a sysctl dsched.policies showing the currently available policies.

4 years agoevtr: hook into the x86_64 build
Aggelos Economopoulos [Fri, 23 Apr 2010 14:22:18 +0000 (17:22 +0300)]
evtr: hook into the x86_64 build

Submitted-by: swildner@
4 years agoevtranalyze: clean up warnings
Aggelos Economopoulos [Fri, 23 Apr 2010 14:17:28 +0000 (17:17 +0300)]
evtranalyze: clean up warnings

Compilation-on-x86_64-by: swildner@

4 years agolibevtr: portability fixes
Aggelos Economopoulos [Fri, 23 Apr 2010 14:12:51 +0000 (17:12 +0300)]
libevtr: portability fixes

Compilation-on-x86_64-by: swildner@

4 years agolibevtr: get rid of unused yyunput() definition
Aggelos Economopoulos [Fri, 23 Apr 2010 14:10:14 +0000 (17:10 +0300)]
libevtr: get rid of unused yyunput() definition

Reminder-by: swildner@
4 years agolibevtr.h: cleanup evtr.h a bit
Aggelos Economopoulos [Fri, 23 Apr 2010 12:24:17 +0000 (15:24 +0300)]
libevtr.h: cleanup evtr.h a bit

Prodded-by: alexh@
4 years agoevtranalyze: fix thinko in debug code
Aggelos Economopoulos [Fri, 23 Apr 2010 11:37:23 +0000 (14:37 +0300)]
evtranalyze: fix thinko in debug code

4 years agoevtr: initial implementation of a DSL
Aggelos Economopoulos [Wed, 17 Mar 2010 23:48:54 +0000 (01:48 +0200)]
evtr: initial implementation of a DSL

libevtr:
- abstract out the hash table, convert to using uintptr_t's
  internally
- move a bunch of fields and most of the error logic from
  evtr to evtr_query
- don't try to resolve format strings to id's and reject
  records that don't match early; this needs way more care
  now that we might want to interpret the format strings
- start implementation of a minimal Domain Specific Language
- add the ability to filter based on the event type
- lots of fixes all around

evtranalyze:
- catch up w/ API changes in libevtr
- add toy 'stats' command

4 years agodsched - Bump diskctx max size to 512
Alex Hornung [Fri, 23 Apr 2010 06:31:36 +0000 (06:31 +0000)]
dsched - Bump diskctx max size to 512

* Bump the maximum size of the diskctx struct to 512, as 256 is too
  small already for dsched_fq on x86_64.

Reported-by: Sascha Wildner
4 years agoAdd DSCHED_FQ to LINT.
Sascha Wildner [Thu, 22 Apr 2010 22:22:27 +0000 (00:22 +0200)]
Add DSCHED_FQ to LINT.

4 years agoFix buildworld.
Sascha Wildner [Thu, 22 Apr 2010 21:08:06 +0000 (23:08 +0200)]
Fix buildworld.

4 years agodsched - expand framework to track threads
Alex Hornung [Thu, 22 Apr 2010 09:48:50 +0000 (09:48 +0000)]
dsched - expand framework to track threads

* The dsched framework now takes care of tracking threads/procs and
  bufs. Most of this code was factored out of dsched_fq.

* fq now uses the new, much simplified API, reducing the lines of code
  by about 50%.

* this will also allow for runtime policy switching, even to other
  policies that need to track procs/threads. Previously it was only
  possible to have one policy that tracked threads.

* Now all policies can be loaded at any time and will still be able to
  track all the threads.

* dsched_fq is now a module that can be loaded if required. Once loaded
  the policy is registered and ready to use with any disk.

* There is also a kernel option DSCHED_FQ now; otherwise
  dsched_fq_load="YES" has to be set in loader.conf to be able to use fq
  from boot on.

* Make a dsched sysctl tree.

Suggested-by: Aggelos Economopoulos
4 years agodschedctl: G/C some unneeded headers
Stathis Kamperis [Thu, 22 Apr 2010 17:51:33 +0000 (20:51 +0300)]
dschedctl: G/C some unneeded headers

4 years agodschedctl: Better error message on unknown policy
Stathis Kamperis [Thu, 22 Apr 2010 15:28:10 +0000 (18:28 +0300)]
dschedctl: Better error message on unknown policy

Discussed-with: alexh@, corecode@

4 years agoAdjust 'make upgrade' for the recent 802.11 update.
Sascha Wildner [Thu, 22 Apr 2010 10:12:57 +0000 (12:12 +0200)]
Adjust 'make upgrade' for the recent 802.11 update.

4 years agowi(4): Fix -Wold-style-definition.
Sascha Wildner [Thu, 22 Apr 2010 10:03:37 +0000 (12:03 +0200)]
wi(4): Fix -Wold-style-definition.

4 years agokernel: Add TUNABLE_ULONG too and really fix the acpi warning.
Sascha Wildner [Thu, 22 Apr 2010 09:58:51 +0000 (11:58 +0200)]
kernel: Add TUNABLE_ULONG too and really fix the acpi warning.

4 years agoacpi(4): Use TUNABLE_LONG to fix a warning and remove a nowerror.
Sascha Wildner [Thu, 22 Apr 2010 09:34:14 +0000 (11:34 +0200)]
acpi(4): Use TUNABLE_LONG to fix a warning and remove a nowerror.

4 years agokernel: Add TUNABLE_LONG.
Sascha Wildner [Thu, 22 Apr 2010 09:14:47 +0000 (11:14 +0200)]
kernel: Add TUNABLE_LONG.

4 years agointerbench - Port to DragonFly
Alex Hornung [Thu, 22 Apr 2010 06:38:02 +0000 (06:38 +0000)]
interbench - Port to DragonFly

4 years agointerbench - initial import
Alex Hornung [Thu, 22 Apr 2010 05:51:56 +0000 (05:51 +0000)]
interbench - initial import

4 years agoClean up the options in our kernel configs for the recent 802.11 upgrade.
Sascha Wildner [Thu, 22 Apr 2010 00:29:53 +0000 (02:29 +0200)]
Clean up the options in our kernel configs for the recent 802.11 upgrade.

4 years agodschedctl: OCD attack
Stathis Kamperis [Wed, 21 Apr 2010 23:28:16 +0000 (02:28 +0300)]
dschedctl: OCD attack

4 years agodschedctl: Don't assume /dev as devfs's mount point
Stathis Kamperis [Wed, 21 Apr 2010 23:02:06 +0000 (02:02 +0300)]
dschedctl: Don't assume /dev as devfs's mount point

Suggested-by: swildner@
4 years agodschedctl: Allow /dev/<disk> as valid syntax
Stathis Kamperis [Wed, 21 Apr 2010 22:41:23 +0000 (01:41 +0300)]
dschedctl: Allow /dev/<disk> as valid syntax

Discussed-with: alexh@

4 years agodschedctl: Cosmetic stuff
Stathis Kamperis [Wed, 21 Apr 2010 19:31:52 +0000 (22:31 +0300)]
dschedctl: Cosmetic stuff

No functional change intended.

4 years agommc(4): Remove ARM specific DRIVER_MODULE().
Sascha Wildner [Wed, 21 Apr 2010 22:14:31 +0000 (00:14 +0200)]
mmc(4): Remove ARM specific DRIVER_MODULE().

4 years agofqstats - remove leftover
Alex Hornung [Wed, 21 Apr 2010 19:09:25 +0000 (19:09 +0000)]
fqstats - remove leftover

* remove leftovers from the fqmp refs for buf removal.

Reported-by: Matthew Dillon
4 years agoieee80211 - Fix detachment panic
Matthew Dillon [Wed, 21 Apr 2010 17:46:44 +0000 (10:46 -0700)]
ieee80211 - Fix detachment panic

* Destroy the clone when ieee80211_vap_destroy() is called, fixing a
  panic when kldunloading e.g. if_ath after a wlan clone has been
  attached to it.

Submitted-by: Rui Paulo <rpaulo@freebsd.org>
4 years agobuild - Fix parallel build race in Makefile
Matthew Dillon [Wed, 21 Apr 2010 17:22:55 +0000 (10:22 -0700)]
build - Fix parallel build race in Makefile

* Fix a misspelled ORDER dependency which led to a mkdir
  dependency sometimes being run out of order.

4 years agoath - Fix a mismatch in the module options.
Antonio Huete Jimenez [Wed, 21 Apr 2010 16:05:36 +0000 (18:05 +0200)]
ath - Fix a mismatch in the module options.

This caused a panic with ifconfig in basic operations such
as putting an interface up.

Submitted-by: <rpaulo@FreeBSD.org>
4 years agoFix buildkernel KERNCONF=SOEKRIS.
Sascha Wildner [Wed, 21 Apr 2010 14:37:53 +0000 (16:37 +0200)]
Fix buildkernel KERNCONF=SOEKRIS.

4 years agoSync zoneinfo database with tzdata2010i from elsie.nci.nih.gov
Sascha Wildner [Wed, 21 Apr 2010 14:12:10 +0000 (16:12 +0200)]
Sync zoneinfo database with tzdata2010i from elsie.nci.nih.gov

africa:         8.24 -> 8.26
asia:           8.59 -> 8.60
southamerica:   8.43 -> 8.44

* Morocco will have DST in 2010 from May 2 to Aug 22.

* Taiwan had DST in 1979, not in 1980.

* San Luis, Argentina, is on "permanent" DST as of 2010.

4 years agodschedctl.8 - Add man page
Alex Hornung [Wed, 21 Apr 2010 07:24:36 +0000 (07:24 +0000)]
dschedctl.8 - Add man page

4 years agodschedctl - Change arguments, clean up
Alex Hornung [Wed, 21 Apr 2010 07:22:01 +0000 (07:22 +0000)]
dschedctl - Change arguments, clean up

* Remove the '-d' argument and instead allow an extra argument to '-l'
  and '-s'.

* Allow for a change of policy on all disks by not specifying an extra
  argument after '-s policy'.

* Introduce two FOREACH macros to simplify the code.

* Add helper function dsched_set_disk_policy().

* Add verbose mode.

4 years agodsched_fq - correct disk busy% calculation
Alex Hornung [Tue, 20 Apr 2010 22:31:12 +0000 (22:31 +0000)]
dsched_fq - correct disk busy% calculation

* Previously old_tv was static, causing problems when several disks had
  the fq policy enabled, as the start time of the interval was taken
  from some other disk.

* Avoid this issue by keeping the information in diskctx, where it
  belongs.

4 years agodsched: Avoid integer overflow.
Sascha Wildner [Tue, 20 Apr 2010 18:32:44 +0000 (21:32 +0300)]
dsched: Avoid integer overflow.

Multiplication of two 32 bit values can overflow the 32 bit result. Cast
one of the multiplicants to force 64 bit multiplication.

This fixes a lockup due to an infinite loop in the following while().

In-collaboration-with: aggelos

4 years agodsched_fq - remove pointless atomic ops
Alex Hornung [Tue, 20 Apr 2010 16:49:58 +0000 (16:49 +0000)]
dsched_fq - remove pointless atomic ops

Reported-by: Aggelos Economopoulos
4 years agodsched_fq - Correct incomplete_tp count
Alex Hornung [Tue, 20 Apr 2010 16:44:26 +0000 (16:44 +0000)]
dsched_fq - Correct incomplete_tp count

* Previously, the incomplete_tp count was not decreased when an error
  occurred. This is now fixed by unconditionally reducing the incomplete
  count on the biodone callback.

Reported-by: Aggelos Economopoulos
4 years agommcsd(4): Add device statistics.
Sascha Wildner [Tue, 20 Apr 2010 10:33:42 +0000 (13:33 +0300)]
mmcsd(4): Add device statistics.

4 years agodsched, dsched_fq - Major cleanup
Alex Hornung [Mon, 19 Apr 2010 18:24:34 +0000 (18:24 +0000)]
dsched, dsched_fq - Major cleanup

SHORT version: major cleanup and rename to useful names

LONG version:

dsched:
* Unify dsched_ops with dsched_policy, remove fallout

* Rename dsched_{create,destroy} -> dsched_disk_{create,destroy}_callback

* Kill .head in dsched_policy

* Kill dead code

dsched_fq:
* Rename fqp -> thread_io/tdio
* Rename fqmp -> thread_ctx/tdctx
* Rename dpriv -> disk_ctx/diskctx

* Several related renames of functions (alloc/ref/unref).

* Remove dead code

* rename tdctx->s_* -> tdctx->interval_*

* comment struct members

* ... and some more changes I probably forgot

Huge-Thanks-To: Aggelos Economopoulos

4 years agodsched - Periph.: call dsched_exit on thread exit
Alex Hornung [Mon, 19 Apr 2010 16:39:16 +0000 (16:39 +0000)]
dsched - Periph.: call dsched_exit on thread exit

* The previous location of the call to dsched_exit was not right and did
  not allow the use of lockmgr.

* We now call dsched_exit before the thread is completely killed and
  descheduled as to avoid any problems.

4 years agodsched_fq - move to lockmgr
Alex Hornung [Mon, 19 Apr 2010 14:07:25 +0000 (14:07 +0000)]
dsched_fq - move to lockmgr

4 years agoHAMMER VFS - Fix probable corruption case when filesystem becomes nearly full v2.7.2
Matthew Dillon [Mon, 19 Apr 2010 05:36:14 +0000 (22:36 -0700)]
HAMMER VFS - Fix probable corruption case when filesystem becomes nearly full

* The reblocking code was incorrectly assuming the cursor would be pointing
  at a valid node element after an unlock/relock sequence, when it could
  actually be pointing at the EOF of a node.  This case can occur when
  the filesystem is nearly full (possibly due to the reblocking operation
  itself), when the filesystem is also under load from unrelated
  operations.

* This can result in the creation of a corrupted B-Tree leaf node or
  data record.

* Corruption can be checked with hammer checkmap and hammer show
  (as of this rev):

  hammer -f device checkmap

Should output no B-Tree node records or free space mismatches.
You will still get the initial volume summary.

  hammer -f device show | egrep '^B' | egrep -v '^BM'

Should output no records.

* Currently the only recourse if corruption is found is to copy off the
  filesystem, newfs_hammer, and copy it back.

  Full history and snapshots can be retained by using 'hammer -B mirror-read'
  to copy off the filesystem and mirror-write to copy it back.  However,
  pleaes remember you must do this for each PFS individually.  Make sure
  you have a viable backup before newfsing anything.

Reported-by: Francois Tigeot <ftigeot@wolfpond.org>, Jan Lentfer <Jan.Lentfer@web.de>
4 years agoath - Fix module loading.
Antonio Huete Jimenez [Sun, 18 Apr 2010 22:44:54 +0000 (00:44 +0200)]
ath - Fix module loading.

This registers the modules ath_hal and ath_rate,
so they are properly handled.
Both are now a dependency for if_ath to provide
automatic loading upon if_ath load.
Also 'if_ath_load=YES' on /boot/loader.conf is
fixed with this commit.

4 years agox86_64 - Sync wlan options with GENERIC
Antonio Huete Jimenez [Sun, 18 Apr 2010 22:39:34 +0000 (00:39 +0200)]
x86_64 - Sync wlan options with GENERIC

4 years agoips - Mark queue_lock as LK_CANRECURSE
YONETANI Tomokazu [Sun, 18 Apr 2010 02:59:11 +0000 (11:59 +0900)]
ips - Mark queue_lock as LK_CANRECURSE

Originally queue_lock was an LWKT reader-writer locks, which permitted
multiple locks by the same thread, and in fact there are few code paths
where such multiple locking is used.  Doing the similar thing with lockmgr
lock without either LK_NOWAIT or LK_CANRECURSE triggers a panic.

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 17 Apr 2010 18:16:31 +0000 (11:16 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

4 years agoHAMMER VFS - Fix assertion panic related to record flush state
Matthew Dillon [Sat, 17 Apr 2010 18:12:02 +0000 (11:12 -0700)]
HAMMER VFS - Fix assertion panic related to record flush state

* This assertion can occur under certain circumstances if a rename
  operation moves a file or directory to a parent directory, due to
  a circular loop in the dependency chain.

* Fix the problem by allowing the case.

Reported-by: Sascha Wildner, Alex Hornung, Venkatesh Srinivas, others
4 years agoFix LINT kernel build.
Alexander Polakov [Sat, 17 Apr 2010 16:31:49 +0000 (20:31 +0400)]
Fix LINT kernel build.

4 years agoConnect mptutil(8) to the build.
Alexander Polakov [Fri, 16 Apr 2010 20:57:50 +0000 (00:57 +0400)]
Connect mptutil(8) to the build.

4 years agomptutil(8): fix build on DragonFly
Alexander Polakov [Fri, 16 Apr 2010 20:54:03 +0000 (00:54 +0400)]
mptutil(8): fix build on DragonFly

 * fix header paths
 * define SPECNAMELEN
 * use scsci_read_capacity_data_16 for scsi_read_capacity_data_long

4 years agoImport mptutil(8) from FreeBSD unmodified.
Alexander Polakov [Fri, 16 Apr 2010 20:41:22 +0000 (00:41 +0400)]
Import mptutil(8) from FreeBSD unmodified.

4 years agosound: implement OSS_GETVERSION.
Alexander Polakov [Fri, 2 Apr 2010 20:23:00 +0000 (00:23 +0400)]
sound: implement OSS_GETVERSION.

 It's required by some software, emulators/qemu to mention.

 Obtained-from: FreeBSD

4 years agodsched_fq - Overhaul locking
Alex Hornung [Sat, 17 Apr 2010 09:51:27 +0000 (09:51 +0000)]
dsched_fq - Overhaul locking

* use lockmgr lock for FQP lock, as some strategy ops can sleep while
  acquiring another lock (CAM SIM lock, for example).

* reduce overall locking when it isn't really required, mainly during
  deallocation (losing last ref) of objects. The locking is only
  explicitly required to protect the internal TAILQs.

* NOTE: this is an _attempt_ to fix some unidentified deadlocks that have
  been reported occasionally. While it shouldn't happen, be aware that
  this might explode.

Reported-by: Antonio Huete, Jan Lentfer
4 years agoFix ACPI global lock acquisition in x86_64.
Sascha Wildner [Sat, 17 Apr 2010 10:43:24 +0000 (13:43 +0300)]
Fix ACPI global lock acquisition in x86_64.

This fixes a number of grave issues on my Sony VAIO VGN-Z51XG, such as
messages about not being able to acquire the global lock, freezes when
ACPI was fully enabled and a panic at shutdown.

BTW, gcc had been warning us about it for a long time. :)

In-collaboration-with: aggelos

4 years agodsched - Correct some length modifiers to fix buildkernel for x86_64. v2.7.1
Antonio Huete Jimenez [Fri, 16 Apr 2010 23:16:31 +0000 (16:16 -0700)]
dsched - Correct some length modifiers to fix buildkernel for x86_64.

4 years agoAdd more __printflike()'s and fix resulting fallout.
Sascha Wildner [Fri, 16 Apr 2010 14:26:21 +0000 (16:26 +0200)]
Add more __printflike()'s and fix resulting fallout.

4 years agoMove memmove(), strcasecmp() and strncasecmp() in !defined(KERNEL_VIRTUAL).
Sascha Wildner [Fri, 16 Apr 2010 14:26:07 +0000 (16:26 +0200)]
Move memmove(), strcasecmp() and strncasecmp() in !defined(KERNEL_VIRTUAL).

This fixes the VKERNEL build.

4 years agoifconfig(1) - fix autoloading of kernel module
YONETANI Tomokazu [Fri, 16 Apr 2010 12:02:47 +0000 (21:02 +0900)]
ifconfig(1) - fix autoloading of kernel module

4 years agommc(4): Remove two unneeded .PATH lines in the Makefiles.
Sascha Wildner [Fri, 16 Apr 2010 12:21:08 +0000 (14:21 +0200)]
mmc(4): Remove two unneeded .PATH lines in the Makefiles.

4 years agoAdd a condvar(9) manual page (based on FreeBSD's).
Sascha Wildner [Fri, 16 Apr 2010 08:37:33 +0000 (10:37 +0200)]
Add a condvar(9) manual page (based on FreeBSD's).

Submitted-by: Venkatesh Srinivas <me@endeavour.zapto.org>
4 years agoBring in FreeBSD's MMC (MultiMediaCard) stack.
Sascha Wildner [Fri, 16 Apr 2010 07:57:29 +0000 (09:57 +0200)]
Bring in FreeBSD's MMC (MultiMediaCard) stack.

mmc(4)   - The MMC bus
sdhci(4) - Host controller driver
mmcsd(4) - Memory card disk device driver

SD, SDHC and MMC cards should be supported (tested with an SDHC card).

4 years ago<sys/kthread.h>: Add some __printflike()'s.
Sascha Wildner [Fri, 16 Apr 2010 07:07:30 +0000 (09:07 +0200)]
<sys/kthread.h>: Add some __printflike()'s.

This guards against wrong conversion from FreeBSD's kthread_create()
which takes two additional parameters.

Fix the resulting fallout in kern_sensors.c

4 years agodsched: Fix x86_64 buildkernel.
Sascha Wildner [Fri, 16 Apr 2010 06:21:51 +0000 (08:21 +0200)]
dsched: Fix x86_64 buildkernel.

4 years agoHAMMER Util - Add 'checkmap', adjust hammer show
Matthew Dillon [Fri, 16 Apr 2010 03:41:18 +0000 (20:41 -0700)]
HAMMER Util - Add 'checkmap', adjust hammer show

* Add a checkmap function which scans the B-Tree, collects byte usage,
  and checks it against the blockmap.  This is still experimental.

* Adjust hammer show to flag zone mismatches instead of asserting.

4 years agodsched - Change loader policy tunables (again)
Alex Hornung [Thu, 15 Apr 2010 22:20:03 +0000 (22:20 +0000)]
dsched - Change loader policy tunables (again)

* Change them to follow the standard, dotted, format. Now the three
  types are:
    - kern.dsched.policy.da0
    - kern.dsched.policy.da
    - kern.dsched.policy.default

Suggested-by: Sascha Wildner
4 years agodsched_fq - bump minor version
Alex Hornung [Wed, 14 Apr 2010 18:11:26 +0000 (18:11 +0000)]
dsched_fq - bump minor version

4 years agodsched_fq - Remove stale comment
Alex Hornung [Wed, 14 Apr 2010 18:05:52 +0000 (18:05 +0000)]
dsched_fq - Remove stale comment

* Remove a useless comment

4 years agodsched - change loader tunables
Alex Hornung [Tue, 13 Apr 2010 18:49:24 +0000 (18:49 +0000)]
dsched - change loader tunables

* Change loader tunables to dsched_pol avoiding the '*' character as it
  isn't supported by the loader.

Reported-by: Petr Janda
4 years agodsched_fq - Avoid a rare div by 0
Alex Hornung [Tue, 13 Apr 2010 18:47:51 +0000 (18:47 +0000)]
dsched_fq - Avoid a rare div by 0

* Avoid a rare division by 0 when calculating how busy the disk has
  been. It seems that sometimes the total disk time is 0, so when this
  happens, just assume that at least 1 us has passed.

4 years agodsched_fq - Refactor fqp allocation/destruction
Alex Hornung [Tue, 13 Apr 2010 07:15:10 +0000 (07:15 +0000)]
dsched_fq - Refactor fqp allocation/destruction

* Accept another argument for fqp allocation which is the corresponding
  fqmp. This is internally stored for proper self-removal out of the
  fqmp list on destruction.

* This parameter is also used to link the fqp into the fqmp list
  automatically on creation, avoiding code duplication and deadlocking.

* Changed the destruction refcount to -0x400 instead of -3 to make
  tracking of these cases simpler and not confuse them with bad
  refcounting.

* NOTE: this also fixes the longstanding issue of an eventual panic
  after a number of policy switches to/from fq.

Reported-by: Antonio Huete (tuxillo@)
4 years agodsched_fq - Avoid int64 overflow on total_budget
Alex Hornung [Fri, 9 Apr 2010 21:59:39 +0000 (21:59 +0000)]
dsched_fq - Avoid int64 overflow on total_budget

* Avoid an int64 overflow when calculating the total disk budget by
  losing bits of precision if needed.

* Note that this might not quite fix the issue yet, as there is one
  other place where the int64 overflow can happen, although it is less
  likely.

* While here, make the rebalancing happen every 0.5s instead of every
  1s, effectively reducing the chance of int64 overflows.

Reported-by: Antonio Huete (tuxillo@)
4 years agodsched_fq - Fix some issues, sprinkle some asserts
Alex Hornung [Fri, 9 Apr 2010 17:52:23 +0000 (17:52 +0000)]
dsched_fq - Fix some issues, sprinkle some asserts

* Add some strategic KKASSERT to catch negative values where they aren't
  allowed.

* Avoid certain race conditions by using a local variable instead of
  using the generally accessible one (budget vs dpriv->budgetpb). Only
  set the final value once we are ready.

4 years agodsched_fq - decentralize balancing code
Alex Hornung [Thu, 1 Apr 2010 11:34:36 +0000 (11:34 +0000)]
dsched_fq - decentralize balancing code

* Move the balancing code out of the fq_balance_thread into
  fq_balance_Self, which should be called from dispatchers.

* This essentially offloads the heavy processing onto (mostly) the
  processes/threads that do the I/O themselves.

4 years agodsched_fq - Refactor fq_balance_thread
Alex Hornung [Thu, 1 Apr 2010 08:40:50 +0000 (08:40 +0000)]
dsched_fq - Refactor fq_balance_thread

* Refactor fq_balance_thread to be an LWKT instead of callout.

* Also make sure fqp->transactions, fqp->avg_latency don't change while
  we use them.

4 years agodsched_fq - Finalize switch to new disk-busy calc
Alex Hornung [Thu, 1 Apr 2010 02:09:59 +0000 (02:09 +0000)]
dsched_fq - Finalize switch to new disk-busy calc

* Don't take the time since the last balancing run as a fixed value,
  instead calculate it.

* Remove extraneous craft that suggested a disk is only busy if it also
  has many incomplete requests.

4 years agodsched_fq - Refactor and clean; handle flushes
Alex Hornung [Thu, 1 Apr 2010 01:09:59 +0000 (01:09 +0000)]
dsched_fq - Refactor and clean; handle flushes

* Factor out an fq_drain which will either cancel or dispatch all the
  bios we have currently in all our fqp queues.

* Clean out old comments and code.

* Deal with flushes by not queuing them but rather letting dsched handle
  them. By returning EINVAL, dsched_queue will dispatch the flush
  itself.

4 years agoprint_backtrace - Take parameter count
Alex Hornung [Wed, 31 Mar 2010 10:44:25 +0000 (10:44 +0000)]
print_backtrace - Take parameter count

* Modify print_backtrace to take a parameter 'count' that specifies the
  maximum number of frames to print for the backtrace.

* Change all current consumers to use the new print_backtrace with count
  -1, resulting in the same behaviour as before this change.

* Remove cruft in dsched_fq that simulated this behaviour previously.

4 years agodsched_fq - properly drain all queues on teardown
Alex Hornung [Wed, 31 Mar 2010 10:19:38 +0000 (10:19 +0000)]
dsched_fq - properly drain all queues on teardown

* Properly drain all fqp queues on teardown to ensure that no bios and
  especially fqps are left dangling around.

* This should fix the occasional panic during policy switches.

4 years agodsched_fq - minor cleanup and fix
Alex Hornung [Wed, 31 Mar 2010 09:58:07 +0000 (09:58 +0000)]
dsched_fq - minor cleanup and fix

* Previously, wakes didn't correctly set the local idle bit in
  fq_dispatcher. Fix this by moving it into the right place.

* Remove old code, replace comments, remove level of indentation.

4 years agodsched_fq - Improve performance, reduce idle time
Alex Hornung [Wed, 31 Mar 2010 01:11:29 +0000 (01:11 +0000)]
dsched_fq - Improve performance, reduce idle time

* Boost performance by dynamically adapting the rate limit on throttled
  threads if the disk becomes idle. This will ensure that the disk is
  always > 90% used if there are requests queued.

4 years agodsched_fq - Improve disk busy-% calculation
Alex Hornung [Tue, 30 Mar 2010 13:46:01 +0000 (13:46 +0000)]
dsched_fq - Improve disk busy-% calculation

* Use the disk idle time to account for disk business instead of the
  number of in-flight requests.

Suggested-by: Simon "corecode" Schubert
4 years agodsched - Implement priorities and other improvements
Alex Hornung [Tue, 30 Mar 2010 02:18:32 +0000 (02:18 +0000)]
dsched - Implement priorities and other improvements

* Implemented fq priority support. This also includes the userland tool
  ionice.

* Implement an exit_buffer hook to be able to clean up bufs before they
  are reused.

* Some minor performance improvements in fq.

4 years agodsched - Add the FQ policy
Alex Hornung [Thu, 25 Feb 2010 08:55:55 +0000 (08:55 +0000)]
dsched - Add the FQ policy

* Add the FQ (fair queueing) policy for the dsched I/O scheduler
  framework.

* Right now, this is at best experimental; it only starts rate limiting
  when the disk is busy. Each process is allocated an equal fair amount
  of disk time, based on the average request latency and tps.
  If the disk is busy and one process exceeeds its fair share, its bios
  are queued for later dispatch.
  To avoid starvation of heavy write processes, heavy writes are
  interleaved once every 3 scheduler rebalances. The scheduler rebalance
  time is currently set to 1s, so that exceeding processes will be
  limited after this period.

* While I've done some limited testing on switching policies at runtime
  and even under heavy I/O going on, it is not recommended to do this,
  as some problems will crop up.

* Future work to do:
- stabilization pass
- adding bucket support (i.e. having different priority buckets
  for groups of processes, so that for example processes A,B and
  C get a total aggregate of 80% disk time, while processes D
  and E get a total aggregate of 20%, instead of each process
  getting 20%)
- adding an "ionice" userland tool to allow to change the
  bucket/priority of a process

4 years agodsched - Tie the dsched framework into the system
Alex Hornung [Thu, 25 Feb 2010 08:54:32 +0000 (08:54 +0000)]
dsched - Tie the dsched framework into the system

* tie the dsched framework into the system by binding it into the build,
  adding all the necessary hooks and other calls.

4 years agodsched - import the I/O scheduler framework dsched
Alex Hornung [Thu, 25 Feb 2010 08:53:01 +0000 (08:53 +0000)]
dsched - import the I/O scheduler framework dsched

* Import my branch of the I/O scheduler framework. This commit only
  introduces the core dsched framework, without binding it into the
  system and without any policy except for the default one.

4 years agoif_ath - Properly remove sysctls on detach.
Antonio Huete Jimenez [Thu, 15 Apr 2010 17:37:19 +0000 (19:37 +0200)]
if_ath - Properly remove sysctls on detach.

Submitted-by: Johannes Hofmann <johannes.hofmann@gmx.de>
4 years agosystem boot - Fix savecore when swapdev != dumpdev
Matthew Dillon [Thu, 15 Apr 2010 17:36:40 +0000 (10:36 -0700)]
system boot - Fix savecore when swapdev != dumpdev

* Specify the dumpdev on the savecore line.  Fixed issues when the swapdev
  is not the same as the dumpdev.

Reported-by: Alexander Polakov <polachok@gmail.com>
4 years ago<sys/buf2.h>: Add bioq_takefirst() from FreeBSD for easier driver porting.
Sascha Wildner [Thu, 15 Apr 2010 15:44:22 +0000 (17:44 +0200)]
<sys/buf2.h>: Add bioq_takefirst() from FreeBSD for easier driver porting.

4 years agoRemove the inclusion of <machine/bus_at386.h> from some WLAN drivers.
Sascha Wildner [Thu, 15 Apr 2010 15:37:49 +0000 (17:37 +0200)]
Remove the inclusion of <machine/bus_at386.h> from some WLAN drivers.

This file exists only on i386. Including it is not needed at all since
<sys/bus.h> on i386 already brings it in (via <machine/bus_dma.h>) and
also does the right thing in x86_64.

This fixes module building on x86_64.

4 years agoMerge remote branch 'rpaulo/net80211-update'
Matthew Dillon [Wed, 14 Apr 2010 15:30:28 +0000 (08:30 -0700)]
Merge remote branch 'rpaulo/net80211-update'

4 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 14 Apr 2010 15:30:15 +0000 (08:30 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly