Sepherosa Ziehau [Mon, 6 Apr 2015 12:52:28 +0000 (20:52 +0800)]
clock: Piggyback passive IPIQ processing
Passive IPIs will be flushed by the target CPU at clock interrupt.
But we _never_ completely conform to the passive IPI description.
Before we implemented LAPIC interrupt timer, systimers on non-CPU0
were actually IPIQ processing, which processed the passive IPIs;
however, passive IPIQ processing on CPU0 didn't conform to the passive
IPIs description.
After the introduction of LAPIC interrupt timer, none of the systimers
were related to IPIQ processing, thus passive IPIQ processing no longer
conformed to the passive IPI description at all.
As of this commit we piggyback passive IPIQ processing in doreti after
hardclock(), which matches the passive IPI description.
* NOTE:
- We don't piggypack passive IPIQ processing directly in hardclock() to
avoid introducing extra jitters to system time.
- We choose not to check passive IPIQ in systimer_intr(), since systimer
rate could be pretty high, e.g. rate set by polling(4).
With-feedback-from: dillon@
Tomohiro Kusumi [Mon, 6 Apr 2015 15:40:16 +0000 (00:40 +0900)]
sbin/hammer: Make hammer show-undo indicate positions of tail-chasing fifo
- Make hammer show-undo command print '>' for undo zone blockmap's
first_offset, and '<' for undo zone blockmap's next_offset which
indicate positions of tail-chasing undo fifo.
Matthew Dillon [Mon, 6 Apr 2015 01:04:46 +0000 (18:04 -0700)]
hammer2 - Sync thread work
* Initial syncthread coding, still many issues to resolve, particularly
with the handling of mirror_tid, but it was able to successfully
synchronized a MASTER to a SLAVE.
* Add more features to the hammer2_cluster*() API and structures and fix
a couple of bugs in hammer2_cluster_lookup() and hammer2_cluster_next().
* Add hammer2_cluster_next_single_chain() for advancing one element of
a cluster structure. Used to advance past a chain which the sync code
must delete on a slave.
* Fix a bug in hammer2_chain_lookup() when HAMMER2_LOOKUP_NOLOCK is used.
Tomohiro Kusumi [Sun, 5 Apr 2015 16:38:13 +0000 (01:38 +0900)]
sbin/hammer: Don't readahead the base buffer itself
- readahead can be skipped for itself (ri==0) too.
Sepherosa Ziehau [Sun, 5 Apr 2015 15:25:55 +0000 (23:25 +0800)]
coretemp: Keep the previous sensor value, if the IPI does not complete yet
John Marino [Sun, 5 Apr 2015 13:38:06 +0000 (15:38 +0200)]
make distribution: Remove references to deleted nls dirs
reported by: zrj on irc
Sepherosa Ziehau [Sun, 5 Apr 2015 14:37:27 +0000 (22:37 +0800)]
coretemp: Use lwkt_send_ipiq_passive()
This makes coretemp even more lightweight.
Sepherosa Ziehau [Fri, 3 Apr 2015 15:41:08 +0000 (23:41 +0800)]
coretemp: Use IPI to get temperature on other CPUs
This is more lightweight than CPU migration to run just one instruction.
Sepherosa Ziehau [Sun, 29 Mar 2015 12:26:36 +0000 (20:26 +0800)]
dimm: Implement pseudo device driver for DIMM related drivers
- This pseudo device driver installs sensor device for DIMM related
sensors (memtemp(4) and upcoming ecc(4) changes).
- This pseudo device driver keeps DIMM location information. And
the location information is exposed through a new sysctl tree,
hw.dimminfo. The nodes in this sysctl tree have the same names
as the sensor devices, so that programatic way could be used to
report DIMM status.
- This pseudo device implements common sensor update function for
memtemp(4). And it keeps configurable temperature thresholds for
memtemp(4) sensor.
- Utilize this pseudo device driver in memtemp(4).
Matthew Dillon [Sun, 5 Apr 2015 02:22:39 +0000 (19:22 -0700)]
hammer2 - update documentation, cleanup
* Update the DESIGN document.
* Cleanup API for hammer2_inode_lock*() and hammer2_inode_unlock*().
* Start work on the synchronization thread framework.
Tomohiro Kusumi [Fri, 3 Apr 2015 14:17:26 +0000 (23:17 +0900)]
sbin/hammer: Fix wrong hash value
- get_buffer_readahead() scans ondisk buffer using a wrong hash
value based on raw address. It needs to use zone2 address.
- Using wrong value results unnecessary malloc/free since buf
is always NULL after TAILQ_FOREACH().
John Marino [Fri, 3 Apr 2015 14:49:34 +0000 (16:49 +0200)]
make upgrade: Clean out cat1 directory from texinfo pages
John Marino [Fri, 3 Apr 2015 13:14:23 +0000 (15:14 +0200)]
Remove unused bsd.info.mk
John Marino [Fri, 3 Apr 2015 13:12:00 +0000 (15:12 +0200)]
Remove unused texinfo source files from contrib directory
John Marino [Fri, 3 Apr 2015 13:09:08 +0000 (15:09 +0200)]
Remove texinfo from base
At this point, the only info files left in DragonFly are from texinfo
itself. Due to a similar effort on FreeBSD 11, the ports are already
prepared for the lack of texinfo utilities in base.
John Marino [Fri, 3 Apr 2015 12:45:00 +0000 (14:45 +0200)]
groff: Remove info page
Initially I converted the groff info page until groff.7, but then I
realized that groff.7 already existed and serves as an adequate
alternative to the groff info page. Thus, this commit simply removes
the installation of the info page (one of the last in base)
John Marino [Fri, 3 Apr 2015 12:21:17 +0000 (14:21 +0200)]
am-utils: Convert info page to "man 7 am-utils"
Each automounter tool had a man page, but the group of utilities was
covered by an info page. This unique information was converted to
am-utils.7 and the info page has been removed.
John Marino [Fri, 3 Apr 2015 12:05:31 +0000 (14:05 +0200)]
com_err: convert info page to com_err.7
The was already a com_err.1 man page, but it was significantly shorter
than the com_err info page. The info page was converted to man 7 com_err
and then removed.
John Marino [Fri, 3 Apr 2015 10:56:33 +0000 (12:56 +0200)]
gdb: Remove ~2Mb of doc files from contrib (texi)
These texi files are no longer used in the build and they've got
equivalent man pages in most cases.
John Marino [Fri, 3 Apr 2015 10:41:32 +0000 (12:41 +0200)]
gdb: Remove 4 info pages (2 converted to man pages)
GDB had four info pages: gdb, gdbint, stabs, and annotate. They have been
removed.
* gdb.info : There has always been a man page gdb.1 which is an
adequate replacement for gdb.info
* stabs.info : This has been converted to stabs.7 with info2man
* gdbint.info : This has been converted to gdbint.7 with info2man
* annotate.info : This was always obsolete[1], so it was not replaced
[1] From annotate info page: This document describes the obsolete level
two annotation interface implemented in older GDB versions.
John Marino [Fri, 3 Apr 2015 10:09:16 +0000 (12:09 +0200)]
diffutils: Remove redundant info page
The three diff binaries all have their own man pages, so the
diffutils.info file is redundant. For now a copy of it remains in
contrib/diffutils/doc, but it is being removed from the base system.
John Marino [Fri, 3 Apr 2015 08:26:46 +0000 (10:26 +0200)]
grep: remove "redundant" info page
Grep already has an adequate man page, so we can remove info page without
losing much.
John Marino [Fri, 3 Apr 2015 08:23:09 +0000 (10:23 +0200)]
gcc47: Remove info pages
The info pages from gcc50 are not installed due to limited use and the
fact all the information is readily available on the web. Removing info
pages from gcc47 matches gcc50 and moves us closer to removing texinfo.
John Marino [Fri, 3 Apr 2015 08:12:43 +0000 (10:12 +0200)]
binutils 2.24: Remove info pages
The info pages from binutils 2.25 are not installed (if they were, they
would overwrite 2.24 versions anyway). Both "as" and "ld" have sufficient
man pages. There is not equivalent "binutils" man page, but this
information is readily available on the internet, which is the same
justification used for not importing gcc50 info pages.
John Marino [Fri, 3 Apr 2015 08:59:00 +0000 (10:59 +0200)]
cvs: remove ~3.5Mb of doc files from contrib (texi/pdf)
The only documentation we needs from cvs is in man/cvs.5 and doc/cvs.1.
Everything else is unused, including the pre-generated pdf files, so
lets save shallow repos from pulling these large unused files.
John Marino [Fri, 3 Apr 2015 07:30:58 +0000 (09:30 +0200)]
cvs: Remove info pages (one converted to man page)
As the start of an effort to remove info pages and texinfo from the
system, the cvsclient info page has been converted to a man page.
The cvs info page was not converted since it appears to be equivalent
to the already existing man page.
Entries were added to Makefile_upgrade.inc, but when all the info pages
are gone, those entries will be replaced by a single directory line -
to remove /usr/share/info
John Marino [Thu, 2 Apr 2015 21:07:32 +0000 (23:07 +0200)]
gcc50: Update to 02 APR 2015 snapshot (SVN 221845)
John Marino [Thu, 2 Apr 2015 22:56:45 +0000 (00:56 +0200)]
Merge branch 'vendor/GCC50'
John Marino [Thu, 2 Apr 2015 20:43:43 +0000 (22:43 +0200)]
Update gcc-50 to SVN version 221845
Last Changed Date: 2015-04-02 19:33:22 +0200 (Thu, 02 Apr 2015)
Tomohiro Kusumi [Wed, 1 Apr 2015 12:41:31 +0000 (21:41 +0900)]
sbin/hammer: Don't downgrade when failed to destroy pfs
- hammer pfs-destroy command downgrades (and change some other params)
ondisk pfs data before it attempts to destroy the pfs. This leads to
unexpected result if it fails to destroy because that pfs is left
with downgraded info. This commit restores the original ondisk pfs
data on failure in order to keep status (this does generate a new
ondisk pfs record too).
==========
example1 - using existing /sbin/hammer
# mount | grep TEST
TEST on /HAMMER (hammer, local)
# pwd
/HAMMER
# mkdir -p ./mnt
# hammer pfs-master ./test1 | grep "operating as"
operating as a MASTER
# mount_null ./test1 ./mnt
# mount | grep mnt
/HAMMER/@@-1:00001 on /HAMMER/mnt (null, local)
# hammer pfs-destroy ./test1
You have requested that PFS#1 () be destroyed
<snip>
Destroying PFS #1 () in 5 4 3 2 1.. starting destruction pass
pfs-destroy of PFS#1 failed: Directory not empty
# hammer pfs-status ./test1 | grep "operating as"
operating as a SLAVE
==========
example2 - using this commit
# mount | grep TEST
TEST on /HAMMER (hammer, local)
# pwd
/HAMMER
# mkdir -p ./mnt
# hammer pfs-master ./test1 | grep "operating as"
operating as a MASTER
# mount_null ./test1 ./mnt
# mount | grep mnt
/HAMMER/@@-1:00001 on /HAMMER/mnt (null, local)
# hammer pfs-destroy ./test1
You have requested that PFS#1 () be destroyed
<snip>
Destroying PFS #1 () in 5 4 3 2 1.. starting destruction pass
pfs-destroy of PFS#1 failed: Directory not empty
# hammer pfs-status ./test1 | grep "operating as"
operating as a MASTER
Tomohiro Kusumi [Tue, 31 Mar 2015 21:15:09 +0000 (06:15 +0900)]
sbin/hammer: Print error message if already up|downgraded
- Print an error message that indicates the pfs has already
been upgraded to master or downgraded to slave, instead of
printing "pfs-xxxgrade of PFS#%d (%s) succeeded".
Tomohiro Kusumi [Tue, 31 Mar 2015 20:26:19 +0000 (05:26 +0900)]
sbin/hammer: Detect possible relinking of pfs by user
- It is possible that a user rm pfs symlink and then relink the pfs.
If the user happens to make the symlink to, for example,
"./@@-1:00001" (has "./" before "@@-1:00001"), then getpfs() fails
to properly parse the pfs id as it fails to sscanf the string.
This commit checks if the symlink has "/" in the path, and if yes
use a basename of it to get rid of unnecessary prefix to make it
work properly.
==========
example1 - using existing /sbin/hammer
# mount | grep TEST
TEST on /HAMMER (hammer, local)
# pwd
/HAMMER
# hammer pfs-master test1 > /dev/null
# ls -l ./test1
lrwxr-xr-x 1 root wheel 10 Apr 2 04:27 ./test1 -> @@-1:00001
# ln -s ./@@-1:00001 test2
# ls -l ./test2
lrwxr-xr-x 1 root wheel 12 Apr 2 04:28 ./test2 -> ./@@-1:00001
# hammer pfs-destroy ./test2
You have requested that PFS#1 () be destroyed
<snip>
Destroying PFS #1 () in 5 4 3 2 1.. starting destruction pass
pfs-destroy of PFS#1 failed: Directory not empty
==========
example2 - using this commit
# mount | grep TEST
TEST on /HAMMER (hammer, local)
# pwd
/HAMMER
# hammer pfs-master test1 > /dev/null
# ls -l ./test1
lrwxr-xr-x 1 root wheel 10 Apr 2 04:31 ./test1 -> @@-1:00001
# ln -s ./@@-1:00001 test2
# ls -l ./test2
lrwxr-xr-x 1 root wheel 12 Apr 2 04:31 ./test2 -> ./@@-1:00001
# hammer pfs-destroy ./test2
You have requested that PFS#1 () be destroyed
<snip>
Destroying PFS #1 () in 5 4 3 2 1.. starting destruction pass
pfs-destroy of PFS#1 succeeded!
# ls -l ./test*
lrwxr-xr-x 1 root wheel 10 Apr 2 04:31 ./test1 -> @@PFS00001
# hammer pfs-status ./test1
Cannot access PFS ./test1: No such file or directory
Tomohiro Kusumi [Tue, 31 Mar 2015 17:17:18 +0000 (02:17 +0900)]
sbin/hammer: Remove unnecessary bzero(3)
- No need to bzero pfs before calling getpfs().
- Make init_pfsd() bzero pfsd.
Tomohiro Kusumi [Tue, 31 Mar 2015 17:08:46 +0000 (02:08 +0900)]
sbin/hammer: Add missing relpfs()
- Call relpfs() after getpfs()
Tomohiro Kusumi [Mon, 30 Mar 2015 19:03:26 +0000 (04:03 +0900)]
sbin/hammer: Avoid pfs via pfs on creation, not on status|destroy|upgrade|downgrade|update
- According to the getpfs() implementation, hammer command wants to
avoid users create pfs via pfs (avoid-foot-shooting). However, it
needs to be done when creating the pfs.
- Currently getpfs() is called by all pfs related commands except for
creation (pfs-master, pfs-slave). This makes it possible for users
to create pfs via pfs, but unable to status|destroy|upgrade|downgrade
|update the once created pfs via pfs. In order to avoid this it should
avoid pfs via pfs on pfs creation instead of in getpfs(). This also
ensures other pfs related commands that handle pfs are protected from
pfs via pfs.
- This commit also allows users to destroy once created pfs via pfs
(by existing /sbin/hammer) as following examples show.
==========
example1 - using existing /sbin/hammer
# mount | grep TEST
TEST on /HAMMER (hammer, local)
# pwd
/HAMMER
# hammer pfs-master test1 > /dev/null
# mkdir ./mnt1
# mount_null ./test1 ./mnt1
# cd ./mnt1
# hammer pfs-master test2
Creating PFS #2 succeeded!
You are attempting to access a PFS softlink from a PFS. It may not represent the PFS
on the main filesystem mount that you expect! You may only access PFS softlinks
via the main filesystem mount!
created pfs via pfs, but can't destroy (or any other command) it
# hammer pfs-destroy ./test2
You are attempting to access a PFS softlink from a PFS. It may not represent the PFS
on the main filesystem mount that you expect! You may only access PFS softlinks
via the main filesystem mount!
==========
example2 - using this commit to properly destroy above test2
# hammer pfs-destroy ./test2
You have requested that PFS#2 () be destroyed
This will irrevocably destroy all data on this PFS!!!!!
Do you really want to do this? y
This PFS is currently setup as a MASTER!
Are you absolutely sure you want to destroy it? y
Destroying PFS #2 () in 5 4 3 2 1.. starting destruction pass
pfs-destroy of PFS#2 succeeded!
pfs via pfs should be avoided on creation, but not after that.
# hammer pfs-master test2
You are attempting to access a PFS softlink from a PFS. It may not represent the PFS
on the main filesystem mount that you expect! You may only access PFS softlinks
via the main filesystem mount!
Tomohiro Kusumi [Mon, 30 Mar 2015 18:09:02 +0000 (03:09 +0900)]
sbin/hammer: Make hammer pfs-status print after possible error case
- Print pfs-status info after getpfs() which could possibly print
an error message to stderr and exit(1).
Tomohiro Kusumi [Mon, 30 Mar 2015 13:28:17 +0000 (22:28 +0900)]
sbin/hammer: Fix error message on pfs open/ioctl failure
- "Not a HAMMER root" doesn't seem to be a good error message
when getpfs() or ioctl(HAMMERIOC_GET_PSEUDOFS) has failed.
- getpfs() returning negative indicates open(2) has failed.
ioctl(HAMMERIOC_GET_PSEUDOFS) returning negative (particularly
when caller has set pfs->pfs_id to -1 before ioctl) usually
indicates the fd has nothing to do with the existing valid pfs.
It makes better sense with a message like "Invalid PFS path %s"
or something.
Tomohiro Kusumi [Mon, 30 Mar 2015 13:20:19 +0000 (22:20 +0900)]
sbin/hammer: Cleanup pfs commands by adding getdir()
- hunk1 - Add a static function getdir() for pfs operations.
Returns a path to a directory containing the arg.
- hunk2,3 - Replace existing code with getdir(). Since dirpath
is necessary only when islink, move it inside the if(islink).
- hunk4 - Replace existing code with getdir().
- hunk5 - Add missing free(dirpath).
Tomohiro Kusumi [Sun, 29 Mar 2015 13:15:12 +0000 (22:15 +0900)]
sbin/hammer: Make alloc_btree_element() take address of buffer pointer
- Make alloc_btree_element() take struct buffer_info** as the second
arg so a caller can take control of the buffer, in addition to
retrieving ondisk data. This is the way other ondisk buffer apis
are made (even if the caller doesn't need to explicitly release the
buffer).
John Marino [Wed, 1 Apr 2015 12:15:03 +0000 (14:15 +0200)]
Remove empty directories in /usr/share
These are mostly related to obsolete localization.
Sepherosa Ziehau [Wed, 1 Apr 2015 12:11:40 +0000 (20:11 +0800)]
rtsock: Fix NET_RT_FLAGS support
John Marino [Wed, 1 Apr 2015 06:55:13 +0000 (08:55 +0200)]
Fix gold linker 2.25
The trick of dumping target files to libgold did not work. The gold
linker was missing all of it's targets and emulations. This new approach
uses a custom build target to avoid building common c++ object files
twice.
Eitan Adler [Tue, 31 Mar 2015 20:31:55 +0000 (13:31 -0700)]
share/skel/dot.cshrc: update
- bump history
- make use of autorehash
- make a better prompt (include user)
- some better aliases
- merging history
many things which make it easier for new users
Reviewed by: swildner, marino
Signed-off-by: Eitan Adler <lists@eitanadler.com>
John Marino [Tue, 31 Mar 2015 19:06:36 +0000 (21:06 +0200)]
UPDATING: Add entry about binutils 2.25
John Marino [Tue, 31 Mar 2015 18:56:50 +0000 (20:56 +0200)]
cross-tools stage: Don't build unused linker (i.e. gold)
Only one linker is used to build the world, but each version of binutils
normally installs two linkers. Update the build infrastructure to skip
building one linker for the cross-tools version of binutils. This is
normally the gold linker, which builds very slowly due to being written
in c++.
This change could be backported to binutils 2.24, but right now it only
applies to binutils 2.25, the version normally used to build world.
John Marino [Tue, 31 Mar 2015 17:55:09 +0000 (19:55 +0200)]
Set binutils 2.25 as primary version
Binutils 2.24 is now the backup version.
John Marino [Tue, 31 Mar 2015 17:34:47 +0000 (19:34 +0200)]
ld-225: fix ldscripts (allows binutils 2.25 to build world)
John Marino [Tue, 31 Mar 2015 16:29:14 +0000 (18:29 +0200)]
Remove unused Binutils 2.22 source files
John Marino [Tue, 31 Mar 2015 13:04:24 +0000 (15:04 +0200)]
Replace binutils 2.22 with latest binutils 2.25
There are several active Common Vulnerabilities and Exposures (CVE) on
binutils version 2.24 and earlier. As far as I can tell, there are no
known vulnerabilities with Binutils 2.25 (released late Dec 2014).
While here, maximumize parallelism by splitting binutils into three
serial blocks. Previously binutils built serially with the build on the
gold linker (c++) particularly obvious.
The commit only replaces the ALTBINUTILS (version 2.22). Once it is
confirmed that world builds without issue using version 2.25, it will
become prime and binutils 2.24 will become ALTBINUTILS.
The active vulnerability list:
* CVE-2012-3509 possible DOS (crash) (2.22 only)
* CVE-2014-8484 possible DOS (out of bounds read)
* CVE-2014-8485 possible DOS (crash) and code execution
* CVE-2014-8501 possible DOS (out of bounds write) and unspecified impacts
* CVE-2014-8502 possible DOS (crash) and unspecified impacts
* CVE-2014-8503 possible DOS (crash) and unspecified impacts
* CVE-2014-8404 possible DOS (crash) and unspecified impacts
* CVE-2014-8737 allows local users to arbitrarily delete files
* CVE-2014-8738 possible DOS (crash, invalid write)
John Marino [Mon, 30 Mar 2015 18:44:57 +0000 (20:44 +0200)]
binutils 2.25: Add DF READMEs and local modifications
John Marino [Tue, 31 Mar 2015 16:27:27 +0000 (18:27 +0200)]
Merge branch 'vendor/BINUTILS225'
John Marino [Tue, 31 Mar 2015 14:29:45 +0000 (16:29 +0200)]
Initial import of Binutils 2.25 on vendor branch
Sepherosa Ziehau [Mon, 30 Mar 2015 14:49:22 +0000 (22:49 +0800)]
sensor: Expose max id of sensor device through hw.sensors.dev_idmax
There could be so many sensor devices that MAXSENSORDEVICES is far
from enough, e.g. coretemp.
Sepherosa Ziehau [Mon, 30 Mar 2015 14:23:40 +0000 (22:23 +0800)]
sensor: Fix sensor device numbering
Always use the lowest available sensor device number.
Sepherosa Ziehau [Mon, 30 Mar 2015 13:42:42 +0000 (21:42 +0800)]
sensor: Fix sysctl tree creation
This allows:
- Attach sensor after installing sensor device.
- Detach sensor without de-installing sensor device.
Matthew Dillon [Tue, 31 Mar 2015 04:50:14 +0000 (21:50 -0700)]
hammer2 - Cleanup error paths
* Do not try to return I/O error status from hammer2_chain_lock() or
hammer2_cluster_lock(). This is just asking for trouble by depending
on callers to keep track of state in local variables.
Instead, accumulate error status in chain->error and cluster->error.
Adjust cluster->error based on focus. Code does not yet check this field.
* Do not NULL-out cluster array entries on I/O errors or if unavailable.
Leave the chain structure intact.
This makes the cluster's array-of-chains more deterministic and will
allow upcoming code to use errored chains as a placeholder for blocking
operations.
* When locking a cluster, attempt to select alternative masters or slaves
for our focus if the chain we would have otherwised used is errored.
* Add inlines to test whether a chain or cluster can be read or written
(writing still also requires calling *_modify()).
* Document leaving inode->pfs_nmasters set to 0 for new masters.
* Adjust hammer2 pfs-list to display whether a master is a normal
master or a snapshot.
Matthew Dillon [Mon, 30 Mar 2015 05:45:59 +0000 (22:45 -0700)]
hammer2 - Start work on quorum validation.
* Remove HAMMER2_PFSTYPE_SNAPSHOT, it adds unnecessary complication.
Just make snapshots HAMMER2_PFSTYPE_MASTER.
Add a subtype field to the inode and PFS ioctl to identify snapshots.
* Start fleshing out the quorum code. hammer2_chain_lock() is the core.
It will eventually also have to be async.
hammer2_chain_lock() now does hard quorum checks, soft master checks,
and identifies slaves and whether synchronization is needed, based on
mirror_tid.
* More cleanup of cluster->focus.
* When removing nodes from a PFS cluster, since the cluster is being
ripped apart and hammer2_inode_lock_ex() does quorum validation,
we cannot use this function. Just acquire and release the low-level
inode mutex instead.
Matthew Dillon [Mon, 30 Mar 2015 02:40:17 +0000 (19:40 -0700)]
hammer2 - Cleanup hammer2_cluster API
* Track whether a cluster structure is locked or not. For the upcoming
cluster locking code, cluster structures cannot be recursively locked
(though you can always make a copy and lock that).
* Move the ddflag (direct-data-in-inode) flag into the cluster structure
And remove it from a number of API calls.
* Add fields and flags in preparation for more formalized locking and
tracking of clusters.
* Refactor code to remove hammer2_cluster_replace() and
hammer2_cluster_replace_locked(). This involves changing
hammer2_hardlink_find() and a few other things.
* Refactor the cluster focus code. cluster->focus is only set and valid
when a cluster is locked. Do not set it as a side effect of other
operations.
* Refactor chain validation in hammer2_cluster_lookup() and add it to
hammer2_cluster_next().
* Add the concept of a read-only cluster lock which will allow upcoming
cluster locking code to reduce the number of chains that actually
get locked or undergo I/O.
* In strategy file writing code call hammer2_cluster_modify_ip()
only when the inode itself is being modified by the write() due
to being in OPFLAG_DIRECTDATA mode (when 512 bytes of data is embedded
in the inode).
Sascha Wildner [Sun, 29 Mar 2015 09:53:44 +0000 (11:53 +0200)]
mailer.conf: Fix some issues.
* dma(8) accepts being called as newaliases, causing it to parse the
aliases file, thereby checking its integrity, and erroring if
something is wrong, so allow it to do that. It also has code to
deal with being called as hoststat or purgestat, so allow that too.
* Use true(1)'s full path since /usr/bin isn't necessarily in the
path in all situations (such as when called from rc scripts).
Matthew Dillon [Sun, 29 Mar 2015 07:19:15 +0000 (00:19 -0700)]
hammer2 - Initial synchronization thread
* Add infrastructure for a per-PFS synchronization thread. This primary
thread will be responsible for background synchronization out-of-sync
masters, slaves, and other elements of a PFS. There will also be another
thread for background bulkfree and dedup operations.
In this commit, basic thread creation, destruction, freeze, and unfreeze.
(Freezing and remastering is required when new nodes are added to a PFS
or existing nodes are deleted).
* Define new cluster flags indicating the synchronization state.
* pfs-create and snapshot were not properly flagging the inode as being
a PFS, which confused the on-mount recovery scan code.
* Update TODO.
John Marino [Sun, 29 Mar 2015 00:15:07 +0000 (01:15 +0100)]
loader: set color option (blue) by default
On the loader screen, the blue version of Fred will now be shown by
default unless the serial console is selected ("comconsole" value for
"console" option in boot/loader.conf).
As part of the work:
* "loader_color" option removed
* "loader_plain" is a new option, to force Fred in monochrome
* "fred_is_blue" option (4.1 only) removed
* "fred_is_red" is a new option as the red scheme is now alternate
Users that had "loader_color" set on before will see Fred change color to
blue, thus they will need to set "fred_is_red=true" in /boot/loader.conf
to restore the loader as it was before. Users that don't like color will
have to explicitly set "loader_plain=true" to get rid of it.
This is a cosmetic change which hopefully makes DragonFly a tiny bit more
attractive to first time users.
Tomohiro Kusumi [Sat, 28 Mar 2015 19:01:26 +0000 (04:01 +0900)]
sbin/newfs_hammer: Properly allocate root inode and pfs from meta zone
- newfs_hammer writes initial two elements, root inode and pfs
directly from userspace (which is based on different code from
HAMMER's storage allocation code in kernel space), but it's
not using the right zone. It should be using META zone instead
of SMALL_DATA zone.
- This issue was found by zone checking added in commit
901e04c7.
- Bug #2807 acked by dillon
Tomohiro Kusumi [Sat, 28 Mar 2015 19:34:09 +0000 (04:34 +0900)]
sbin/hammer: Make hammer checkmap check zone
- Make use of unused layer2 track field track2->zone to check
layer2 entries' zone #.
- This ensures that all nodes/data/metadata are allocated from
a zone that is supposed to be used. If HAMMER happens to
allocate them from a zone that is not intended to be used for
that chunk of data, then this command will report inconsistency.
Tomohiro Kusumi [Thu, 26 Mar 2015 13:27:43 +0000 (22:27 +0900)]
sbin/hammer: Fix comments on supported checkmap zones
- btree nodes and undo fifo is supported in addition to data
after 6cf258d and d2bf3c3.
Tomohiro Kusumi [Thu, 26 Mar 2015 12:59:03 +0000 (21:59 +0900)]
sbin/hammer: Make rel_buffer() and rel_volume() check if arg is NULL
- Some of the existing code do "if (buf) { rel_buffer(buf); }",
but others just do "rel_buffer(buf);". Make code and things clear
by making these rel_buffer() and rel_volume() check if the pointer
is NULL.
Tomohiro Kusumi [Thu, 26 Mar 2015 12:46:26 +0000 (21:46 +0900)]
sbin/hammer: Remove duplicated header include
- <libhammer.h> is included by "hammer.h"
Tomohiro Kusumi [Thu, 26 Mar 2015 12:35:11 +0000 (21:35 +0900)]
lib/libhammer: Remove duplicated and unnecessary macro definitions
- All these macros are already defined in sbin/hammer/*.
- HAMMER_BUF* are macros internally used by hammer userspace
to manage hammer's 16KB buffers. Unless buffer management
code is migrated to libhammer, it doesn't make much sense
only to have these macros in library code.
- All the rest of the macros are locally defined and used by
hammer commands. No need to have them in header files.
Tomohiro Kusumi [Thu, 26 Mar 2015 12:14:24 +0000 (21:14 +0900)]
sbin/hammer: Fix width of hammer stats output
- Align output of hammer stats columns using %9jd instead of
either %9jd, %8jd or %5jd. This should be better than using
"flsh" and "cmmit" (for "flush" and "commit") to make them
fit within the space.
Matthew Dillon [Sat, 28 Mar 2015 22:15:14 +0000 (15:15 -0700)]
kernel - Bring in
dff23c692 from FreeBSD
Bring in a commit further strengthening iret/%gs handling. FreeBSD also
made a followup commit that fixes their signal handler for stack faults
which we already effectively implement and did not need.
Original commit message is
The #ss fault handler erronously does not check for the fault
originated from the return to usermode. #ss must be handled same as
#np.
Matthew Dillon [Sat, 28 Mar 2015 22:00:43 +0000 (15:00 -0700)]
kernel - Adjustments for CERT VU#711516
Note that IPV6 route advertisements are disabled by default, so these
adjustments have no real security implications if you haven't enabled
it. And, generally speaking, enabling IPV6 route advertisements is a
really bad idea anyway and these adjustments only address one small part
of the problem.
* Allowing RTR packets via net.inet6.ip6.accept_rtadv is not advised
even with this adjustment.
* Add a sysctl to put a lower limit on the IPV6 hop limit received via
RTR packets when allowed, default is 39. sysctl net.inet6.ip6.minhlim.
Matthew Dillon [Sat, 28 Mar 2015 05:51:17 +0000 (22:51 -0700)]
hammer2 - Starting refactoring PFS management in mount
* Start removing single-device shims.
* Adjust data structures. Rename hammer2_mount to hammer2_dev and
rename hammer2_pfsmount to hammer2_pfs. Refactor unmount.
* Integrate all available PFSs when a block device is mounted and
De-integrate related PFSs when a block device is unmounted.
At least one PFS (typically @LOCAL) must be mounted from a HAMMER2 block
device for that device's PFSs to be used. At least for now. We could
eventually trigger auto-mounting via the probe code.
* Add a synchronization thread abstraction for a PFS.
* Normalize chain->pmp to NULL for any chain which is part of the super-root
topology, for later sanity assertions.
* The ioctl to create a PFS now adds it (delete and snapshot do not, yet).
Matthew Dillon [Fri, 27 Mar 2015 15:48:47 +0000 (08:48 -0700)]
hammer2 - cleanup, add manual page
* Add an initial manual page for hammer2(8). Note that a multitude of
features being described have not yet been implemented.
* Add a DUMMY PFS type.
* Cleanup some edge cases.
Sepherosa Ziehau [Thu, 26 Mar 2015 13:51:13 +0000 (21:51 +0800)]
sensor: Save OID of sensordev sysctl tree.
And allow sensordev sysctl tree registration to fail instead of panic,
e.g. upon duplicated sensordevs.
Sepherosa Ziehau [Thu, 26 Mar 2015 13:50:31 +0000 (21:50 +0800)]
sensor: Use sysctl lock
Original devlist lock is not MPSAFE (it's locked find then unlocked
used). Since sensors are sysctl centric, we could just use sysctl
lock here.
Matthew Dillon [Fri, 27 Mar 2015 03:05:51 +0000 (20:05 -0700)]
dmsg - refactor cluster and pfs identifiers
Cleanup loose ends in the CONN/SPAN messages that prior work has exposed.
DMSG now uses LNK_SPAN exclusively in its graph algorithms, so LNK_CONN
has a different meaning than it used to.
* Change the way cl_id and fs_id work. Rename cl_id and most cluster fields
as 'peer' identification fields.
Reduce complexity and confusion by removing pfs_type and pfs_fsid from
LNK_CONN. Also remove pfs_mask and fs_label. Change cl_label to
peer_label. peer_label is now always a human-readonable string identifier
for the socket connection and no longer performs any connection filtering.
This allows it to be passed in LNK_SPANs to make the trees more
human-readable when dumped.
* A LNK_CONN identifies the peer and not necessarily any particular cluster.
Note that the peer_id in a LNK_CONN is a filter request, not an
advertisement.
* Make peer_label more meaningful by incorporating the hostname (needs more
work).
* Rename filesystem identifiers as 'pfs' identifiers. A LNK_SPAN identifies
a particular PFS. Note that the peer_id in a LNK_SPAN is part of the PFS
{ cluster_id, pfs_id } advertisement.
* Pad some in-memory structures for natural alignment (it's a general rule
for all hammer2 structures, even in-memory structures when appropriate).
John Marino [Thu, 26 Mar 2015 09:00:20 +0000 (10:00 +0100)]
bmake: Fix clobber error, raise WARNS back to 4
Matthew Dillon [Thu, 26 Mar 2015 07:48:14 +0000 (00:48 -0700)]
kernel - Fix panic in broken chroot case
* If a chroot is broken (e.g. by some process outside the chroot renaming
a parent directory from inside to outside the chroot), and a process
within the chroot attempts to '..' past the real root, the system will
panic on an assertion. Add a check to detect this case and not panic.
* This patch does not detect other chroot break-out cases.
Reported-by: Balazs Bucsay
Sascha Wildner [Tue, 24 Mar 2015 17:25:05 +0000 (18:25 +0100)]
Sync zoneinfo database with tzdata2015b from ftp://ftp.iana.org/tz/releases
Changes affecting future time stamps
* Mongolia will start observing DST again this year, from the last Saturday
in March at 02:00 to the last Saturday in September at 00:00.
(Thanks to Ganbold Tsagaankhuu.)
* Palestine will start DST on March 28, not March 27. Also,
correct the fall 2014 transition from September 26 to October 24.
Adjust future predictions accordingly. (Thanks to Steffen Thorsen.)
Changes affecting past time stamps
* The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a
regression. (Thanks to Stuart Bishop for reporting the problem.)
* Some more zones have been turned into links, when they differed
from existing zones only for older time stamps. As usual,
these changes affect UTC offsets in pre-1970 time stamps only.
The affected zones are: America/Antigua, America/Cayman,
Pacific/Midway, and Pacific/Saipan.
Changes affecting time zone abbreviations
* Correct the 1992-2010 DST abbreviation in Volgograd from "MSK" to "MSD".
(Thanks to Hank W.)
Changes affecting commentary
* Cite the recent Mexican decree changing Quintana Roo's time zone.
(Thanks to Carlos Raúl Perasso.)
* Likewise for the recent Chilean decree. (Thanks to Eduardo Romero Urra.)
* Update info about Mars time.
Tomohiro Kusumi [Tue, 24 Mar 2015 11:18:05 +0000 (20:18 +0900)]
sys/vfs/hammer: Fix comment on leaf node elements
- This seems to be an obsolete comment from
47197d71.
There is nothing special about leaf elements now.
Tomohiro Kusumi [Tue, 24 Mar 2015 11:14:35 +0000 (20:14 +0900)]
sys/vfs/hammer: Make use of btree_max_elements()
- Implement btree_node_is_full() using btree_max_elements()
which had been #if0'd at right below this function.
John Marino [Tue, 24 Mar 2015 12:41:41 +0000 (13:41 +0100)]
bmake(1): lower WARNS from 4 to 2
The latest bmake will not build with gcc50 with WARNS of 4:
--- main.o ---
/usr/src/usr.bin/bmake/../../contrib/bmake/main.c: In function 'Cmd_Exec':
/usr/src/usr.bin/bmake/../../contrib/bmake/main.c:1527:10: error: variable
'savederr' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
int savederr; /* saved errno */
Sepherosa Ziehau [Mon, 23 Mar 2015 13:39:34 +0000 (21:39 +0800)]
sensor: sensor_task_schedule() should always be locked
Sepherosa Ziehau [Mon, 23 Mar 2015 12:07:36 +0000 (20:07 +0800)]
sysctl: Expose sysctl lock
It will also be used by sysctl centric module like sensor.
Matthew Dillon [Tue, 24 Mar 2015 01:29:05 +0000 (18:29 -0700)]
hammer2 - Cluster API cleanup
* Simplify hammer2_cluster_copy() to reduce ref count confusion. It now
always refs the underlying chains and the cluster. The follow-up
hammer2_cluster_lock() op can then be called with HAMMER2_RESOLVE_NOREF
to avoid double-refs on the cluster and its underlying chains.
* Simplify hammer2_inode_lock_ex() and hammer2_inode_lock_sh(). These
functions now use hammer2_cluster_lock() instead of rolling their own.
* Focus is now never set until a cluster is locked. However, continue
to cache a default focus in the hammer2_inode's embedded cluster.
* Remove some dead code.
Sascha Wildner [Mon, 23 Mar 2015 21:50:05 +0000 (22:50 +0100)]
kernel: Adjust netgraph7 for the mtx_init() change.
Sascha Wildner [Mon, 23 Mar 2015 20:31:13 +0000 (21:31 +0100)]
make upgrade: Adjust the files to be removed without WANT_INSTALLER.
We create /usr/share/installer unconditionally via mtree(8) so we can
only remove the files in it.
Sascha Wildner [Mon, 23 Mar 2015 20:27:21 +0000 (21:27 +0100)]
mount_psshfs.8: Fix typo.
Sascha Wildner [Mon, 23 Mar 2015 20:09:09 +0000 (21:09 +0100)]
ln(1): Sync up with FreeBSD.
* Adds POSIX.1-2008's -L (hardlinks to symbolic links link to the
symlink target, which stays our default) and -P (hardlinks to
symbolic links link to the symlink itself) options.
* Adds -F (if the target is a directory, remove it to make the link
happen) and -w (warns if the source of a symlink does not exist)
options.
* Some bug fixes I guess. :)
* It also improves the checks for identical files. Our former checks
were producing kind of confusing results in conjunction with
'install -C' (i.e., for libraries and includes, if LINKS is used
from the Makefile) upon repeated installation.
Reported-by: marino
Sascha Wildner [Mon, 23 Mar 2015 16:32:15 +0000 (17:32 +0100)]
kernel/acpi: Only check against ACPI 1.0's FADT size as a minimum.
Hyper-V's FADT for example is only 129 bytes long.
Discussed-with: sephe
John Marino [Mon, 23 Mar 2015 13:39:27 +0000 (14:39 +0100)]
libstand: Rework makefile to avoid repeated building
The change to use i386 headers for x86_64 was like a sledgehammer.
From my investigation, "cpu" is not needed at all, and only four headers
are needed from "machine". The "cpu" directory is still created so that
if some attempt to "#include <cpu/xxx>" is made, it will fail.
By adding exact header dependencies, we prevent libstand from building
over and over again in quickworld.
John Marino [Mon, 23 Mar 2015 11:02:51 +0000 (12:02 +0100)]
gdb(1), kgdb(1): Rework makefile to prevent repeated rebuilding
The beforedepends target was done in such a way that caused gdb and
kgdb to rebuild with every quickworld. This commit rearranges things
so that doesn't happen anymore.
John Marino [Mon, 23 Mar 2015 08:32:54 +0000 (09:32 +0100)]
gcc50: Switch final specs to set DT_RUNPATH tag
The system dynamic binaries have always been built with DT_RPATH set
by the linker. A few years ago the dynamic linker gained DT_RUNPATH
capability but it hasn't been used in base.
How it works is that when the linker is given the -rpath switch, it
will always set DT_RPATH, but if the --enable-new-dtags switch is present,
the linker will also set DT_RUNPATH tag. The dynamic linker reacts
differently when DT_RUNPATH is present; it will check LD_LIBRARY_PATH
before the rpath in that case.
This change (to gcc50 only) builds the system with the -rpath flag alone
by for the ctools compiler, but the final compiler's specs include the
--enable-new-dtags switch as well, which affects the building of ports and
all non-system use of the compiler.
Matthew Dillon [Mon, 23 Mar 2015 05:11:44 +0000 (22:11 -0700)]
hammer2 - structuralize the cluster's chain array
* Structuralize hammer2_cluster's chain array, implementing a new
sub-structure called hammer2_cluster_item.
This structure represents one of N elements in a cluster node representing
the same location at each target. It will also be used to track cache
coherency state, async locks, and other things.
Matthew Dillon [Mon, 23 Mar 2015 04:54:32 +0000 (21:54 -0700)]
hammer2 - locking revamp (2)
* Update mutex lock calls to not pass the ident.
Matthew Dillon [Mon, 23 Mar 2015 03:26:08 +0000 (20:26 -0700)]
hammer2 - locking revamp
* Temporarily remove hammer2_ccms.c from the build and remove the ccms
container. The CCMS container will be used again when we get cache
coherent in, but for now it isn't needed.
* Replace the ccms state lock with a mtx lock and move
into hammer2_chain_core.
Note that the mtx lock being used here has abort and async locking
support and these features will be required by HAMMER2.
* Replace the ccms spin lock with a normal spin lock and move
into hammer2_chain_core.
* Refactor the OS locking interface to use hammer2_* prefixes for easier
porting.
* Use a shared spin lock for the ONFLUSH bit update instead of an exclusive
spin lock.
Matthew Dillon [Mon, 23 Mar 2015 03:23:52 +0000 (20:23 -0700)]
kernel - Major mtx lock cleanup
* Integrate the ident into the mtx structure, remove the ident parameter from
all locking calls.
* Rename some of the functions, shortening them.
* Add a few new functions which hammer2 will use.
Sepherosa Ziehau [Sun, 22 Mar 2015 12:52:35 +0000 (20:52 +0800)]
sensor: Allocate task w/ M_WAITOK
And now sensor_task_register() will not fail.
Sepherosa Ziehau [Sun, 22 Mar 2015 12:32:56 +0000 (20:32 +0800)]
sensor: Create task thread through SYSINIT
Sepherosa Ziehau [Sat, 21 Mar 2015 14:26:22 +0000 (22:26 +0800)]
sensor: Function renaming and remove unnecessary comment.
Sepherosa Ziehau [Sat, 21 Mar 2015 14:25:53 +0000 (22:25 +0800)]
sensor: Remove the NOSYSCTL8HACK ifndef test
NOSYSCTL8HACK is always not defined on DragonFly.