dragonfly.git
8 years agoigb: Partly rework MSI-X support to bypass one serializer
Sepherosa Ziehau [Mon, 14 Dec 2015 03:04:06 +0000 (11:04 +0800)]
igb: Partly rework MSI-X support to bypass one serializer

For aggregated TX/RX MSI-X handler, there is no need to use
an independent serializer; using RX ring's serializer just
works (well, this driver's MSI-X support was added when we
still lacked of experience about how to serialize aggregated
TX/RX MSI-X handler).

Enable aggregated TX/RX MSI-X handling by default to avoid
extra TX interrupt (though its pretty low for TCP streams).

8 years agokernel/pci: Remove old compatibility shims.
Sascha Wildner [Sun, 20 Dec 2015 22:45:39 +0000 (23:45 +0100)]
kernel/pci: Remove old compatibility shims.

The last drivers using this were removed in d69d461d812.

8 years agokqueue/ufs: Remove unnecessary klist cast
Sepherosa Ziehau [Sun, 20 Dec 2015 10:26:12 +0000 (18:26 +0800)]
kqueue/ufs: Remove unnecessary klist cast

8 years agosocket: Don't use NOTE_OOB as hint for KNOTE upon OOB
Sepherosa Ziehau [Sun, 20 Dec 2015 10:19:07 +0000 (18:19 +0800)]
socket: Don't use NOTE_OOB as hint for KNOTE upon OOB

It is not necessary, and would cause penalty if there was knote
processing contention.  Add comment about it.

8 years agokqueue: Hint is not used by socket filters
Sepherosa Ziehau [Sun, 20 Dec 2015 10:02:40 +0000 (18:02 +0800)]
kqueue: Hint is not used by socket filters

8 years agokqueue: Remove unapplied comment
Sepherosa Ziehau [Sun, 20 Dec 2015 09:47:01 +0000 (17:47 +0800)]
kqueue: Remove unapplied comment

8 years agokqueue: Minor style changes
Sepherosa Ziehau [Sun, 20 Dec 2015 09:35:59 +0000 (17:35 +0800)]
kqueue: Minor style changes

8 years agokqueue: Avoid duplicate KN_PROCESSING clearing
Sepherosa Ziehau [Sun, 20 Dec 2015 09:35:17 +0000 (17:35 +0800)]
kqueue: Avoid duplicate KN_PROCESSING clearing

8 years agokqueue: knote_alloc will never fail
Sepherosa Ziehau [Sun, 20 Dec 2015 02:17:19 +0000 (10:17 +0800)]
kqueue: knote_alloc will never fail

8 years agokqueue: Fix description for kern.kq_checkloop
Sepherosa Ziehau [Sun, 20 Dec 2015 02:10:11 +0000 (10:10 +0800)]
kqueue: Fix description for kern.kq_checkloop

8 years agokernel - Reduce lwp_signotify() latency
Matthew Dillon [Sat, 19 Dec 2015 21:05:55 +0000 (13:05 -0800)]
kernel - Reduce lwp_signotify() latency

* lwp_signotify() was not issuing an IPI to another cpu if the target
  thread was in a run state, preventing that thread from seeing the
  signal for roughly one scheduler tick.

* This interferes with programs like qemu which depend on signaling
  between threads for the timer tick and numerous other things,
  causing timers to behave poorly.

* Fix by issuing the necessary IPI.

Reported-by: Imre Vadasz
Testing-by: Imre Vadasz (+ a bug fix to the original patch)
8 years agosyscons: Remove leftover CDEV_MAJOR #define from sysmouse.c
Imre Vadasz [Sat, 19 Dec 2015 16:54:20 +0000 (17:54 +0100)]
syscons: Remove leftover CDEV_MAJOR #define from sysmouse.c

8 years agoRevert "Sync ACPICA with Intel's version 20151218."
Sascha Wildner [Sat, 19 Dec 2015 19:27:39 +0000 (20:27 +0100)]
Revert "Sync ACPICA with Intel's version 20151218."

This reverts commit 2762423991074ed996c5c4488491cb3ef18c25ea.

It caused a panic on one box and enabling module-level code grouping
again didn't fix that, so it needs further investigation first.

8 years agosys/gnu/vfs/ext2fs: Remove double initialization of ext2 inode flag
Tomohiro Kusumi [Sat, 19 Dec 2015 14:04:50 +0000 (23:04 +0900)]
sys/gnu/vfs/ext2fs: Remove double initialization of ext2 inode flag

Spotted-by: swildner
8 years agokernel/acpica: In notify handlers, always report on unknown notifies.
Sascha Wildner [Sat, 19 Dec 2015 11:49:35 +0000 (12:49 +0100)]
kernel/acpica: In notify handlers, always report on unknown notifies.

Also, make the messages more uniform.

8 years agoRevert "drm: Stop using a taskqueue to restore syscons content"
François Tigeot [Sat, 19 Dec 2015 10:47:24 +0000 (11:47 +0100)]
Revert "drm: Stop using a taskqueue to restore syscons content"

This reverts commit 3018b28f1911f36e342118d9a446488cbcdaf118.

It causes instants reboot when VT switching on some systems.

Noticed-by: YRabbit
8 years agoSync ACPICA with Intel's version 20151218.
Sascha Wildner [Sat, 19 Dec 2015 10:41:00 +0000 (11:41 +0100)]
Sync ACPICA with Intel's version 20151218.

* Execute "module-level code" as ACPI tables are loaded into the
  namespace during initialization and install the default operation
  region handlers for the SystemMemory, SystemIO and PCI_Config
  address spaces before any ACPI tables are loaded (in order to
  enable module-level code to access these address spaces). Also,
  several changes to the internal _REG support and to utilities
  in conjunction with these changes.

* Various other fixes and features.

For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.

8 years agodrm: Stop using a taskqueue to restore syscons content
François Tigeot [Sat, 19 Dec 2015 07:48:41 +0000 (08:48 +0100)]
drm: Stop using a taskqueue to restore syscons content

A regular function is perfectly fine

8 years agokernel/drm: Clean up include search path situation in Makefiles.
Sascha Wildner [Fri, 18 Dec 2015 21:47:33 +0000 (22:47 +0100)]
kernel/drm: Clean up include search path situation in Makefiles.

8 years agoipfw3: fix for kernel build
Bill Yuan [Fri, 18 Dec 2015 01:10:04 +0000 (01:10 +0000)]
ipfw3: fix for kernel build

8 years agoipfw3: logging feature
Bill Yuan [Thu, 17 Dec 2015 09:06:54 +0000 (09:06 +0000)]
ipfw3: logging feature

ifconfig ipfw0 create
ipfw3 add allow log 0 icmp

support max=9 pseudo ipfw interfaces.
the logged packets header will be 0x41 & 0x42.
the logged frames can keep the original MAC.

8 years agocrunch: Raise WARNS to 3.
Sascha Wildner [Wed, 16 Dec 2015 02:06:19 +0000 (03:06 +0100)]
crunch: Raise WARNS to 3.

8 years agomountd/crunchgen: Remove some unused variables.
Sascha Wildner [Wed, 16 Dec 2015 02:06:00 +0000 (03:06 +0100)]
mountd/crunchgen: Remove some unused variables.

8 years agoi915 - Add delay after attach to avoid console/X races
Matthew Dillon [Wed, 16 Dec 2015 01:17:44 +0000 (17:17 -0800)]
i915 - Add delay after attach to avoid console/X races

* Add a delay in the i915 attach to give the kms_console time to
  initialize before X starts to muck around with the gpu.

* Appears to avoid deadlock-on-startup problems when X itself loads
  the i915 driver (verses it being preloaed).

8 years agonrelease - Change target from /usr/release to /usr/obj/release
Matthew Dillon [Tue, 15 Dec 2015 20:17:47 +0000 (12:17 -0800)]
nrelease - Change target from /usr/release to /usr/obj/release

* Change the nrelease build target from /usr/release to /usr/obj/release.
  This is to help cleanup the root mount.  Most people don't need to
  backup the release build target.

8 years agokernel - Improve kernel trap message
Matthew Dillon [Tue, 15 Dec 2015 20:11:31 +0000 (12:11 -0800)]
kernel - Improve kernel trap message

* Improve the 'kernel trap with interrupts disabled' message.  Include
  the thread td_comm and %rip.  This way if the trap gets into a loop
  and fails to panic or dump we may be able to track it down from the
  dmesg buffer retained after a reset.

8 years agokernel - Change where dump context is saved
Matthew Dillon [Tue, 15 Dec 2015 20:10:00 +0000 (12:10 -0800)]
kernel - Change where dump context is saved

* Save the dump context a little earlier in the panic to improve
  chances that post-morten kgdb can print the stack backtrace.

* Use a function union for variable arguments calls from ddb>

8 years agomtree: Use spaces for indenting.
Sascha Wildner [Tue, 15 Dec 2015 16:40:59 +0000 (17:40 +0100)]
mtree: Use spaces for indenting.

8 years agoUpdate the pciconf(8) database.
Sascha Wildner [Tue, 15 Dec 2015 10:33:35 +0000 (11:33 +0100)]
Update the pciconf(8) database.

December 10, 2015 snapshot from http://pciids.sourceforge.net/

8 years agosys/vfs/hammer: Use HAMMER_DEF_LOCALIZATION
Tomohiro Kusumi [Mon, 14 Dec 2015 13:22:36 +0000 (22:22 +0900)]
sys/vfs/hammer: Use HAMMER_DEF_LOCALIZATION

for ip localization of root PFS instead of 0.

(see localization arg of hammer_get_inode() for the root inode
of root PFS, which is eventually set to ip->obj_localization,
it doesn't use 0)

8 years agosbin/hammer: Check existence of PFS#0 when creating PFS
Tomohiro Kusumi [Sun, 13 Dec 2015 15:35:28 +0000 (00:35 +0900)]
sbin/hammer: Check existence of PFS#0 when creating PFS

hammer_cmd_pseudofs_create() checks from PFS#0 to PFS#0xffff
to find available PFS#, but PFS#0 must always exist.

8 years agosys/vfs/hammer: Add HAMMER_ROOT_PFSID macro
Tomohiro Kusumi [Sun, 13 Dec 2015 15:15:08 +0000 (00:15 +0900)]
sys/vfs/hammer: Add HAMMER_ROOT_PFSID macro

Explicitly show PFS#0 is root PFS.

8 years agoinstaller - use a more modern mount setup for UFS and HAMMER (2)
Matthew Dillon [Mon, 14 Dec 2015 07:29:02 +0000 (23:29 -0800)]
installer - use a more modern mount setup for UFS and HAMMER (2)

* Fix bugs last commit.  Muffed up fstab generation and forgot to
  remove an if (hammer) from the loader.conf crypto setup.  Also
  had to mkdir /dev on the target.

* Fixes boot tested w/fresh installs.

8 years agoinstaller - use a more modern mount setup for UFS and HAMMER.
Matthew Dillon [Mon, 14 Dec 2015 03:18:47 +0000 (19:18 -0800)]
installer - use a more modern mount setup for UFS and HAMMER.

* Rewrite a large chunk of the disklabeling and mount point code.
  UFS now gains a separate /boot partition, avoiding issues with
  the boot loader if the user desires to install a large UFS root on
  a drive.

* Normalize the mount mechanics for both UFS and HAMMER.  Instead of
  using PFSs on HAMMER, we create two large partitions by default:
  One is the root partition, the other is /build.

  The /build partition holds major elements of the system which would
  normally not have to be backed up:

/var/tmp (from /build/var.tmp)
/var/cache (from /build/var.cache)
/var/crash (from /build/var.crash)
/var/spool (from /build/var.spool)
/var/log (from /build/var.log)
/usr/obj (from /build/usr.obj)

  The root partition holds all remaining major directories, including the
  base /var.

  There are several reasons for this.  Generally speaking, stuff in /home,
  /usr and most of the stuff in /var is critical to system operation and
  user happiness, and it makes little sense to separate it out from the root
  mount.

  We pick-out the less critical directories and place them on /build,
  using NULL mounts to mount them in their expected locations.

* Users can easily make adjustments post-install without having to mess
  around with PFSs, and can make simple adjustments pre-install.

* Drives smaller than around 40GB will not create a separate /build
  partition by default, but will still create a /build directory in the
  root partition and generate the same nullfs mounts.  This makes it easier
  for the user to adjust to a larger configuration later on if desired.

* This also improves crash recovery mechanics, increasing the chance that
  the root partition will be able to mount with minimal recovery work.

* We now use a tmpfs filesystem for /tmp by default.  /var/tmp is mounted
  from storage.  Again, the user can change this easily post-install.

* Calculate better values for swap, root, and /build, based on the size
  of the slice being installed to.  The /build directory will cap-out
  at around 20GB leaving.  Swap will be made smaller if the root partition
  seems to small, and so forth.

  Some swap is always configured.  Swap is a very useful thing to have,
  even if you have tons of memory, because there will always be a certain
  number of always-idle pages from idle services laying around.

* Remove /dev from sources.conf, it is no longer appropriate to try to
  cpdup /dev.  Fixes a cpdup error.

* UFS root can now be encrypted (it couldn't before), because the UFS
  install now splits out a separate /boot partition.

* Tested w/non-crypto UFS and HAMMER install, crypto UFS and HAMMER install,
  and with small and large drives.

8 years agoinet/mcast: Don't free inp_moptions in ip_setmoptions()
Sepherosa Ziehau [Sat, 12 Dec 2015 12:09:13 +0000 (20:09 +0800)]
inet/mcast: Don't free inp_moptions in ip_setmoptions()

This memory foot print optimization does not save much memory for
us, but it could cause a lot of trouble for in_pcbladdr_find().

8 years agosys/vfs/hammer: Rename resv->flush_group to flg_no
Tomohiro Kusumi [Sun, 13 Dec 2015 13:17:45 +0000 (22:17 +0900)]
sys/vfs/hammer: Rename resv->flush_group to flg_no

Not using flush_group; for int is grep friendly since hammer
mostly uses flush_group; for hammer_flush_group_t variables.

8 years agosys/vfs/hammer: Remove unnecessary casts
Tomohiro Kusumi [Sat, 12 Dec 2015 14:33:39 +0000 (23:33 +0900)]
sys/vfs/hammer: Remove unnecessary casts

These are all int minus int where both ints are flush group #.

8 years agosys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS
Tomohiro Kusumi [Sun, 13 Dec 2015 10:49:30 +0000 (19:49 +0900)]
sys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS

hammer pfs-master|slave have been preventing users from creating
a PFS in non-root PFS, but since kernel HAMMER code also assumes
the parent inode of (non-root)PFS root inode has 0 for ip localization,
ioctl(HAMMERIOC_SET_PSEUDOFS) itself should avoid that too.

This commit doesn't affect HAMMER userspace commands because
hammer pfs-master|slave prevent creating a PFS in PFS prior to
calling ioctl(HAMMERIOC_SET_PSEUDOFS). It just makes better sense
to have this check in kernel space as well since one could write
its own userspace program that directly calls ioctl without using
hammer userspace code.

Also see 5b4785a6.

8 years agosbin/hammer: Rename sbin/hammer/cmd_pseudofs.c to cmd_pfs.c
Tomohiro Kusumi [Sun, 13 Dec 2015 10:30:49 +0000 (19:30 +0900)]
sbin/hammer: Rename sbin/hammer/cmd_pseudofs.c to cmd_pfs.c

The kernel side of PFS code that implements ioctl is called
sys/vfs/hammer/hammer_pfs.c, and all hammer pfs commands are
pfs-xxx. It's more natural to have cmd_pfs.c.
(HAMMER2 has sbin/hammer2/cmd_pfs.c)

The names of functions remain pseudofs since that's the way
functions are named in the kernel too.

8 years agokernel/sound: Add back intr_config_hook descriptions.
Sascha Wildner [Sun, 13 Dec 2015 13:30:30 +0000 (14:30 +0100)]
kernel/sound: Add back intr_config_hook descriptions.

8 years agokernel/iwm: Add intr_config_hook description.
Sascha Wildner [Sun, 13 Dec 2015 13:21:01 +0000 (14:21 +0100)]
kernel/iwm: Add intr_config_hook description.

8 years agovirtio_blk: Use contigmalloc/contigfree for vtblk_request allocations.
Imre Vadasz [Sun, 13 Dec 2015 00:24:23 +0000 (01:24 +0100)]
virtio_blk: Use contigmalloc/contigfree for vtblk_request allocations.

This should fix the "panic: header spanned multiple segments: 2" panic
occuring for some users when running in qemu.

Reported-By: Jim B.
8 years agodrm: Add linux/vmalloc.h
François Tigeot [Sat, 12 Dec 2015 20:00:24 +0000 (21:00 +0100)]
drm: Add linux/vmalloc.h

8 years agodrm: Add linux/fence.h
François Tigeot [Sat, 12 Dec 2015 19:56:48 +0000 (20:56 +0100)]
drm: Add linux/fence.h

8 years agolinux/time.h: Add NSEC_PER_MSEC
François Tigeot [Sat, 12 Dec 2015 19:50:44 +0000 (20:50 +0100)]
linux/time.h: Add NSEC_PER_MSEC

8 years agosys/vfs/hammer: Remove unused count field from hammer_flusher_info
Tomohiro Kusumi [Sat, 12 Dec 2015 07:40:56 +0000 (16:40 +0900)]
sys/vfs/hammer: Remove unused count field from hammer_flusher_info

8 years agodrm/i915: Drop AGP driver requirement
François Tigeot [Fri, 11 Dec 2015 20:15:42 +0000 (21:15 +0100)]
drm/i915: Drop AGP driver requirement

8 years agodrm/i915/gem: Remove useless vm_object unlock/relock sequences
François Tigeot [Fri, 11 Dec 2015 19:36:07 +0000 (20:36 +0100)]
drm/i915/gem: Remove useless vm_object unlock/relock sequences

8 years agodrm/i915: Remove duplicated code in i915_gem_fault (3/3)
François Tigeot [Fri, 11 Dec 2015 19:21:33 +0000 (20:21 +0100)]
drm/i915: Remove duplicated code in i915_gem_fault (3/3)

8 years agodrm/i915: Remove duplicated code in i915_gem_fault (2/3)
François Tigeot [Fri, 11 Dec 2015 19:19:55 +0000 (20:19 +0100)]
drm/i915: Remove duplicated code in i915_gem_fault (2/3)

8 years agodrm/i915: Remove duplicated code in i915_gem_fault (1/3)
François Tigeot [Fri, 11 Dec 2015 19:06:38 +0000 (20:06 +0100)]
drm/i915: Remove duplicated code in i915_gem_fault (1/3)

8 years agosbin/hammer: Make show print symlink[24] if inode is symlink
Tomohiro Kusumi [Fri, 11 Dec 2015 09:57:03 +0000 (18:57 +0900)]
sbin/hammer: Make show print symlink[24] if inode is symlink

Since now that parent_obj_localization part of the union
inode.ext is gone. It's either a symlink string or not used.

8 years agosys/vfs/hammer: Fix wrong parent localization for PFS root
Tomohiro Kusumi [Thu, 10 Dec 2015 15:11:44 +0000 (00:11 +0900)]
sys/vfs/hammer: Fix wrong parent localization for PFS root

The idea of PFS root inode having ip localization value of its
parent directory's inode has been #if0'd after ea434b6f in 2008.

(Since then parent_obj_localization field of ondisk inode seems
to be always 0 because the field is never touched after it's
first allocated, unless it's a symlink which uses symlink[24]
part of union)

Since the field is now deprecated, using this as a localization
value of inode's parent is wrong when the inode is PFS root. It
should use a proper localization value HAMMER_DEF_LOCALIZATION
which is also 0.

Note that HAMMER userspace doesn't allow creating a PFS in PFS
unless the parent PFS is PFS0 (see hammer_cmd_pseudofs_create()),
so it doesn't need to consider the parent inode's localization
value other than the default localization value. If that's allowed,
there seems to be no easy way to tell the localization value.

Also remove parent_obj_localization field of ondisk inode since
it's no longer used after this commit.

8 years agosys/vfs/hammer: Use hammer_find_inode()
Tomohiro Kusumi [Thu, 10 Dec 2015 10:51:12 +0000 (19:51 +0900)]
sys/vfs/hammer: Use hammer_find_inode()

Add __hammer_find_inode() and make hammer_get_*inode() use this.
__hammer_find_inode() is no-ref version of hammer_find_inode()
directly called by hammer_find_inode().

Neither three function arguments obj_id, asof, localization nor
three fields of struct hammer_inode_info are modified in
hammer_get_inode() and hammer_get_dummy_inode(), so getting rid
of hammer_inode_info initialization placed before loop: is ok.

8 years agosys/vfs/hammer: Cleanup
Tomohiro Kusumi [Thu, 10 Dec 2015 09:11:11 +0000 (18:11 +0900)]
sys/vfs/hammer: Cleanup

8 years agoif: Bandaid ifa_ifwithnet() for ifaddrs w/ same netmask
Sepherosa Ziehau [Fri, 11 Dec 2015 07:39:03 +0000 (15:39 +0800)]
if: Bandaid ifa_ifwithnet() for ifaddrs w/ same netmask

The original ifaddr selection logic would cause trouble for
SO_DONTROUTE sockets, if following stuffs happened:
ifconfig drv0 inet a.b.c.1
ifconfig drv0 down
ifconfig drv1 inet a.b.c.2

The original ifaddr selection logic in ifa_ifwithnet() will
select a.b.c.1@drv0, which is down.  Instead, a.b.c.2@drv1
should be selected.

We thus prefer ifaddr w/ IFF_UP interface or is routable.

Same bandaid probably should be applied to ifa_ifwithdstaddr(),
ifa_ifwithaddr() [broadcast part], and ifaof_ifpforaddr() too.

8 years agolibc/stdtime: Fix two cases where a NULL pointer could have been free()'d.
Sascha Wildner [Thu, 10 Dec 2015 20:40:41 +0000 (21:40 +0100)]
libc/stdtime: Fix two cases where a NULL pointer could have been free()'d.

Also, make the rest of error returns more consistent.

8 years agolibcompat: Clean up a bit, fix warnings and raise WARNS to 2.
Sascha Wildner [Thu, 10 Dec 2015 18:16:09 +0000 (19:16 +0100)]
libcompat: Clean up a bit, fix warnings and raise WARNS to 2.

* Remove K&R definitions for non-__STDC__ case.

* Add two defines to rexec.c which afaict were forgotten when the
  RFC 3542 support was added back in 2008 (5aa41e7ced). Or perhaps
  they were present somewhere else which has been removed since.

* Add braces.

* Remove unneeded CFLAGS.

8 years agobtxld(8): Fix some warnings and raise WARNS to 6.
Sascha Wildner [Thu, 10 Dec 2015 18:12:24 +0000 (19:12 +0100)]
btxld(8): Fix some warnings and raise WARNS to 6.

8 years agosys/vfs/hammer: Add hammer_xlate_to_phys()
Tomohiro Kusumi [Wed, 9 Dec 2015 13:21:35 +0000 (22:21 +0900)]
sys/vfs/hammer: Add hammer_xlate_to_phys()

This macro is zone2 --> physical offset version of
hammer_xlate_to_zone2() and hammer_xlate_to_zoneX().

8 years agosys/vfs/hammer: Cleanup assertion for zone
Tomohiro Kusumi [Wed, 9 Dec 2015 12:41:36 +0000 (21:41 +0900)]
sys/vfs/hammer: Cleanup assertion for zone

Don't hardcode ZONE_BTREE (zone-8).

Alhough it requires slightly more calculation than just >ZONE_BTREE,
this is what blockmap does on every allocation/reservation/etc.

8 years agosys/vfs/hammer: Make hammer_bnew*() call _hammer_bread()
Tomohiro Kusumi [Wed, 9 Dec 2015 09:38:52 +0000 (18:38 +0900)]
sys/vfs/hammer: Make hammer_bnew*() call _hammer_bread()

Remove _hammer_bnew() since _hammer_bread() and _hammer_bnew()
are the exact same except for isnew arg of hammer_get_buffer().

hammer_bnew*() use isnew=1 to only allocate ondisk buffer with
no disk i/o at the moment.

8 years agosys/vfs/hammer: Remove unused waitfor field from vsyncscan data
Tomohiro Kusumi [Wed, 9 Dec 2015 07:11:06 +0000 (16:11 +0900)]
sys/vfs/hammer: Remove unused waitfor field from vsyncscan data

Only error field is used.

8 years agosys/vfs/hammer: Make struct hammer_sync_info file local
Tomohiro Kusumi [Wed, 9 Dec 2015 06:57:49 +0000 (15:57 +0900)]
sys/vfs/hammer: Make struct hammer_sync_info file local

This should be a file local struct as no one else needs this
at this point. This struct is for *data part of vsyncscan().

8 years agosys/vfs/hammer: Remove unused lock free_lock
Tomohiro Kusumi [Wed, 9 Dec 2015 06:52:51 +0000 (15:52 +0900)]
sys/vfs/hammer: Remove unused lock free_lock

This was only used in the early stage of hammer development
when hammer_freemap.c had some code.

8 years agobsd-family-tree: Sync with FreeBSD (for DragonFly 4.4.1).
Sascha Wildner [Wed, 9 Dec 2015 08:00:18 +0000 (09:00 +0100)]
bsd-family-tree: Sync with FreeBSD (for DragonFly 4.4.1).

8 years agoinpcb: Split portinfo token into tokens for porthash head
Sepherosa Ziehau [Mon, 7 Dec 2015 06:33:51 +0000 (14:33 +0800)]
inpcb: Split portinfo token into tokens for porthash head

And use pooled token for porthash head.  This avoids another 10K/s
~20K/s contention during local port selection.

8 years agols(1): Fix sort-by-size bug
John Marino [Tue, 8 Dec 2015 22:41:22 +0000 (23:41 +0100)]
ls(1): Fix sort-by-size bug

For a reason that escapes me, in order to sort files by size using ls(1),
one had to pass both the size sort switch (-S) and the time sort switch
(-t), otherwise the -S flag would be ignored.  This hacky workaround was
documented in the man page as well.

Let's fix this with code taken from FreeBSD.  The -t and -S switches are
now mutually exclusive.  If someone uses them together, then the last
one wins (e.g. ls -st sorts by mod. time and -ts sorts by file size)

8 years agow(1): Limit affect of locale change
John Marino [Tue, 8 Dec 2015 21:40:03 +0000 (22:40 +0100)]
w(1): Limit affect of locale change

In essence, w(1) is not designed to be locale sensitive.  The majority
of the outputted text is exclusively English.  However, it does check
the locale for the AM/PM setting (12 hour vs 24 hour clock) and the
decimal separator.

Given that w(1) is designed for English, it only provides enough space
to accommodate "AM" or "PM".  When other locales are used
(e.g. de_DE.UTF-8) the output is simply truncated and confusing.

Let's keep the 12-hour clock labels in the same language as the rest
of the program by forcing strftime to use the C/POSIX locale.  Using
locales still affects am/pm presence and the decimal separator as
originally intended.

8 years agosys/vfs/hammer: Make offset kprintf message explicit
Tomohiro Kusumi [Tue, 8 Dec 2015 17:06:42 +0000 (02:06 +0900)]
sys/vfs/hammer: Make offset kprintf message explicit

bp->b_bio2.bio_offset (bp->b_bio_array[1].bio_offset)
is zone2 offset, so make it print "zone2_offset" instead of "doff".

8 years agosys/vfs/hammer: Make hammer_io_flush_mark() inline
Tomohiro Kusumi [Tue, 8 Dec 2015 09:18:43 +0000 (18:18 +0900)]
sys/vfs/hammer: Make hammer_io_flush_mark() inline

8 years agosys/vfs/hammer: Use HAMMER_ENCODE() for hammer_mod_rb_compare()
Tomohiro Kusumi [Tue, 8 Dec 2015 07:55:09 +0000 (16:55 +0900)]
sys/vfs/hammer: Use HAMMER_ENCODE() for hammer_mod_rb_compare()

Try not to hardcode 8 for volume fields.

The 60 bits offset format changes, but the change doesn't affect
RB-Tree's elements comparison. It works as long as it has volume
bits and 52 bits offset within that volume. Whether HAMMER_ENCODE()
is used or not, io[12]_offset are not valid offsets anyway.
These offset values just need to be unique for physical locations.

(A) before this commit
----oooooooooooooooooooooooooooooooooooooooooooooooooooovvvvvvvv
(B) this commit
----vvvvvvvvoooooooooooooooooooooooooooooooooooooooooooooooooooo

8 years agosys/vfs/hammer: Fix wrong comment on zone2 offset
Tomohiro Kusumi [Tue, 8 Dec 2015 07:35:49 +0000 (16:35 +0900)]
sys/vfs/hammer: Fix wrong comment on zone2 offset

This isn't zone2 offset.

A bug fixed by 41a8e517 in 2012 was based on the wrong assumption
that this offset was zone2 offset, so this comment should be fixed
as well.

8 years agokernel: Silence two unused variables warnings without INET{,6}.
Sascha Wildner [Tue, 8 Dec 2015 17:52:59 +0000 (18:52 +0100)]
kernel: Silence two unused variables warnings without INET{,6}.

Unlikely that someone will compile a kernel without both INET and INET6
but it helps my testing of other, really optional, stuff.

8 years agosys/vfs/hammer: Move hammer_buf_xxx_io() to _KERNEL
Tomohiro Kusumi [Tue, 8 Dec 2015 06:51:50 +0000 (15:51 +0900)]
sys/vfs/hammer: Move hammer_buf_xxx_io() to _KERNEL

usr.bin/fstat/hammer.c
includes in-kernel structures and KKASSERT results in compile time error.

8 years agosys/vfs/hammer: Make bio ops static
Tomohiro Kusumi [Tue, 8 Dec 2015 06:26:47 +0000 (15:26 +0900)]
sys/vfs/hammer: Make bio ops static

Only functions that initialize bios need to see this.

8 years agosys/vfs/hammer: Add hammer_buf_peek_io()/hammer_buf_attach_io()
Tomohiro Kusumi [Mon, 7 Dec 2015 15:29:49 +0000 (00:29 +0900)]
sys/vfs/hammer: Add hammer_buf_peek_io()/hammer_buf_attach_io()

HAMMER doesn't really use bp->b_dep as a list, because it only
has one io entry linked to it (buf and io are 1:1).

Add hammer_buf_peek_io() and hammer_buf_attach_io() to hide the
implication of list (that isn't really a list). These functions
also hide bunch of void* casts between worklist and hammer_io.

8 years agosys/vfs/hammer: Add comments on struct worklist
Tomohiro Kusumi [Mon, 7 Dec 2015 14:55:25 +0000 (23:55 +0900)]
sys/vfs/hammer: Add comments on struct worklist

This worklist isn't very clean, but having a general structure
will require lots of changes in UFS.

8 years agosys/vfs/hammer: Remove union hammer_io_structure
Tomohiro Kusumi [Mon, 7 Dec 2015 12:19:52 +0000 (21:19 +0900)]
sys/vfs/hammer: Remove union hammer_io_structure

Remove union hammer_io_structure that was added in the early
stage of hammer development. This has been used in a certain
part of hammer_io.c, but the code is more clear without this.

Using the existing HAMMER_ITOB() as well as a newly added
HAMMER_ITOV() makes the code less complicated than using this
union.

8 years agokqueue: Make EVFILT_TIMER mpsafe, by modifying kq_ncallouts with atomics.
Imre Vadasz [Fri, 4 Dec 2015 15:45:21 +0000 (16:45 +0100)]
kqueue: Make EVFILT_TIMER mpsafe, by modifying kq_ncallouts with atomics.

8 years agoigb: Fix DMACR settings
Sepherosa Ziehau [Mon, 7 Dec 2015 09:44:28 +0000 (17:44 +0800)]
igb: Fix DMACR settings

Noticed-by: swildner@
8 years agoinpcb: Push porthash token down a bit and use atomic op to update lastport
Sepherosa Ziehau [Fri, 4 Dec 2015 08:47:12 +0000 (16:47 +0800)]
inpcb: Push porthash token down a bit and use atomic op to update lastport

This paves the way to use pooled token for porthash list head.

Even just with this commit, porthash token contention is reduced by 20K/s
on 12core/24threads system when running tools/kq_connect_client.

8 years agosys/vfs/hammer: Add lo_to_pfs()/pfs_to_lo() macros
Tomohiro Kusumi [Sun, 6 Dec 2015 10:36:05 +0000 (19:36 +0900)]
sys/vfs/hammer: Add lo_to_pfs()/pfs_to_lo() macros

These macros hide 16 bits shift and cast to int/uint32_t
that are necessary on localization to/from PFS id conversion.

Some code are better without details being hidden by macros,
but this seems to be more readable with x_to_y macros that
hide bunch of >>16, <<16, and casts.

(No diff in binary on x86_64/gcc5)

8 years agosys/vfs/hammer: Remove unused global variables and sysctls
Tomohiro Kusumi [Sat, 5 Dec 2015 15:34:45 +0000 (00:34 +0900)]
sys/vfs/hammer: Remove unused global variables and sysctls

Remove the following entries that aren't used for anything.
These are mostly from the early stage of hammer development
and no longer used.

  vfs.hammer.debug_recover_faults
  vfs.hammer.write_mode
  vfs.hammer.zone_limit

8 years agosbin/hammer: Change assertion on invalid cleanup path to printf
Tomohiro Kusumi [Sat, 5 Dec 2015 17:43:45 +0000 (02:43 +0900)]
sbin/hammer: Change assertion on invalid cleanup path to printf

This shouldn't be assertion.
Users could just type . for no reason and result in core dump.
It should end like other errors as shown below.

  # hammer cleanup . . . . .
  cleanup .                    - path must start with '/'
  cleanup .                    - PFS #0 already handled
  cleanup .                    - PFS #0 already handled
  cleanup .                    - PFS #0 already handled
  cleanup .                    - PFS #0 already handled

8 years agosys/vfs/hammer: Use hammer_vfs_root()
Tomohiro Kusumi [Sat, 5 Dec 2015 12:38:23 +0000 (21:38 +0900)]
sys/vfs/hammer: Use hammer_vfs_root()

8 years agosys/vfs/hammer: Define HAMMER_MAX_PFS in hammer_disk.h
Tomohiro Kusumi [Sat, 5 Dec 2015 11:04:08 +0000 (20:04 +0900)]
sys/vfs/hammer: Define HAMMER_MAX_PFS in hammer_disk.h

Maximum number of PFS (0 to 0xFFFF) is a part of ondisk definitions,
so move HAMMER_MAX_PFS to hammer_disk.h.

Also add HAMMER_MAX_PFSID which is (HAMMER_MAX_PFS - 1).

8 years agosys/vfs/hammer: Use bitwise OR to generate ondisk localization
Tomohiro Kusumi [Sat, 5 Dec 2015 07:32:38 +0000 (16:32 +0900)]
sys/vfs/hammer: Use bitwise OR to generate ondisk localization

Use |= to generate localization field for B-Tree elements and
cursor keys instead of +=, since lower 16 bits are bitfields
(or safer to treat INODE=0x1 and MISC=0x2 as bitfields).

The typical code to generate ondisk localization value is to
do either of the followings.

  ondisk_lo = local_variable          + {INODE or MISC};
  ondisk_lo = ip->obj_localization    + {INODE or MISC};
  ondisk_lo = HAMMER_XXX_LOCALIZATION + {INODE or MISC};
              ^^^^^^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^
              (A)32 bits localization   (B)lower 16 bits
                 with usually 0 for
                 lower 16 bits for type

Adding (A) and (B) to synthesize PFS id and localization type
could lead to a potential bug if (A) already has type bits set
to either INODE or MISC. For example if (A) had INODE for type
bits and the code is to += INODE for (B), then type bits turn
into MISC (1+1=2) which is not the intention of the code.

This could potentially occur with the first example of above
three where (A) is a local variable or a function argument.
It is not too obvious from the code whether that local variable
has 0 for the lower 16 bits (which basically should be).
If the code just always uses |= no such thing will happen.

8 years agogcc50: Very minor updates to three man pages
John Marino [Sun, 6 Dec 2015 10:55:27 +0000 (11:55 +0100)]
gcc50: Very minor updates to three man pages

Now that gcc 5.3 has been officially released, the new man pages are
available (they are not present in the repository).

8 years agobsd.lib.mk: No need to check DEBUG_FLAGS twice
Alexander Kuleshov [Sat, 5 Dec 2015 17:14:03 +0000 (23:14 +0600)]
bsd.lib.mk: No need to check DEBUG_FLAGS twice

We no need to check the DEBUG_FLAGS twice in the share/mk/bsd.lib.mk,
we can just add '.else' clause to the first check.

8 years agogcc50: Remove bits/mutex.h from the libstdcxx headers Makefile again.
Sascha Wildner [Sun, 6 Dec 2015 03:21:21 +0000 (04:21 +0100)]
gcc50: Remove bits/mutex.h from the libstdcxx headers Makefile again.

This header doesn't exist in bits/. The quoted_string.h addition
seems to have been correct though.

8 years agogcc50: add some missing files
Markus Pfeiffer [Sat, 5 Dec 2015 14:16:18 +0000 (14:16 +0000)]
gcc50: add some missing files

* mutex.h is an internal header omitted from a previous commit
* quoted_string.h and mutex.h were missing in Makefile.headers

This broke compilation of cmake-3.3.1 on my system.

8 years agoLocal adjustments for OpenSSL-1.0.1q.
Sascha Wildner [Fri, 4 Dec 2015 20:46:40 +0000 (21:46 +0100)]
Local adjustments for OpenSSL-1.0.1q.

8 years agoMerge branch 'vendor/OPENSSL'
Sascha Wildner [Fri, 4 Dec 2015 20:45:43 +0000 (21:45 +0100)]
Merge branch 'vendor/OPENSSL'

8 years agoImport OpenSSL 1.0.1q.
Sascha Wildner [Fri, 4 Dec 2015 20:45:11 +0000 (21:45 +0100)]
Import OpenSSL 1.0.1q.

* Certificate verify crash with missing PSS parameter (CVE-2015-3194)

* X509_ATTRIBUTE memory leak (CVE-2015-3195)

* Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs

* In DSA_generate_parameters_ex, if the provided seed is too short,
  return an error

8 years agokqueue.2: Fix manpage.
Sascha Wildner [Fri, 4 Dec 2015 16:27:26 +0000 (17:27 +0100)]
kqueue.2: Fix manpage.

8 years agogcc50: Upgrade version 5.2.1 => 5.3.1
John Marino [Fri, 4 Dec 2015 14:20:16 +0000 (15:20 +0100)]
gcc50: Upgrade version 5.2.1 => 5.3.1

This came out today so there are no distfiles available yet.  That
means I can't update the manpages for cc.1, cpp.1, and gcov.1.  There
are no significant changes expected though.

8 years agoMerge branch 'vendor/GCC50'
John Marino [Fri, 4 Dec 2015 15:04:54 +0000 (16:04 +0100)]
Merge branch 'vendor/GCC50'

8 years agoUpdate gcc-50 to SVN version 231263 (gcc-5-branch)
John Marino [Fri, 4 Dec 2015 14:11:37 +0000 (15:11 +0100)]
Update gcc-50 to SVN version 231263 (gcc-5-branch)

This is equivalent to the gcc 5.3 release (version shows 5.3.1 though)

Last Changed Date: 2015-12-04 01:16:08 +0100 (Fri, 04 Dec 2015)

8 years agolibc: Define a new version, DF406.0, for the 4.5 branch
John Marino [Fri, 4 Dec 2015 13:34:18 +0000 (14:34 +0100)]
libc: Define a new version, DF406.0, for the 4.5 branch