dragonfly.git
10 years agokernel/dev: Remove some #include duplicates.
Sascha Wildner [Thu, 4 Jul 2013 20:01:31 +0000 (22:01 +0200)]
kernel/dev: Remove some #include duplicates.

10 years agokernel/asr: Clean up the include jungle a bit.
Sascha Wildner [Thu, 4 Jul 2013 19:56:47 +0000 (21:56 +0200)]
kernel/asr: Clean up the include jungle a bit.

10 years agokernel/aic: Remove redundant #ifdefs.
Sascha Wildner [Thu, 4 Jul 2013 19:33:15 +0000 (21:33 +0200)]
kernel/aic: Remove redundant #ifdefs.

10 years agokernel - Flesh out AHCI 1.3 regs / detection (FBSS not yet supported)
Matthew Dillon [Thu, 4 Jul 2013 04:39:57 +0000 (21:39 -0700)]
kernel - Flesh out AHCI 1.3 regs / detection (FBSS not yet supported)

* Detect the CAP2 register.  Add definitions for new CAP and CAP2 bits.

* Detect and report FBSS support when a PM is attached.  Note that
  the driver does not yet support FBSS (I'm still tring to find a
  mobo whos AHCI has it).

10 years agofirmware.9: Adjust ARM specific example to one from our tree.
Sascha Wildner [Thu, 4 Jul 2013 00:43:14 +0000 (02:43 +0200)]
firmware.9: Adjust ARM specific example to one from our tree.

10 years agosys/conf/files: Adjust some excessive tabs.
Sascha Wildner [Thu, 4 Jul 2013 00:40:16 +0000 (02:40 +0200)]
sys/conf/files: Adjust some excessive tabs.

10 years agokernel: Remove unused invlpg() function
François Tigeot [Wed, 3 Jul 2013 06:36:49 +0000 (08:36 +0200)]
kernel: Remove unused invlpg() function

10 years agokernel - Remove Warning: busy page %p found in cache
Matthew Dillon [Wed, 3 Jul 2013 00:56:23 +0000 (17:56 -0700)]
kernel - Remove Warning: busy page %p found in cache

* Remove the "Warning: busy page %p found in cache" kprintf.  DragonFly
  now allows VM pages to be busied regardless of what queue they are or
  are not on.

10 years agokernel/platform: Remove some #include duplicates.
Sascha Wildner [Tue, 2 Jul 2013 20:14:13 +0000 (22:14 +0200)]
kernel/platform: Remove some #include duplicates.

10 years agokernel/oce: Fix sysctl names and firmware updating instructions.
Sascha Wildner [Tue, 2 Jul 2013 18:35:42 +0000 (20:35 +0200)]
kernel/oce: Fix sysctl names and firmware updating instructions.

10 years agovkernel - Fix frustrating VKE mac address bug
Matthew Dillon [Tue, 2 Jul 2013 00:24:26 +0000 (17:24 -0700)]
vkernel - Fix frustrating VKE mac address bug

* Fix a very frustrating bug where VKE would sometimes ignore packets.
  It turns out that the default randomly-generated ether mac address
  was not being properly zero'd, leaving uninitialized locations in
  bytes 0 and 1 which would sometimes make the MAC look like a multicast
  address.

Reported-by: Frustrated tuxilo
10 years agokernel/oce: Fix wrong maxsegs argument for bus_dmamap_load_mbuf_segment().
Sascha Wildner [Mon, 1 Jul 2013 21:14:09 +0000 (23:14 +0200)]
kernel/oce: Fix wrong maxsegs argument for bus_dmamap_load_mbuf_segment().

Mindlessly introduced by me after it was tested by Mihai and led to a
panic.

I had misunderstood a comment by sephe. OCE_MAX_TX_ELEMENTS is (as the
name implies) just for the tx path.

Reported-by: Mihai Carabas <mihai.carabas@gmail.com>
10 years agolibc/getdevpath: Remove unneeded strlen().
Sascha Wildner [Mon, 1 Jul 2013 21:05:23 +0000 (23:05 +0200)]
libc/getdevpath: Remove unneeded strlen().

10 years agooce.4: Add ifmedia(4) reference.
Sascha Wildner [Mon, 1 Jul 2013 19:06:35 +0000 (21:06 +0200)]
oce.4: Add ifmedia(4) reference.

10 years agokernel/netif: Bring in the oce(4) driver for Emulex OneConnect 10Gb NICs.
Sascha Wildner [Mon, 1 Jul 2013 16:23:05 +0000 (18:23 +0200)]
kernel/netif: Bring in the oce(4) driver for Emulex OneConnect 10Gb NICs.

According to the manual page, it supports:

* Emulex BladeEngine 2
* Emulex BladeEngine 3
* Emulex Lancer

It seems to be in solid shape, but some features remain yet unported
(such as MSI-X support). Also, the module is named 'if_oce.ko' in
DragonFly (like it is with all other network drivers) instead of
'oce.ko' like in FreeBSD.

The driver was tested by Mihai Carabas with a BladeEngine 3 adapter.

Taken-from:         FreeBSD
Additional-clue-by: sephe
10 years agocomplex.3: Use %O for URLs.
Sascha Wildner [Sun, 30 Jun 2013 20:18:14 +0000 (22:18 +0200)]
complex.3: Use %O for URLs.

10 years agokernel/802.11: Use the proper enum for ic_vap_create()'s opmode parameter.
Sascha Wildner [Sun, 30 Jun 2013 02:47:18 +0000 (04:47 +0200)]
kernel/802.11: Use the proper enum for ic_vap_create()'s opmode parameter.

10 years agokernel - Fix #2570 - Missing assignment in recent pageout commit
Matthew Dillon [Sat, 29 Jun 2013 02:41:47 +0000 (19:41 -0700)]
kernel - Fix #2570 - Missing assignment in recent pageout commit

* Don't forget to assign ma[page_base] to p;

Reported-by: David Shao
10 years agokernel - Change lwkt_wait_ipiq() to use the TSC
Matthew Dillon [Thu, 27 Jun 2013 21:10:48 +0000 (14:10 -0700)]
kernel - Change lwkt_wait_ipiq() to use the TSC

* lwkt_wait_ipiq() was using a static counter/constant for its failsafe
  panic, which can vary immensly over time and might not be long enough
  for systems running under VMs.

* Change the code to use the TSC api to properly time the failsafe.  It
  will generate warnings each second and panic at 10 seconds if the IPIQ
  fails to drain.

Reported-by: marino
10 years agokernel: Fix compiling tmpfs into the kernel.
Sascha Wildner [Thu, 27 Jun 2013 16:28:33 +0000 (18:28 +0200)]
kernel: Fix compiling tmpfs into the kernel.

10 years agokernel - Wakeup threads blocked in the VM page allocator more quickly
Matthew Dillon [Thu, 27 Jun 2013 06:40:29 +0000 (23:40 -0700)]
kernel - Wakeup threads blocked in the VM page allocator more quickly

Additional tuning to changes in the way the pageout daemon and VM system
wakes up threads blocked allocating normal VM pages.  Previously the VM
system would wait for the vm_paging_target() to be reached before waking
up all waiters, and had code to try to wakeup individual threads past
the minimum.

This just didn't work very well on machines with lots of memory because
it could take quite a long time for the pageout daemon to actually reach
the vm_paging_target() (and VM load could prevent it from being reached at
all!).  Many threads could wind up being blocked indefinitely waiting for
cache and/or free page counts to reach reasonable levels.

The solution is to give the kernel time to build up a smaller number
of free+cache pages beyond the minimum, enough to give all waiting threads
a fair shot at allocating at least one page, and then simply wakeup all
the waiters.  This hysteresis is set smallish on purpose, defaulting to
a value of 16 in order to avoid holding threads blocked for excessive
periods of time.

Under heavy VM loads this creates an overlap between memory consumers and
the pageout daemon, allowing the pageout daemon to run continuously in
these situations.

* Add the vm.page_free_hysteresis sysctl, initialized to 16.  This field
  specifies a small number of pages past the minimum required for normal
  system operation before the VM system will wakeup threads blocked in the
  VM page allocator.

* Adjust tmpfs to force-free pages through the hysteresis value to reduce
  degenerate block/wakeup situations under heavy VM loads.

10 years agokernel - Sync numerous commits from FreeBSD
Matthew Dillon [Thu, 27 Jun 2013 05:42:56 +0000 (22:42 -0700)]
kernel - Sync numerous commits from FreeBSD

Synchronize a bunch of commits from the FreeBSD tree.  Commit
ids shown below are from the github FreeBSD repo.

Several commits were not synchronized, the main one being 3c7b39f7b5a4...
(Bring in LSI's latest mps(4) 6Gb SAS and WarpDrive driver, version).
This one needs to be brought in.

One other note, not yet fixed is an issue where the driver configures
many more tags than the disk drive can actually support.  In my test
case, 255 tags for a Seagate SAS disk that really only seems to support
63.  When large numbers of commands are queued, and even sometimes when
not, the drive becomes severely inefficient for reads and writes.  Write
bandwidth that is usually in the ~30-50 MB/s range drops to ~5 MB/s.

Doing a camcontrol to reduce tags to ~16 or so seems to fix the issue.
(camcontrol tags da0 -N 16), but we need a permanent solution for this
problem.

56527fa077227f78a92c9ebc6f4f35d1bc3e1c21

  Bring in a number of mps(4) driver fixes from LSI:

    1.  Fixed timeout specification for the msleep in mps_wait_command().
        Added 30 second timeout for mps_wait_command() calls in mps_user.c.

    2.  Make sure we call mps_detach_user() from the kldunload path.

    3.  Raid Hotplug behavior change.

        The driver now removes a volume when it goes to a failed state,
        so we also need to add volume back to the OS when it goes to
        opitimal/degraded/online from failed/missing.

        Handle raid volume add and remove from the IR_Volume event.
    4.  Added some more debugging information.

    5.  Replace xpt_async(AC_LOST_DEVICE, path, NULL) with
        mpssas_rescan_target().

        This is to work around a panic in CAM that shows up when adding a
        drive with a rescan and removing another device from the driver thread
        with an AC_LOST_DEVICE async notification.

        This problem was encountered in testing with the LSI sas2ircu utility,
        which was used to create a RAID volume from physical disks.  The driver
        has to create the RAID volume target and remove the physical disk
        targets, and triggered a panic in the process.

        The CAM issue needs to be fully diagnosed and fixed, but this works
        around the issue for now.

    6.  Fix some memory initialization issues in mps_free_command().

    7.  Resolve the "devq freeze forever" issue.  This was caused by the
        internal read capacity command issued in the non-head version of the
        driver.  When the command completed with an error, the driver wasn't
        unfreezing thd device queue.

        The version in head uses the CAM infrastructure for getting the read
        capacity information, and therefore doesn't have the same issue.

    8.  Bump the version to 13.00.00.00-fbsd. (this is very close to LSI's
        internal stable driver 13.00.00.00)

ebc4133dca40744e7e5a2037e613bf403a16cc65

    Return BUS_PROBE_DEFAULT instead of BUS_PROBE_VENDOR from the mps driver
    probe routine.

    This will allow LSI to ship drivers that return BUS_PROBE_VENDOR to
    override the in-tree version of the driver.

dce65ce6be9088b0a0444b5f603e5f110a76e249

    Set the max_lun field of the path inquiry CCB to 8.

    This allows LUNs greater than 0 to be probed.  It can be increased later if
    need be.

    This brings back SVN rev 224973, which was inadvertently removed with the
    import of the LSI driver.

4b86692e31efa1f09f72ff85635a3fdfe28368c5 (not synchronized)

    (Make the mps(4) module depend on the cam module)

8473fac9559e9e3560fcd37c558101cd1718ba01 (originated from DragonFly)

    (Correct sizeof usage)

3c7b39f7b5a4dac525c1cf3896051741096de47a (not synchronized - TODO!)

    (Bring in LSI's latest mps(4) 6Gb SAS and WarpDrive driver, version)

0069682926e482627d3f64225ad0ad6018023ce6 (not synchronized)

    Change the mps(4) driver to only scan a target if that is what is
    needed instead of scanning the full bus every time.

5f97d83a2bb253e5fadfc217cb66c65542557a91

    Fix a small memory leak in mpssas_get_sata_identify().  The change has been
    submitted upstream as well.

e5c6ca6783da2418a0046f43f47977f4534925d3

    Fix kernel panic on `camcontrol reset` for specific target, caused by
    uninitialized cm_targ in mpssas_action_resetdev().

d35997f97e5bca6ac7e1dffebc4f7bc0bf4a168e

    Several fixes to allow firmware/BIOS flash access from user-level:
    Set max DMA segment size to 24bit, as MPI SGE supports it.
    Use mps_add_dmaseg() to add empty SGE instead of custom code.
    Tune endianness safety.

8600cbb5b6ebb06db859c9e2c76d07be50b8ff6a

    Correct double "the the"

5277f913de0e34474af844aed711a14c28c20d2b (not synchronized)

    (Add casts to unbreak the i386 PAE build for the mps(4) driver.)

f124bf985f4786c8ddd24f5127e7bf200d0396ad

    Don't lose the 255'th disk behind the initiator.

3f7a414911a892c8c84206394eb643cbde706d20 (already synchronized)

    remove duplicate semicolons where possible.

bd7f0fa0bb4b7b0f87227e0c4d49a4bd9b113cf0 (not synchronized)

    (Reform the busdma API so that new types may be added without modifying...)

8857575b13cf118cc89efb1b462dd314df09c180 (not applicable)

    (Replace the TDP_NOSLEEPING flag with a counter so that the)

674a0b97f5232c5275bfd0394620e7809315c694 (not applicable)

    (Except one case mps(4) driver does not touch the data and works well...)

3d32e6b10c85bbbaea953937412778787bba3629

    MFprojects/camlock r248982:
    Stop abusing xpt_periph in random plases that really have no periph related

bf0ecb667034d07b6288c04623d895a0919377c0

    Fix uninitialized warning in mps

0389554b1afa82981e507befda68b56631251990

    Fix NULL-dereference kernel panic in case of mps_attach() failure.

9a638117821b8de32c1f05d7244562702b4155b6

    Fix uninitialized memory reference in mps_read_config_page.  It was
    ...

10 years agotmpfs - Handle low memory situations a little better (2)
Matthew Dillon [Thu, 27 Jun 2013 01:41:19 +0000 (18:41 -0700)]
tmpfs - Handle low memory situations a little better (2)

* When handling pageout daemon requests we want to try to free pages
  directly to the VM page cache or the freeq and not necessarily cycle
  them through active or inactive.

  Shortcutting to the cache/free queues will allow the machine to
  unstick much more quickly which is particularly important on boxes
  with a lot of memory because the pageout hysteresis runs in such a
  large range.

* Greatly improves monster's performance under extreme tmpfs write loads.

10 years agokernel - Improve pageout daemon for tmpfs write load
Matthew Dillon [Thu, 27 Jun 2013 01:07:50 +0000 (18:07 -0700)]
kernel - Improve pageout daemon for tmpfs write load

* Rewrite vm_object_page_collect() and vm_pageout_clean() to align the
  set of pages being flushed to a swap cache stripe (~16-32 pages).

* Do a better job tracking how many pages have been cleaned by the pageout
  daemon.

* Setup an iterator and allow the inactive scan and the active scan to
  break out of their respective loops if they meet their quota early.

* Disable the swap iterator for now, it has not been shown to improve
  matters (yet).

10 years agotmpfs - Handle low memory situations a little better
Matthew Dillon [Thu, 27 Jun 2013 00:34:58 +0000 (17:34 -0700)]
tmpfs - Handle low memory situations a little better

* When memory starts to get low start bdwrite()ing buffers on file
  write instead of buwrite()ing them to force the data to start staging
  through the buffer cache.

* Rename some generic defines BSIZE / BMASK -< TMPFS_BLKSIZE / TMPFS_BLKMASK

* Set b_act_count to 0 and B_RELBUF in the pageout case to force the
  underlying VM pages to recycle to the inactive queue after the I/O is
  complete.

10 years agocpdup - native linux compile
Matthew Dillon [Wed, 26 Jun 2013 17:07:42 +0000 (10:07 -0700)]
cpdup - native linux compile

* Add an #ifdef to define away __ specials so a straight build under
  linux works on unmodified sources.

10 years agolibthread_xu - Remove unconditional debugging, slight code flow adjustment
Matthew Dillon [Wed, 26 Jun 2013 17:04:35 +0000 (10:04 -0700)]
libthread_xu - Remove unconditional debugging, slight code flow adjustment

* Remove an unconditional fprintf to stderr that is no longer needed

* Ensure that __thr_umtx_timedlock() doesn't break out on EINTR.  Note
  however that the functions it calls shouldn't be able to return EINTR
  so this change is really just to make things look more correct.

10 years agombuf: Cache align mbuf statistics
Sepherosa Ziehau [Wed, 26 Jun 2013 03:07:31 +0000 (11:07 +0800)]
mbuf: Cache align mbuf statistics

10 years agombuf: Cache align mbuf type statistics
Sepherosa Ziehau [Wed, 26 Jun 2013 02:19:12 +0000 (10:19 +0800)]
mbuf: Cache align mbuf type statistics

10 years agoroute.8: Mention -msl, -iw and -iwmax
Sepherosa Ziehau [Tue, 25 Jun 2013 13:00:26 +0000 (21:00 +0800)]
route.8: Mention -msl, -iw and -iwmax

10 years agonetrate/netperf: Record min/max results and calculate Jain's fairness index
Sepherosa Ziehau [Tue, 25 Jun 2013 08:20:02 +0000 (16:20 +0800)]
netrate/netperf: Record min/max results and calculate Jain's fairness index

10 years agonetrate/netperf: %.2f should be accurate enough
Sepherosa Ziehau [Tue, 25 Jun 2013 07:39:44 +0000 (15:39 +0800)]
netrate/netperf: %.2f should be accurate enough

10 years agocarp: Prioritize carp advertisement packets
Sepherosa Ziehau [Tue, 25 Jun 2013 07:36:15 +0000 (15:36 +0800)]
carp: Prioritize carp advertisement packets

10 years agocarp: Constify carp_etheraddr
Sepherosa Ziehau [Tue, 25 Jun 2013 07:17:02 +0000 (15:17 +0800)]
carp: Constify carp_etheraddr

10 years agoethernet: Constify the lladdr pointer passed to ether_ifattach()
Sepherosa Ziehau [Tue, 25 Jun 2013 07:15:57 +0000 (15:15 +0800)]
ethernet: Constify the lladdr pointer passed to ether_ifattach()

10 years agocarp: Increment output statistics properly
Sepherosa Ziehau [Tue, 25 Jun 2013 07:10:45 +0000 (15:10 +0800)]
carp: Increment output statistics properly

10 years agocarp: Add TSO and TXCSUM support
Sepherosa Ziehau [Tue, 25 Jun 2013 04:38:31 +0000 (12:38 +0800)]
carp: Add TSO and TXCSUM support

The carp's ifnet.if_hwassist is inheritted from the parent device.

10 years agolibbz2: Add two missing private symbols to the map
John Marino [Mon, 24 Jun 2013 15:44:48 +0000 (17:44 +0200)]
libbz2: Add two missing private symbols to the map

10 years agolibncurses: Include symbols for wide character support
John Marino [Mon, 24 Jun 2013 11:28:27 +0000 (13:28 +0200)]
libncurses: Include symbols for wide character support

10 years agolibz: Fix typo on Symbol map
John Marino [Mon, 24 Jun 2013 07:45:32 +0000 (09:45 +0200)]
libz: Fix typo on Symbol map

This typo was discovered as fallout from a dports test run meant to
verify the new versioned system libraries.

10 years agoem: 82543 and 82542 could only suport 256 TX/RX descriptors
Sepherosa Ziehau [Mon, 24 Jun 2013 08:58:48 +0000 (16:58 +0800)]
em: 82543 and 82542 could only suport 256 TX/RX descriptors

10 years agoem/emx: Update man page
Sepherosa Ziehau [Sun, 23 Jun 2013 12:51:04 +0000 (20:51 +0800)]
em/emx: Update man page

10 years agoigb: Update man page
Sepherosa Ziehau [Fri, 21 Jun 2013 08:58:40 +0000 (16:58 +0800)]
igb: Update man page

10 years agoman/bnx: Add minor clarification
Sepherosa Ziehau [Fri, 21 Jun 2013 08:57:48 +0000 (16:57 +0800)]
man/bnx: Add minor clarification

10 years agocputimer: Allow MP synchronized TSC to become cputimer on x86_64
Sepherosa Ziehau [Fri, 21 Jun 2013 01:26:37 +0000 (09:26 +0800)]
cputimer: Allow MP synchronized TSC to become cputimer on x86_64

sysclock_t stays as 32bits, as suggested by dillon@.

The TSC cputimer frequency is scaled down TSC frequency (less or equal
to 128Mhz), which makes 32bits sysclock_t counter hold at least 33
seconds.

The TSC cputimer is obviously faster than other cputimers, e.g. HPET or
ACPI timer, so it has the highest priority as of this commit.  It is
enabled by default, if MP synchronized TSC is detected.  It could be
disabled by setting tunable hw.tsc_cputimer_enable to 0.

10 years agofstat(1): tmpfs support
Sascha Wildner [Thu, 20 Jun 2013 20:55:52 +0000 (22:55 +0200)]
fstat(1): tmpfs support

10 years ago<vfs/tmpfs/tmpfs.h>: Hide some stuff from userland.
Sascha Wildner [Thu, 20 Jun 2013 20:33:51 +0000 (22:33 +0200)]
<vfs/tmpfs/tmpfs.h>: Hide some stuff from userland.

10 years agopnpinfo(1): Use errx(), use correct variable (from FreeBSD).
Sascha Wildner [Thu, 20 Jun 2013 19:45:57 +0000 (21:45 +0200)]
pnpinfo(1): Use errx(), use correct variable (from FreeBSD).

10 years agofstat(1): Style changes: Remove param names from protos and staticise.
Sascha Wildner [Thu, 20 Jun 2013 16:30:54 +0000 (18:30 +0200)]
fstat(1): Style changes: Remove param names from protos and staticise.

10 years agofstat(1): Put the v_type -> mode_t conversion into a separate function.
Sascha Wildner [Thu, 20 Jun 2013 16:25:04 +0000 (18:25 +0200)]
fstat(1): Put the v_type -> mode_t conversion into a separate function.

10 years agocputimer: Increase distance between priorities
Sepherosa Ziehau [Thu, 20 Jun 2013 05:00:57 +0000 (13:00 +0800)]
cputimer: Increase distance between priorities

10 years agoaltq: Use tsc_mpsync to detect whether TSC could be used or not
Sepherosa Ziehau [Thu, 20 Jun 2013 03:34:22 +0000 (11:34 +0800)]
altq: Use tsc_mpsync to detect whether TSC could be used or not

10 years agoclock/tsc: Detect invariant TSC CPU synchronization
Sepherosa Ziehau [Thu, 20 Jun 2013 03:10:03 +0000 (11:10 +0800)]
clock/tsc: Detect invariant TSC CPU synchronization

The detected result could be used to determine whether TSC could be
used as cputimer or not, and could be used by other stuffs, e.g.
CoDel AQM packet time stamping.

- Only invariant TSC will be tested
- If there is only one CPU, then invariant TSC is always synchronized
- Only CPUs from Intel are tested (*)

The test is conducted using lwkt_cpusync interfaces:
BSP read the TSC, then ask APs to read TSC.  If TSC read from any APs
is less then the BSP's TSC, the invariant TSC is not synchronized
across CPUs.

Currently the test runs ~100ms.

(*)
AMD family 15h model 00h-0fh may also have synchronized TSC across
CPUs as pointed out by vsrinivas@, however, according to AMD:

  <Revision Guide for AMD Family 15h Models 00h-0Fh Processors
   Rev. 3.18 October 2012>
  759 One Core May Observe a Time Stamp Counter Skew

AMD family 15h model 00h-0fh is _not_ ready yet.

10 years agobsd-family-tree: Sync with FreeBSD (NetBSD 5.2, 6.0.1, 6.0.2).
Sascha Wildner [Wed, 19 Jun 2013 17:19:42 +0000 (19:19 +0200)]
bsd-family-tree: Sync with FreeBSD (NetBSD 5.2, 6.0.1, 6.0.2).

10 years agonet: Use tsc_invariant when it is necessary; mainly in time measure
Sepherosa Ziehau [Wed, 19 Jun 2013 08:54:41 +0000 (16:54 +0800)]
net: Use tsc_invariant when it is necessary; mainly in time measure

10 years agoclock/tsc: Detect invariant TSC
Sepherosa Ziehau [Wed, 19 Jun 2013 08:37:55 +0000 (16:37 +0800)]
clock/tsc: Detect invariant TSC

According to Intel's description:
"The invariant TSC will run at a constant rate in all ACPI P-, C-. "
 and T-states. ..."

The difference between invariant TSC and constant TSC is that
invariant TSC is not affected by frequency changes and deep ACPI
C-state.

Constant TSC could be detected based on the CPU model (Intel has
the model list, while there is no information from AMD's document);
constant TSC is not detected yet.

10 years agoclock: Use sysclock_t to save value from sys_cputimer->count()
Sepherosa Ziehau [Wed, 19 Jun 2013 04:21:46 +0000 (12:21 +0800)]
clock: Use sysclock_t to save value from sys_cputimer->count()

10 years agosio: Use sysclock_t to save value from sys_cputimer->count()
Sepherosa Ziehau [Wed, 19 Jun 2013 03:14:56 +0000 (11:14 +0800)]
sio: Use sysclock_t to save value from sys_cputimer->count()

10 years agocputimer: The freq should be sysclock_t
Sepherosa Ziehau [Wed, 19 Jun 2013 02:55:24 +0000 (10:55 +0800)]
cputimer: The freq should be sysclock_t

This prepares for 64bit sysclock_t

10 years agofstat(1): fsp is in fact used.
Sascha Wildner [Tue, 18 Jun 2013 16:18:00 +0000 (18:18 +0200)]
fstat(1): fsp is in fact used.

10 years agofstat(1) - Add support for EXT2FS filesystem.
Antonio Huete Jimenez [Tue, 18 Jun 2013 10:35:03 +0000 (12:35 +0200)]
fstat(1) - Add support for EXT2FS filesystem.

10 years agoaltq: Clean up the code for PCC usage detection
Sepherosa Ziehau [Tue, 18 Jun 2013 05:34:25 +0000 (13:34 +0800)]
altq: Clean up the code for PCC usage detection

10 years agopolling: Fix comment
Sepherosa Ziehau [Tue, 18 Jun 2013 01:55:00 +0000 (09:55 +0800)]
polling: Fix comment

10 years agofstat(1) - Add support for NTFS filesystem.
Antonio Huete Jimenez [Mon, 17 Jun 2013 22:40:43 +0000 (00:40 +0200)]
fstat(1) - Add support for NTFS filesystem.

10 years agontfs - Expose NTFS structures to userland.
Antonio Huete Jimenez [Mon, 17 Jun 2013 22:34:46 +0000 (00:34 +0200)]
ntfs - Expose NTFS structures to userland.

10 years agofstat(1) - Add support for HAMMER filesystem.
Antonio Huete Jimenez [Mon, 17 Jun 2013 18:10:14 +0000 (20:10 +0200)]
fstat(1) - Add support for HAMMER filesystem.

- Also use %u for printing major/minor to avoid overflows.

10 years agohammer - Allow userland programs to access hammer.h definitions
Antonio Huete Jimenez [Mon, 17 Jun 2013 13:41:14 +0000 (15:41 +0200)]
hammer - Allow userland programs to access hammer.h definitions

Expose hammer.h to userland, programs like fstat(1) might need some
of the structs (struct hammer_inode).

10 years agombuf: Add comment about the remaining implicit padding on x86_64
Sepherosa Ziehau [Mon, 17 Jun 2013 09:46:11 +0000 (17:46 +0800)]
mbuf: Add comment about the remaining implicit padding on x86_64

10 years agomtag: u_intXX_t -> uintXX_t; no functional changes
Sepherosa Ziehau [Mon, 17 Jun 2013 09:42:16 +0000 (17:42 +0800)]
mtag: u_intXX_t -> uintXX_t; no functional changes

10 years agombuf: Save 16 bytes from pkthdr on x86_64
Sepherosa Ziehau [Mon, 17 Jun 2013 09:28:26 +0000 (17:28 +0800)]
mbuf: Save 16 bytes from pkthdr on x86_64

- 'wlan_seqno' is not necessary, reuse the 'ether_vlantag'
- Not all parts of 'pkthdr_br' is useful; save the ethernet source
  address should be enough.
- Move 'len' after 'header', on x86_64:
  o  Remove the implicit 4 bytes padding
  o  'len' is still in the same cacheline as before this commit
     (m_hdr is 160 bytes as of this commit)
  o  Make the size of the fields after 'header' but before the 'pf'
     8 bytes aligned, so there will be on implicit padding before 'pf'

10 years agolibc: Add symbol versions (not active)
John Marino [Sun, 16 Jun 2013 23:21:53 +0000 (01:21 +0200)]
libc: Add symbol versions (not active)

10 years agombuf: White space cleanup and use uintXX_t instead of u_intXX_t
Sepherosa Ziehau [Mon, 17 Jun 2013 02:36:51 +0000 (10:36 +0800)]
mbuf: White space cleanup and use uintXX_t instead of u_intXX_t

No functional changes.

10 years agoaltq: Update comment
Sepherosa Ziehau [Sun, 16 Jun 2013 13:55:44 +0000 (21:55 +0800)]
altq: Update comment

10 years agobnx: Update man page
Sepherosa Ziehau [Sun, 16 Jun 2013 13:40:11 +0000 (21:40 +0800)]
bnx: Update man page

10 years agoFix some typos in manual pages.
Sascha Wildner [Sun, 16 Jun 2013 12:58:20 +0000 (14:58 +0200)]
Fix some typos in manual pages.

10 years agolibc/fmtmsg: Check the correct variable against MM_NULLACT.
Sascha Wildner [Sat, 15 Jun 2013 07:42:48 +0000 (09:42 +0200)]
libc/fmtmsg: Check the correct variable against MM_NULLACT.

Taken-from: FreeBSD (r199046)

10 years agoRemove some unused variables.
Sascha Wildner [Fri, 7 Jun 2013 18:46:15 +0000 (20:46 +0200)]
Remove some unused variables.

10 years agolibncurses: Add symbol versions (not active)
John Marino [Fri, 14 Jun 2013 22:54:37 +0000 (00:54 +0200)]
libncurses: Add symbol versions (not active)

10 years agolibedit: Add symbol versions (not active)
John Marino [Fri, 14 Jun 2013 21:13:39 +0000 (23:13 +0200)]
libedit: Add symbol versions (not active)

10 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sat, 15 Jun 2013 07:12:30 +0000 (09:12 +0200)]
Update the pciconf(8) database.

June 6, 2013 snapshot from http://pciids.sourceforge.net/

10 years agohammer2 - pfsmount -> clustermount separation part 2
Matthew Dillon [Sat, 15 Jun 2013 00:44:25 +0000 (17:44 -0700)]
hammer2 - pfsmount -> clustermount separation part 2

* Further separate the high-level VNOPS/inode (hammer2_pfsmount) layer
  from the lower level device (hammer2_mount, hammer2_chain) layer.

* Remove hmp fields from hammer2_trans and hammer2_inode.

* Add hammer2_cluster to the pfsmount as degenerate case for now.  This
  will be used to list all devices backing the PFS mount, pertaining to
  the copies mechanism.

* Run all logical (file) buffer cache operations through the device buffer
  cache.  Remove previous direct-mapped shortcuts and disable BMAP for now.

  Basically the issue here is that with multiple devices backing a HAMMER2
  mount, the normal file buffer cache 'cached disk offset' operations used
  to shortcut I/O just won't work.  We can add the shortcut back in later
  for single-backing-device mounts but for now separate them out entirely
  and bcopy() between them.

* This will also make it easier for the GSOC H2 file compression project.

* Restore some of the lost performance by using the newly implemented
  cluster_readcb() buffer cache function.

10 years agokernel - Add cluster_readcb()
Matthew Dillon [Sat, 15 Jun 2013 00:42:11 +0000 (17:42 -0700)]
kernel - Add cluster_readcb()

* This function is similar to breadcb() in that it issues the requested
  buffer I/O asynchronously with a callback, but then also clusters
  additional asynchronous I/Os (without a callback) to improve performance.

* Used by HAMMER2 to improve performance.

10 years agolibmd: Add symbol versions (not active)
John Marino [Fri, 14 Jun 2013 16:03:09 +0000 (18:03 +0200)]
libmd: Add symbol versions (not active)

10 years agolibarchive: Use vendor version numbers instead of DF306
John Marino [Fri, 14 Jun 2013 15:49:50 +0000 (17:49 +0200)]
libarchive: Use vendor version numbers instead of DF306

10 years agolibz: Use vendor version numbers instead of DF306
John Marino [Fri, 14 Jun 2013 15:39:04 +0000 (17:39 +0200)]
libz: Use vendor version numbers instead of DF306

This allows for a cleaner set of private symbols.

10 years agoliblzma: Add symbol versions (not active)
John Marino [Fri, 14 Jun 2013 15:19:21 +0000 (17:19 +0200)]
liblzma: Add symbol versions (not active)

10 years agolibbz2: Add symbol versions (not active)
John Marino [Fri, 14 Jun 2013 14:37:54 +0000 (16:37 +0200)]
libbz2: Add symbol versions (not active)

10 years agokernel - Document bugs in sendfile that we currently punt on
Matthew Dillon [Fri, 14 Jun 2013 01:32:19 +0000 (18:32 -0700)]
kernel - Document bugs in sendfile that we currently punt on

* sendfile tries to soft-busy the VM pages it backs the mbuf with.  This
  is meant to prevent the VM page's data from being modified while TCP
  is playing with it.  However, it doesn't work.  There are two issues.

* (1) The page still may be mmap()'d writable.  A simple vm_page_protect()
      would fix this.

* (2) The page may be associated with a buffer cache buffer and can be
      modified via a VOP_WRITE through that buffer regardless of whether
      soft-busy or busy is set.  This is a real problem.

      Even if we find and discard the buffer it can just be reinstantiated
      and wind up with the same problem.

From-discussion-with: jeffr, rookie on IRC

10 years agosystat/ip: Unbreak UDP stats
Sepherosa Ziehau [Fri, 14 Jun 2013 01:31:13 +0000 (09:31 +0800)]
systat/ip: Unbreak UDP stats

10 years agolibarchive: Add symbol versions (not active)
John Marino [Thu, 13 Jun 2013 22:51:50 +0000 (00:51 +0200)]
libarchive: Add symbol versions (not active)

10 years agokernel - Increase KVM default for 32-bit systems from 1GB to 1.5GB
Matthew Dillon [Thu, 13 Jun 2013 20:23:38 +0000 (13:23 -0700)]
kernel - Increase KVM default for 32-bit systems from 1GB to 1.5GB

* Increases KVA_PAGES default from 256 to 384, giving the kernel 1.5GB
  of KVM and userland 2.5GB (instead of 1/3).

Numerous people running 32-bit systems are hitting resource limits and
actually running out of KVM.  There are many reasons for why this is
happening.  It isn't simply a resource-tuning issue because most of the
resource limits we have today are already quite reasonable.  It's when
the system combines to fully utilize multiple resources where the problems
begin.  Tuning-down the resources impacts performance too much and makes
the systems less usable.  PCI resources tend to reserve larger areas,
system structures are fatter, and many other issues crop up.

In addition, 32-bit systems today can be greatly extended by adding swapcache
and swapcache requires significantly KVM resources.  For example, adding
64GB of swapcache eats ~64MB of ram and heavy tmpfs use often requires an
even higher ratio (64GB swap w/ kern.maxswzone=128m in /boot/loader.conf).
With the price point for SSDs coming down, 256GB and larger SSDs are far
more common these days and we want even 32-bit systems to be able to make
use of them.

On a fresh system boot well over 512MB of KVM out of the (previous) 1GB
space is already accounted for.  This leaves precious little for dynamic
expansion of system structures.

This leaves us with one real option... increase KVM and decrease UVM.
By increasing KVM from 1GB to 1.5GB we nearly double the KVM available to
the kernel for dynamic expansion of system structures.  User virtual memory
is reduced from 3GB down to 2.5GB.  While this may impact some applications
such as Perl, those applications are already tending to run on the edge
anyway and, in fact, modern application development is starting to assume
64-bit address spaces for optimal operation anyway.

I've come to the conclusion that it is better to move the line on UVM down
in order to completely solve the KVM issue for system resources on 32-bit
systems.

10 years agohammer2 - pfsmount -> clustermount separation part 1
Matthew Dillon [Thu, 13 Jun 2013 19:07:36 +0000 (12:07 -0700)]
hammer2 - pfsmount -> clustermount separation part 1

* Start working on turning the hammer2_pfsmount structure into an
  abstracted PFS 'cluster' structure.

* Move hammer2_inode's allocation infrastructure to the pmp (except
  for the super-root inode which has no pmp).  It was previously
  hmp-centric.

10 years agolibz: Add symbol versions (not active)
John Marino [Thu, 13 Jun 2013 16:11:56 +0000 (18:11 +0200)]
libz: Add symbol versions (not active)

Every time symbol versioning is added to a system library, it will
require a full buildworld for the next build.  In addition, if the major
version isn't bumped, it will break the binary packages that link to it.

The working plan is to add versioning to libaries, but not hook it into
the build unless "RELEASE36" is defined.  When all the libraries have
been versioned, then these conditions will be removed so only one full
buildworld will be required to minimize inconvenience to users.

All versioned libraries will be bumped with the exception of libc as it
has already been bumped for branch 3.5, thus libc.so.7 is already
available.  In other words, we bump to avoid package breakage and that's
no longer an issue for libc.

After this commit, libz will build as before unless RELEASE36=yes is
defined in make.conf or passed to make during buildworld.

10 years agoaltq: Implement two level "rough" priority queue for plain sub-queue
Sepherosa Ziehau [Sat, 8 Jun 2013 05:47:43 +0000 (13:47 +0800)]
altq: Implement two level "rough" priority queue for plain sub-queue

The "rough" part comes from two sources:
- Hardware queue could be deep, normally 512 or more even for GigE
- Round robin on the transmission queues is used by all of the multiple
  transmission queue capable hardwares supported by DragonFly as of this
  commit.
These two sources affect the packet priority set by DragonFly.

DragonFly's "rough" prority queue has only two level, i.e. high priority
and normal priority, which should be enough.  Each queue has its own
header.  The normal priority queue will be dequeue only when there is no
packets in the high priority queue.  During enqueue, if the sub-queue is
full and the high priority queue length is less than half of the sub-
queue length (both packet count and byte count), drop-head will be
applied on the normal priority queue.

M_PRIO mbuf flag is added to mark that the mbuf is destined for the high
priority queue.  Currently TCP uses it to prioritize SYN, SYN|ACK, and
pure ACK w/o FIN and RST.  This behaviour could be turn off by
net.inet.tcp.prio_synack, which is on by default.

The performance improvement!

The test environment:
All three boxes are using Intel i7-2600 w/ HT enabled

                          +-----+
                          |     |
                +->- emx1 |  B  | TCP_MAERTS
+-----+         |         |     |
|     |         |         +-----+
|  A  | bnx0 ---+
|     |         |         +-----+
+-----+         |         |     |
                +-<- emx1 |  C  | TCP_STREAM/TCP_RR
                          |     |
                          +-----+

A's kernel has this commit compiled.  bnx0 has all four transmission
queues enabled.  For bnx0, the hardware's transmission queue round-robin
is on TSO segment boundry.

Some base line measurement:
B<--A TCP_MAERTS (raw stats) (128 client): 984 Mbps
    (tcp_stream -H A -l 15 -i 128 -r)
C-->A TCP_STREAM (128 client): 942 Mbps (tcp_stream -H A -l 15 -i 128)
C-->A TCP_CC (768 client): 221199 conns/s (tcp_cc -H A -l 15 -i 768)

To effectively measure the TCP_CC, the prefix route's MSL is changed to
10ms: route change 10.1.0.0/24 -msl 10

All stats gather in the following measurement are below the base line
measurement (well, they should be).

C-->A TCP_CC improvement, during test B<--A TCP_MAERTS is running:
                        TCP_MAERTS(raw)  TCP_CC
TSO prio_synack=1       948 Mbps         15988 conns/s
TSO prio_synack=0       965 Mbps          8867 conns/s
non-TSO prio_synack=1   943 Mbps         18128 conns/s
non-TSO prio_synack=0   959 Mbps         11371 conns/s

* 80% TCP_CC performance improvement w/ TSO and 60% w/o TSO!

C-->A TCP_STREAM improvement, during test B<--A TCP_MAERTS is running:
                        TCP_MAERTS(raw)  TCP_STREAM
TSO prio_synack=1       969 Mbps         920 Mbps
TSO prio_synack=0       969 Mbps         865 Mbps
non-TSO prio_synack=1   969 Mbps         920 Mbps
non-TSO prio_synack=0   969 Mbps         879 Mbps

* 6% TCP_STREAM performance improvement w/ TSO and 4% w/o TSO.

10 years ago/usr/share/mk: Install bsd.symver.mk and version_gen.awk
John Marino [Thu, 13 Jun 2013 12:29:28 +0000 (14:29 +0200)]
/usr/share/mk: Install bsd.symver.mk and version_gen.awk

10 years agoFix SEE ALSO sorting order in some manual pages.
Sascha Wildner [Thu, 13 Jun 2013 12:31:46 +0000 (14:31 +0200)]
Fix SEE ALSO sorting order in some manual pages.

10 years agotools/netrate: Add simple tools to calculated multiple netperf results
Sepherosa Ziehau [Thu, 13 Jun 2013 11:46:22 +0000 (19:46 +0800)]
tools/netrate: Add simple tools to calculated multiple netperf results

netperf itself must be installed through dports.

10 years agortld: Sync 7/7 - Use symbol versioning instead of exports mapping
John Marino [Thu, 13 Jun 2013 07:19:29 +0000 (09:19 +0200)]
rtld: Sync 7/7 - Use symbol versioning instead of exports mapping

Now that DragonFly has the symbol versioning framework in place, rtld
can leverage it by offloading the symbol export duties to it.  This
further reduces differences between FreeBSD and DragonFly linkers.
Keeping the exports table up to date after FreeBSD removed it was extra
work.

10 years agortld: Sync 6/7 - Minimize differences from FreeBSD
John Marino [Thu, 13 Jun 2013 06:19:35 +0000 (08:19 +0200)]
rtld: Sync 6/7 - Minimize differences from FreeBSD

DragonFly developed some rtld features before FreeBSD, and consequently
those features were ported back to FreeBSD.  Some portions of these
new lines were modified for various reasons, e.g. the variable names
weren't liked or additional constraints were deemed necessary such as
the ability to maintain the old (incorrect) behavior of RUNPATH.

In any case, there were minor differences including whitespace, and
this commit reduces those differences to ease future syncing.

10 years agortld: Sync 5/7 - Fix fd leak with parallel dlopen and fork
John Marino [Wed, 12 Jun 2013 23:42:14 +0000 (01:42 +0200)]
rtld: Sync 5/7 - Fix fd leak with parallel dlopen and fork

Rtld did not set FD_CLOEXEC on its internal file descriptors; therefore,
such a file descriptor may be passed to a process created by another
thread running in parallel to dlopen() or fdlopen().

No other threads are expected to be running during parsing of the hints
and libmap files but the file descriptors need not be passed to child
processes so add O_CLOEXEC there as well.

As the F_DUPFD_CLOEXEC support was added in the kernel today, rtld
will temporarily fall back to separate dup/cloexec commands if
F_DUPFD_CLOEXEC fails.  This fallback should be removed before
3.6 branches.

Taken from:
FreeBSD SVN 242587 (04 NOV 2012)