]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoAllow drivers to return BUS_PROBE_NOWILDCARD from their attach routine to
Ryan Stone [Thu, 8 Aug 2013 19:30:49 +0000 (19:30 +0000)]
Allow drivers to return BUS_PROBE_NOWILDCARD from their attach routine to
match devices where the driver class was fixed but the unit number was
wildcarded.  This better matches the documented behaviour in
DEVICE_PROBE(9).

Reviewed by: imp

11 years agogpt_entries is used as limit for the number of partition entries in
Andrey V. Elsukov [Thu, 8 Aug 2013 16:09:20 +0000 (16:09 +0000)]
gpt_entries is used as limit for the number of partition entries in
the GEOM_PART. Instead of just using number of entries from the GPT
header, calculate this limit based on the reserved space between
GPT header and first available LBA.

MFC after: 2 weeks

11 years agoWhen newvers.sh is run, it is possible that the svnversion
Glen Barber [Thu, 8 Aug 2013 15:59:00 +0000 (15:59 +0000)]
When newvers.sh is run, it is possible that the svnversion
(or svnliteversion) in the current lookup path is not what
was used to check out the tree.  If an incompatible version
is used, the svn revision number is not reported in uname(1).

Run ${svnversion} on newvers.sh itself when evaluating if the
svn(1) in use is compatible with the tree.  Fallback to an
empty ${svnversion} if necessary.

With this change, svnliteversion from base is only used
if no compatible svnversion is found, so with this change,
the version of svn(1) from the ports tree is evaluated first.

Requested by: many
MFC after: 3 days
X-MFC-To: stable/9, releng/9.2 only

11 years agoPart of r245761 makes "grep -D skip" broken for pipes, i.e.
Andrey A. Chernov [Thu, 8 Aug 2013 11:53:47 +0000 (11:53 +0000)]
Part of r245761 makes "grep -D skip" broken for pipes, i.e.
echo xxx | grep -D skip xxx
returns nothing. Instead of just removing added S_ISFIFO condition
(originally absent in this version of grep), make it work as latest
GNU version does: don't skip directories and devices if fd == STDIN_FILENO.

11 years agoMake the check for number of entries less strict.
Andrey V. Elsukov [Thu, 8 Aug 2013 11:24:25 +0000 (11:24 +0000)]
Make the check for number of entries less strict.
Some partitioning tools can create GPT with number of entries less
than 128.

MFC after: 1 week

11 years agoAccording to POSIX \ in the fnmatch(3) pattern should escape
Andrey A. Chernov [Thu, 8 Aug 2013 09:04:02 +0000 (09:04 +0000)]
According to POSIX \ in the fnmatch(3) pattern should escape
any character including '\0', but our version replace escaped '\0'
with '\\'.
I.e. fnmatch("\\", "\\", 0) should not match while fnmatch("\\", "", 0)
should (Linux and NetBSD does the same). Was vice versa.

PR:     181129
MFC after:      1 week

11 years agoCap the number of streams supported to two for now.
Adrian Chadd [Thu, 8 Aug 2013 05:52:41 +0000 (05:52 +0000)]
Cap the number of streams supported to two for now.

I haven't yet reviewed the Intel driver(s) in more depth to see if
there are 1x1 NICs that report they support 2 transmit/receive chains..
if so then we'll have to update this.

Tested:

* Intel 4965, which is a 2x2 device with 3 RX and 2 TX chains.

PR: kern/181132

11 years agoConvert net80211 over to using if_transmit for the dispatch from the
Adrian Chadd [Thu, 8 Aug 2013 05:09:35 +0000 (05:09 +0000)]
Convert net80211 over to using if_transmit for the dispatch from the
upper layer(s).

This eliminates the if_snd queue from net80211. Yay!

This unfortunately has a few side effects:

* It breaks ALTQ to net80211 for now - sorry everyone, but fixing
  parallelism and eliminating the if_snd queue is more important
  than supporting this broken traffic scheduling model. :-)

* There's no VAP and IC flush methods just yet - I think I'll add
  some NULL methods for now just as placeholders.

* It reduces throughput a little because now net80211 will drop packets
  rather than buffer them if the driver doesn't do its own buffering.
  This will be addressed in the future as I implement per-node software
  queues.

Tested:

* ath(4) and iwn(4) in STA operation

11 years agoUse local variables with the appropriate types and eliminate a bunch of casts.
Neel Natu [Thu, 8 Aug 2013 03:17:39 +0000 (03:17 +0000)]
Use local variables with the appropriate types and eliminate a bunch of casts.

This is a cosmetic change but it does help with a proposed change to increase
the maximum size of physical memory supported on amd64 platforms.

Submitted by: Chris Torek (torek@torek.net)

11 years agoOur libc iconv (unlike gnu iconv and the citrus code in NetBSD) has a
Peter Wemm [Thu, 8 Aug 2013 01:53:27 +0000 (01:53 +0000)]
Our libc iconv (unlike gnu iconv and the citrus code in NetBSD) has a
bypass mode when src == dst.  Unfortunately, there are tools in ports
that pass byte streams through iconv to determine if the encodings
are valid.  eg: gettext-0.18.3+.

Disable the optimization and behave like the other implementations.

11 years agoMFV r254071:
Xin LI [Wed, 7 Aug 2013 22:21:00 +0000 (22:21 +0000)]
MFV r254071:

Fix a regression introduced by fix for Illumos bug #3834.  Quote from
Matthew Ahrens on the Illumos issue:

ztest fails this assertion because ztest_dmu_read_write() does
        dmu_tx_hold_free(tx, bigobj, bigoff, bigsize);
and then
    dmu_object_set_checksum(os, bigobj,
        (enum zio_checksum)ztest_random_dsl_prop(ZFS_PROP_CHECKSUM), tx);

If the region to free is past the end of the file, the DMU assumes that there
will be nothing to do for this object.  However, ztest does set_checksum(),
which must modify the dnode.  The fix is for ztest to also call

    dmu_tx_hold_bonus(tx, bigobj);

so we can account for the dirty data associated with setting the checksum

Illumos ZFS issues:
  3955 ztest failure: assertion refcount_count(&tx->tx_space_written)
         + delta <= tx->tx_space_towrite

11 years agoAllow net80211 to compile on stable/9 and stable/8.
Adrian Chadd [Wed, 7 Aug 2013 22:01:43 +0000 (22:01 +0000)]
Allow net80211 to compile on stable/9 and stable/8.

11 years agoMFV r254070:
Xin LI [Wed, 7 Aug 2013 21:16:14 +0000 (21:16 +0000)]
MFV r254070:

Merge vendor bugfix for ZFS test suite that triggers false positives.

Illumos ZFS issues:
  3949 ztest fault injection should avoid resilvering devices
  3950 ztest: deadman fires when we're doing a scan
  3951 ztest hang when running dedup test
  3952 ztest: ztest_reguid test and ztest_fault_inject don't place nice together

11 years agoImprove the sysctl symbol extraction from the kernel so that it find more
David E. O'Brien [Wed, 7 Aug 2013 20:35:26 +0000 (20:35 +0000)]
Improve the sysctl symbol extraction from the kernel so that it find more
(all?) sysctl's.  Previously some where missed, depending on how they were
defined.

11 years agoDon't emit a spurious EVFILT_PROC event with no fflags set on process exit
John Baldwin [Wed, 7 Aug 2013 19:56:35 +0000 (19:56 +0000)]
Don't emit a spurious EVFILT_PROC event with no fflags set on process exit
if NOTE_EXIT is not being monitored.  The rationale is that a listener
should only get an event for exit() if they registered interest via
NOTE_EXIT.  This matches the behavior on OS X.
- Don't save the exit status on process exit unless NOTE_EXIT is being
  monitored.
- Add an internal EV_DROP flag that requests kqueue_scan() to free the
  knote without signalling it to userland and use this when a process
  exits but the fflags in the knote is zero.

Reviewed by: jmg
MFC after: 1 month

11 years agoUpdate vendor/illumos/dist and vendor-sys/illumos/dist
Xin LI [Wed, 7 Aug 2013 19:53:41 +0000 (19:53 +0000)]
Update vendor/illumos/dist and vendor-sys/illumos/dist
to illumos-gate 14121:6f5ac5d649af:

Illumos ZFS issues:
  3955 ztest failure: assertion refcount_count(&tx->tx_space_written) + delta <= tx->tx_space_towrite

11 years agoUpdate vendor/illumos/dist and vendor-sys/illumos/dist
Xin LI [Wed, 7 Aug 2013 19:51:54 +0000 (19:51 +0000)]
Update vendor/illumos/dist and vendor-sys/illumos/dist
to illumos-gate 14120:e9e346400fef:

Illumos ZFS issues:
  3949 ztest fault injection should avoid resilvering devices
  3950 ztest: deadman fires when we're doing a scan
  3951 ztest hang when running dedup test
  3952 ztest: ztest_reguid test and ztest_fault_inject don't place nice together

11 years agoSplit the pagequeues per NUMA domains, and split pageademon process
Konstantin Belousov [Wed, 7 Aug 2013 16:36:38 +0000 (16:36 +0000)]
Split the pagequeues per NUMA domains, and split pageademon process
into threads each processing queue in a single domain.  The structure
of the pagedaemons and queues is kept intact, most of the changes come
from the need for code to find an owning page queue for given page,
calculated from the segment containing the page.

The tie between NUMA domain and pagedaemon thread/pagequeue split is
rather arbitrary, the multithreaded daemon could be allowed for the
single-domain machines, or one domain might be split into several page
domains, to further increase concurrency.

Right now, each pagedaemon thread tries to reach the global target,
precalculated at the start of the pass.  This is not optimal, since it
could cause excessive page deactivation and freeing.  The code should
be changed to re-check the global page deficit state in the loop after
some number of iterations.

The pagedaemons reach the quorum before starting the OOM, since one
thread inability to meet the target is normal for split queues.  Only
when all pagedaemons fail to produce enough reusable pages, OOM is
started by single selected thread.

Launder is modified to take into account the segments layout with
regard to the region for which cleaning is performed.

Based on the preliminary patch by jeff, sponsored by EMC / Isilon
Storage Division.

Reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation

11 years agoChange the pmap_ts_referenced() method of amd64 pmap to use shared
Konstantin Belousov [Wed, 7 Aug 2013 16:33:15 +0000 (16:33 +0000)]
Change the pmap_ts_referenced() method of amd64 pmap to use shared
pvh_global_lock.  This allows the method to be executed in parallel,
avoiding undue contention on the pvh_global_lock for the multithreaded
pagedaemon.

The pmap_ts_referenced() function has to inspect the page mappings for
several pmaps, which need to be locked while pv list lock is owned.
This contradicts to the lock order, where pmap lock is before pv list
lock.  Introduce the generation count for the pv list of the page or
superpage, which indicate any change in the pv list, and, as usual,
perform restart of the iteration if generation changed while pv lock
was dropped for blocking acquire of a pmap lock.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation

11 years agoFix previous commit: both flags must be set.
Rui Paulo [Wed, 7 Aug 2013 15:55:12 +0000 (15:55 +0000)]
Fix previous commit: both flags must be set.

11 years agoDon't bother trying to work around buffers which are not aligned on a cache
Olivier Houchard [Wed, 7 Aug 2013 15:44:58 +0000 (15:44 +0000)]
Don't bother trying to work around buffers which are not aligned on a cache
line boundary. It has never been 100% correct, and it can't work on SMP,
because nothing prevents another core from accessing data from an unrelated
buffer in the same cache line while we invalidated it. Just use bounce pages
instead.

Reviewed by: ian
Approved by: mux (mentor) (implicit)

11 years agoRemove droping topology mutex after iterating 100 periphs in CAMGETPASSTHRU.
Alexander Motin [Wed, 7 Aug 2013 11:34:20 +0000 (11:34 +0000)]
Remove droping topology mutex after iterating 100 periphs in CAMGETPASSTHRU.
That is not so slow and so often operation to handle unneeded otherwise
xsoftc.xpt_generation and respective locking complications.

11 years agoRemove __attribute__((__aligned__)) that generates incorrect alignment on compilers...
David Chisnall [Wed, 7 Aug 2013 11:30:04 +0000 (11:30 +0000)]
Remove __attribute__((__aligned__)) that generates incorrect alignment on compilers that know about SSE.  Code left over from old header that thought that 64 bits was the maximum alignment that anything would ever need...

11 years agoBring initial support for Allwinner A20 SoC (Cubieboard2).
Ganbold Tsagaankhuu [Wed, 7 Aug 2013 11:07:56 +0000 (11:07 +0000)]
Bring initial support for Allwinner A20 SoC (Cubieboard2).
Add support for A20 timer.
Correct interrupt offset depending from chip.
Add basic code for CPU configuration module.
For now, add kernel config and dts file
(only FDT blob related problem needs to be solved later in
order to have one kernel for both cubieboard1 and 2).

Approved by: ray@

11 years agoImprove r253721 by reporting detected lack of BIO_FLUSH support to GEOM.
Alexander Motin [Wed, 7 Aug 2013 08:20:11 +0000 (08:20 +0000)]
Improve r253721 by reporting detected lack of BIO_FLUSH support to GEOM.
That prevents more of such requests from coming and errors from logging.

11 years agoenable KDB_TRACE in GENERICs
Andriy Gapon [Wed, 7 Aug 2013 08:03:50 +0000 (08:03 +0000)]
enable KDB_TRACE in GENERICs

KDB_TRACE is not an alternative to DDB/etc, they are complementary.
So I do not see any reason to not enable KDB_TRACE by default.

X-MFC after: never (change specific to head)

11 years agoRemove unsigned comparison < 0
Kevin Lo [Wed, 7 Aug 2013 07:22:56 +0000 (07:22 +0000)]
Remove unsigned comparison < 0

Found by: LLVM
Reviewed by: luigi

11 years agoReplace kernel virtual address space allocation with vmem. This provides
Jeff Roberson [Wed, 7 Aug 2013 06:21:20 +0000 (06:21 +0000)]
Replace kernel virtual address space allocation with vmem.  This provides
transparent layering and better fragmentation.

 - Normalize functions that allocate memory to use kmem_*
 - Those that allocate address space are named kva_*
 - Those that operate on maps are named kmap_*
 - Implement recursive allocation handling for kmem_arena in vmem.

Reviewed by: alc
Tested by: pho
Sponsored by: EMC / Isilon Storage Division

11 years agoMake sure IFM_AVALID is also set when checking ifm_status.
Rui Paulo [Wed, 7 Aug 2013 04:03:30 +0000 (04:03 +0000)]
Make sure IFM_AVALID is also set when checking ifm_status.

Submitted by: yongari

11 years agoAdd a missing module version declaration to if_tun(4).
Mark Johnston [Wed, 7 Aug 2013 01:32:08 +0000 (01:32 +0000)]
Add a missing module version declaration to if_tun(4).

PR: 181078
Submitted by: Brandon Gooch <jamesbrandongooch@gmail.com>
MFC after: 1 week

11 years agoFix a timing issue with the wired driver.
Rui Paulo [Wed, 7 Aug 2013 01:01:58 +0000 (01:01 +0000)]
Fix a timing issue with the wired driver.

After configuring the interface, wait for the link to become active.
Many ethernet drivers reset the chip when we set multicast filters
(causing significant delays due to link re-negotiation) and, by the time
we start sending packets, they are discared instead of going to the ether.

Tested by: dumbbell

11 years agoPass variables prefixed with both LD_ and LD_32_ to the run-time linker.
Mark Johnston [Wed, 7 Aug 2013 00:28:17 +0000 (00:28 +0000)]
Pass variables prefixed with both LD_ and LD_32_ to the run-time linker.
This prevents unintentional execution of programs when running ldd(1) on
32-bit Linux binaries.

PR: 175339, 127276
Suggested by: kib, rstone
Reviewed by: kib
MFC after: 2 weeks

11 years agoFill in the description fields for M_FICT_PAGES.
Mark Johnston [Wed, 7 Aug 2013 00:20:30 +0000 (00:20 +0000)]
Fill in the description fields for M_FICT_PAGES.

Reviewed by: kib
MFC after: 3 days

11 years agoChange <sys/diskpc98.h> to not redefine the same symbols that are
Marcel Moolenaar [Wed, 7 Aug 2013 00:00:48 +0000 (00:00 +0000)]
Change <sys/diskpc98.h> to not redefine the same symbols that are
being defined in <sys/diskmbr.h>. Instead give the symbols here a
"PC98_" prefix. This way, both <sys/diskmbr.h> and <sys/diskpc98.h>
can be included in the same C source file.

The renaming is trivial. The only gotcha is that DOSBBSECTOR is
also redefined from 0 to 1. This because DOSBBSECTOR was always
used in conjunction with an addition of 1. The PC98_BBSECTOR symbol
is defined as 1 and the expression is simplified.

Note: it is not believed that ports are seriously impacted; or at
all for that matter.

Approved by: nyan@

11 years agoUpdate vendor-sys/illumos/dist to illumos-gate 14116:b0233279e3fc:
Xin LI [Tue, 6 Aug 2013 21:41:16 +0000 (21:41 +0000)]
Update vendor-sys/illumos/dist to illumos-gate 14116:b0233279e3fc:

Illumos ZFS issues:
  3973 zfs_ioc_rename alters passed in zc->zc_name

This change was committed on FreeBSD as r253926.

11 years agoMFV r254011:
Xin LI [Tue, 6 Aug 2013 21:36:01 +0000 (21:36 +0000)]
MFV r254011:

This change have no effect to FreeBSD but integrated for
completeness.

Illumos ZFS issues:
  348 ZFS should handle DKIOCGMEDIAINFOEXT failure

11 years agoUpdate vendor-sys/illumos/dist to illumos-gate 14100:2c12d65cf215:
Xin LI [Tue, 6 Aug 2013 21:31:37 +0000 (21:31 +0000)]
Update vendor-sys/illumos/dist to illumos-gate 14100:2c12d65cf215:

Illumos ZFS issues:
  348 ZFS should handle DKIOCGMEDIAINFOEXT failure

(Note that this change is Solaris/Illuoms specific).

11 years agoAdjust make knobs to know that WITH_ICONV installs a /usr/bin/iconv
Sean Bruno [Tue, 6 Aug 2013 21:30:37 +0000 (21:30 +0000)]
Adjust make knobs to know that WITH_ICONV installs a /usr/bin/iconv

Remove it if the knob isn't tweaked.  Certain ports seem to think that
if /usr/bin/iconv exists, then libc has built in libiconv things and will
blow up pretty nicely when built.

Reviewed by: gjb@
MFC after: 2 weeks

11 years agoMake the various driver MSIX setup routines fallback to MSI more
Jack F Vogel [Tue, 6 Aug 2013 21:01:38 +0000 (21:01 +0000)]
Make the various driver MSIX setup routines fallback to MSI more
gracefully. This change was suggested by Marius Strobl, thank you.

PR: kern/181016
MFC after: ASAP

11 years ago- Fix a bug in the MSI allocation logic so an MSI is also employed if a
Marius Strobl [Tue, 6 Aug 2013 19:14:02 +0000 (19:14 +0000)]
- Fix a bug in the MSI allocation logic so an MSI is also employed if a
  controller supports only a single message. I haven't seen such an adapter
  out in the wild, though, so this change likely is a NOP.
  While at it, further simplify the MSI allocation logic; there's no need
  to check the number of available messages on our own as pci_alloc_msi(9)
  will just fail if it can't provide us with the single message we want.
- Nuke the unused softc of aacch(4).

MFC after: 1 month

11 years agoAs it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSI
Marius Strobl [Tue, 6 Aug 2013 18:55:59 +0000 (18:55 +0000)]
As it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSI
quirk and apply it to these controllers [1]. The same problem was reported
for 2230S, in which case it wasn't actually clear whether the culprit is the
controller or the mainboard, though. In order to be on the safe side, flag
MSIs as being broken with the latter type of controller as well. Given that
these are the only reports of MSI-related breakage with aac(4) so far and
OSes like OpenSolaris unconditionally employ MSIs for all adapters of this
family, however, it doesn't seem warranted to generally disable the use of
MSIs in aac(4).
While it, simplify the MSI allocation logic a bit; there's no need to check
for the presence of the MSI capability on our own as pci_alloc_msi(9) will
just fail when these kind of interrupts are not available.
Reported and tested by: David Boyd [1]

MFC after: 3 days

11 years agoWhen the igb driver is static there are cases when early interrupts occur,
Jack F Vogel [Tue, 6 Aug 2013 18:00:53 +0000 (18:00 +0000)]
When the igb driver is static there are cases when early interrupts occur,
resulting in a panic in refresh_mbufs, to prevent this add a check in the
interrupt handler for DRV_RUNNING.

MFC after: 1 day (critical for 9.2)

11 years agoFix incompatibility in ICMPV6CTL_ND6_PRLIST sysctl, and SIOCGPRLST_IN6,
Hiroki Sato [Tue, 6 Aug 2013 17:10:52 +0000 (17:10 +0000)]
Fix incompatibility in ICMPV6CTL_ND6_PRLIST sysctl, and SIOCGPRLST_IN6,
SIOCGDRLST_IN6, and SIOCGNBRINFO_IN6 ioctl.  These userland interfaces
treat expiration times in time_second, not time_uptime.

11 years agoThis bug fix is in a code path in rename taken when there is a
Kirk McKusick [Tue, 6 Aug 2013 16:50:05 +0000 (16:50 +0000)]
This bug fix is in a code path in rename taken when there is a
collision between a rename and an open system call for the same
target file. Here, rename releases its vnode references, waits for
the open to finish, and then restarts by reacquiring its needed
vnode locks. In this case, rename was unlocking but failing to
release its reference to one of its held vnodes. The effect was
that even after all the actual references to the vnode had gone,
the vnode still showed active references. For files that had been
removed, their space was not reclaimed until the filesystem was
forcibly unmounted.

This bug manifested itself in the Postgres server which would
leak/lose hundreds of files per day amounting to many gigabytes of
disk space. This bug required shutting down Postgres, forcibly
unmounting its filesystem, remounting its filesystem and restarting
Postgres every few days to recover the lost space.

Reported by: Dan Thomas and Palle Girgensohn
Bug-fix by:  kib
Tested by:   Dan Thomas and Palle Girgensohn
MFC after:   2 weeks

11 years agofix fat-fingering in r253996
Andriy Gapon [Tue, 6 Aug 2013 16:18:07 +0000 (16:18 +0000)]
fix fat-fingering in r253996

MFC after: 17 days
X-MFC with: r253996

11 years agoopensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG
Andriy Gapon [Tue, 6 Aug 2013 15:51:56 +0000 (15:51 +0000)]
opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG

Do this by forcing inclusion of
sys/cddl/compat/opensolaris/sys/debug_compat.h
via -include option into all source files from OpenSolaris.
Note that this -include option must always be after -include opt_global.h.

Additionally, remove forced definition of DEBUG for some modules and fix
their build without DEBUG.

Also, meaning of DEBUG was overloaded to enable WITNESS support for some
OpenSolaris (primarily ZFS) locks.  Now this overloading is removed and
that use of DEBUG is replaced with a new option OPENSOLARIS_WITNESS.

MFC after: 17 days

11 years agoFix build on arm and mips.
Hiroki Sato [Tue, 6 Aug 2013 15:49:18 +0000 (15:49 +0000)]
Fix build on arm and mips.

11 years agoAdd MD (for now) atomic_store_acq_<type>() and use it in pmap_activate()
Marius Strobl [Tue, 6 Aug 2013 15:34:11 +0000 (15:34 +0000)]
Add MD (for now) atomic_store_acq_<type>() and use it in pmap_activate()
to get the semantics when setting the PMAP right. Prior to r251782, the
latter already used implicit acquire semantics, which - currently - means
to not employ additional explicit memory barriers under the hood (see also
r225889).

11 years agoBlock reporting of ZFS features for suspended pools.
Alexander Motin [Tue, 6 Aug 2013 14:41:41 +0000 (14:41 +0000)]
Block reporting of ZFS features for suspended pools.

Before executing any subcommand, zpool tool fetches pools configuration from
the kernel.  Before features support was added, kernel was regenerating that
configuration based on data always present in memory.  Unfortunately, pool
features list and activity counters are not such. They are stored in ZAP,
that normally resides in ARC, but under heavy memory pressure may be swapped
out.  If pool is suspended at this point, there is no way to recover it back
since any zpool command will stuck.

This change has one predictable flaw: `zpool upgrade` always wish to upgrade
suspended pools, but fortunately it can't do it due to the suspension.

11 years agoDisable r252840 when ZFS TRIM is enabled (vfs.zfs.trim.enabled=1) and really
Alexander Motin [Tue, 6 Aug 2013 14:30:28 +0000 (14:30 +0000)]
Disable r252840 when ZFS TRIM is enabled (vfs.zfs.trim.enabled=1) and really
disable TRIM otherwise.

r252840 (illumos bug 3836) is based on assumption that zio_free_sync() has
no lock dependencies and should complete immediately. Unfortunately, with our
TRIM implementation that is not true due to ZIO_STAGE_VDEV_IO_START added
to the ZIO_FREE_PIPELINE, which, while not really accessing devices, still
acquires SCL_ZIO lock for read to be sure devices won't disappear.

When TRIM is disabled, this patch enables direct free execution from r252840
and removes ZIO_STAGE_VDEV_IO_START and ZIO_STAGE_VDEV_IO_ASSESS stages from
the pipeline to avoid lock acquisition.  Otherwise it queues free request as
it was before r252840.

11 years agoMake `zpool clear` to reopen also reconnected cache and spare devices.
Alexander Motin [Tue, 6 Aug 2013 14:23:33 +0000 (14:23 +0000)]
Make `zpool clear` to reopen also reconnected cache and spare devices.
Since `zpool status` reports about such kinds of errors, it is strange
that they are not cleared by `zpool clear`.

11 years agoMake ZFS to use separate thread to handle SPA_ASYNC_REMOVE async events.
Alexander Motin [Tue, 6 Aug 2013 14:20:41 +0000 (14:20 +0000)]
Make ZFS to use separate thread to handle SPA_ASYNC_REMOVE async events.
Existing async thread is running only on successfull spa_sync() completion,
that is impossible in case of pool loosing required (last) disk(s).  That
indefinite delay of SPA_ASYNC_REMOVE processing made ZFS to not close the
lost disks, preventing GEOM/CAM from destroying devices and reusing names
on later disk reattach.

In earlier version of the patch I've tried to just run existing thread
immediately, unrelated to spa_sync() completion, but that exposed number
of situations where it could stuck due to locks held by stuck spa_sync(),
that are required for other kinds of async events.

Experiments with OpenIndiana snapshot confirmed that they also have this
issue with lost disks reattach.

11 years agodtrace: fix compilation with gcc
Andriy Gapon [Tue, 6 Aug 2013 13:55:39 +0000 (13:55 +0000)]
dtrace: fix compilation with gcc

Cowardly taking the easiest way and using -Wno-*

MFC after: 3 days
X-MFC with: r253772

11 years agoMake section headings for different quirk types consistent.
David Malone [Tue, 6 Aug 2013 11:00:56 +0000 (11:00 +0000)]
Make section headings for different quirk types consistent.

11 years agoRemove dead code.
Edward Tomasz Napierala [Tue, 6 Aug 2013 10:42:18 +0000 (10:42 +0000)]
Remove dead code.

11 years agoFix formatting warning.
Andrey V. Elsukov [Tue, 6 Aug 2013 10:35:05 +0000 (10:35 +0000)]
Fix formatting warning.

MFC after: 1 week

11 years agoWe no longer need to align the stack before calling swi_handler as it is
Andrew Turner [Tue, 6 Aug 2013 10:03:44 +0000 (10:03 +0000)]
We no longer need to align the stack before calling swi_handler as it is
already aligned correctly in the PUSHFRAME macro.

11 years agoRemove weirdly-named autofoo file. This is not needed for the (FreeBSD)
Erwin Lansing [Tue, 6 Aug 2013 06:24:37 +0000 (06:24 +0000)]
Remove weirdly-named autofoo file.  This is not needed for the (FreeBSD)
build, and freebsd-update chokes on it.  Somehow it did manage to be merged,
despite my best efforts not to.

Approved by: delphij (mentor)

11 years agoUpdate Bind to 9.8.5-P2
Erwin Lansing [Tue, 6 Aug 2013 06:22:54 +0000 (06:22 +0000)]
Update Bind to 9.8.5-P2

New Features

   Adds a new configuration option, "check-spf"; valid values are
   "warn" (default) and "ignore".  When set to "warn", checks SPF
   and TXT records in spf format, warning if either resource record
   type occurs without a corresponding record of the other resource
   record type.  [RT #33355]

   Adds support for Uniform Resource Identifier (URI) resource
   records. [RT #23386]

   Adds support for the EUI48 and EUI64 RR types. [RT #33082]

   Adds support for the RFC 6742 ILNP record types (NID, LP, L32,
   and L64). [RT #31836]

Feature Changes

   Changes timing of when slave zones send NOTIFY messages after
   loading a new copy of the zone.  They now send the NOTIFY before
   writing the zone data to disk.  This will result in quicker
   propagation of updates in multi-level server structures. [RT #27242]
   "named -V" can now report a source ID string.  (This is will be
   of most interest to developers and troubleshooters).  The source

   ID for ISC's production versions of BIND is defined in the "srcid"
   file in the build tree and is normally set to the most recent
   git hash. [RT #31494]

   Response Policy Zone performance enhancements.  New "response-policy"
   option "min-ns-dots".  "nsip" and "nsdname" now enabled by default
   with RPZ. [RT #32251]

Approved by: delphij (mentor)
Sponsored by: DK Hostmaster A/S

11 years agoUpdate ciss(4) with new models of raid controllers from HP
Sean Bruno [Tue, 6 Aug 2013 03:17:01 +0000 (03:17 +0000)]
Update ciss(4) with new models of raid controllers from HP

Submitted by: scott.benesh@hp.com
MFC after: 2 weeks
Sponsored by: Hewlett Packard

11 years agoMicro-optimize OFW syscons 8-bit blank.
Justin Hibbits [Tue, 6 Aug 2013 03:09:44 +0000 (03:09 +0000)]
Micro-optimize OFW syscons 8-bit blank.

MFC after: 1 week

11 years agoRemove an unnecessary panic. The PVO's PTE entry and the PTEG's PTE entry may
Justin Hibbits [Tue, 6 Aug 2013 02:58:16 +0000 (02:58 +0000)]
Remove an unnecessary panic.  The PVO's PTE entry and the PTEG's PTE entry may
not match, if the PVO's PTE is invalid.

11 years ago- Use pget(PGET_CANDEBUG | PGET_NOTWEXIT) to determine if the specified
Hiroki Sato [Tue, 6 Aug 2013 02:14:30 +0000 (02:14 +0000)]
- Use pget(PGET_CANDEBUG | PGET_NOTWEXIT) to determine if the specified
  PID is valid for monitoring in FILEMON_SET_PID ioctl.

- Set the monitored PID to -1 when the process exits.

Suggested by: jilles
Tested by: sjg
MFC after: 3 days

11 years agoEvict pages from the PTEG when it's full and trying to insert a new PTE,
Justin Hibbits [Tue, 6 Aug 2013 01:01:15 +0000 (01:01 +0000)]
Evict pages from the PTEG when it's full and trying to insert a new PTE,
rather than panicking.

Reviewed by: nwhitehorn
MFC after: 3 weeks

11 years agoWith the addition of journalled soft updates, the "newblk" structures
Kirk McKusick [Mon, 5 Aug 2013 22:02:45 +0000 (22:02 +0000)]
With the addition of journalled soft updates, the "newblk" structures
persist much longer than previously. Historically we had at most 100
entries; now the count may reach a million. With the increased count
we spent far too much time looking them up in the grossly undersized
newblk hash table. Configure the newblk hash table to accurately reflect
the number of entries that it must index.

Reviewed by: kib
Tested by:   Peter Holm
MFC after:   2 weeks

11 years agoTo better understand performance problems with journalled soft updates,
Kirk McKusick [Mon, 5 Aug 2013 22:01:16 +0000 (22:01 +0000)]
To better understand performance problems with journalled soft updates,
we need to collect the highest level of allocation for each of the
different soft update dependency structures. This change collects these
statistics and makes them available using `sysctl debug.softdep.highuse'.

Reviewed by: kib
Tested by:   Peter Holm
MFC after:   2 weeks

11 years agoDocument IPv6 timer value change in r253970.
Hiroki Sato [Mon, 5 Aug 2013 20:30:15 +0000 (20:30 +0000)]
Document IPv6 timer value change in r253970.

11 years agoLet the platform calculate the timer frequency at runtime, and use that for
Olivier Houchard [Mon, 5 Aug 2013 20:14:56 +0000 (20:14 +0000)]
Let the platform calculate the timer frequency at runtime, and use that for
the omap4, instead of relying on the (wrong) value provided in the dts.

11 years ago- Use time_uptime instead of time_second in data structures for
Hiroki Sato [Mon, 5 Aug 2013 20:13:02 +0000 (20:13 +0000)]
- Use time_uptime instead of time_second in data structures for
  PF_INET6 in kernel.  This fixes various malfunction when the wall time
  clock is changed.  Bump __FreeBSD_version to 1000041.

- Use clock_gettime(CLOCK_MONOTONIC_FAST) in userland utilities.

MFC after: 1 month

11 years agoDo not override the ENOENT error for the empty path, or EFAULT errors
Konstantin Belousov [Mon, 5 Aug 2013 19:42:03 +0000 (19:42 +0000)]
Do not override the ENOENT error for the empty path, or EFAULT errors
from copyins, with the relative lookup check.

Discussed with: rwatson
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoWhen entering exception handlers we may not have an aligned stack. This is
Andrew Turner [Mon, 5 Aug 2013 19:06:28 +0000 (19:06 +0000)]
When entering exception handlers we may not have an aligned stack. This is
because an exception may happen at any time. The stack alignment rules on
ARM EABI state the only place the stack must be 8-byte aligned is on a
function boundary.

If an exception happens while a function is setting up or tearing down it's
stack frame it may not be correctly aligned. There is also no requirement
for it to be when the function is a leaf node.

The fix is to align the stack after we have stored a backup of the old stack
pointer, but before we have stored anything in the trapframe. Along with
this we need to adjust the size of the trapframe by 4 bytes to ensure the
stack below it is also correctly aligned.

11 years agoThe tmpfs_alloc_vp() is used to instantiate vnode for the tmpfs node,
Konstantin Belousov [Mon, 5 Aug 2013 18:53:59 +0000 (18:53 +0000)]
The tmpfs_alloc_vp() is used to instantiate vnode for the tmpfs node,
in particular, from the tmpfs_lookup VOP method.  If LK_NOWAIT is not
specified in the lkflags, the lookup is supposed to return an alive
vnode whenever the underlying node is valid.

Currently, the tmpfs_alloc_vp() returns ENOENT if the vnode attached
to node exists and is being reclaimed.  This causes spurious ENOENT
errors from lookup on tmpfs and corresponding random 'No such file'
failures from syscalls working with tmpfs files.

Fix this by waiting for the doomed vnode to be detached from the tmpfs
node if sleepable allocation is requested.

Note that filesystems which use vfs_hash.c, correctly handle the case
due to vfs_hash_get() looping when vget() returns ENOENT for sleepable
requests.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

11 years agoCorrect a fat-finger in the last delta.
Jack F Vogel [Mon, 5 Aug 2013 16:16:50 +0000 (16:16 +0000)]
Correct a fat-finger in the last delta.

MFC after: ASAP

11 years agoMFprojects/camlock r249006:
Alexander Motin [Mon, 5 Aug 2013 12:15:53 +0000 (12:15 +0000)]
MFprojects/camlock r249006:
Pass SIM pointer as an argument to camisr_runqueue() instead of doneq
pointer.

11 years agoMFprojects/camlock r249505:
Alexander Motin [Mon, 5 Aug 2013 11:48:40 +0000 (11:48 +0000)]
MFprojects/camlock r249505:
Change CCB queue resize logic to be able safely handle overallocations:
 - (re)allocate queue space in power of 2 chunks with 64 elements minimum
and never shrink it; with only 4/8 bytes per element size is insignificant.
 - automatically reallocate the queue to double size if it is overflowed.
 - if queue reallocation failed, store extra CCBs in unsorted TAILQ,
fetching them back as soon as some queue element is freed.

To free space in CCB for TAILQ linking, change highpowerq from keeping
high-power CCBs to keeping devices frozen due to high-power CCBs.

This encloses all pieces of queue resize logic inside of cam_queue.[ch],
removing some not obvious duties from xpt_release_ccb().

11 years agoNote NULL encryption method for GELI
Chris Rees [Mon, 5 Aug 2013 10:38:34 +0000 (10:38 +0000)]
Note NULL encryption method for GELI

PR: docs/180551
Submitted by: r4721@tormail.org
Approved by: gjb (mentor)

11 years agoRedirect svnversion stderr to /dev/null if we cannot determine
Glen Barber [Mon, 5 Aug 2013 10:26:42 +0000 (10:26 +0000)]
Redirect svnversion stderr to /dev/null if we cannot determine
the tree version, for example if the tree is checked out with an
outdated svn from ports, but the base system svnlite is built.

Approved by: kib (mentor)

11 years agoRevert r253939:
Attilio Rao [Mon, 5 Aug 2013 08:55:35 +0000 (08:55 +0000)]
Revert r253939:
We cannot busy a page before doing pagefaults.
Infact, it can deadlock against vnode lock, as it tries to vget().
Other functions, right now, have an opposite lock ordering, like
vm_object_sync(), which acquires the vnode lock first and then
sleeps on the busy mechanism.

Before this patch is reinserted we need to break this ordering.

Sponsored by: EMC / Isilon storage division
Reported by: kib

11 years agoFix a panic in tmpaddrtimer.
Hiroki Sato [Mon, 5 Aug 2013 00:36:12 +0000 (00:36 +0000)]
Fix a panic in tmpaddrtimer.

11 years ago - Introduce a specific function, pmap_remove_kernel_pde, for removing
Jeff Roberson [Mon, 5 Aug 2013 00:28:03 +0000 (00:28 +0000)]
 - Introduce a specific function, pmap_remove_kernel_pde, for removing
   huge pages in the kernel's address space.  This works around several
   asserts from pmap_demote_pde_locked that did not apply and gave false
   warnings.

Discovered by: pho
Reviewed by: alc
Sponsored by: EMC / Isilon Storage Division

11 years agoRemove unused member.
Attilio Rao [Sun, 4 Aug 2013 21:17:05 +0000 (21:17 +0000)]
Remove unused member.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc
Tested by: pho

11 years agoThe page hold mechanism is fast but it has couple of fallouts:
Attilio Rao [Sun, 4 Aug 2013 21:07:24 +0000 (21:07 +0000)]
The page hold mechanism is fast but it has couple of fallouts:
- It does not let pages respect the LRU policy
- It bloats the active/inactive queues of few pages

Try to avoid it as much as possible with the long-term target to
completely remove it.
Use the soft-busy mechanism to protect page content accesses during
short-term operations (like uiomove_fromphys()).

After this change only vm_fault_quick_hold_pages() is still using the
hold mechanism for page content access.
There is an additional complexity there as the quick path cannot
immediately access the page object to busy the page and the slow path
cannot however busy more than one page a time (to avoid deadlocks).

Fixing such primitive can bring to complete removal of the page hold
mechanism.

Sponsored by: EMC / Isilon storage division
Discussed with: alc
Reviewed by: jeff
Tested by: pho

11 years agoRemove inclusion of <sys/diskmbr.h>. We have no business knowing
Marcel Moolenaar [Sun, 4 Aug 2013 21:00:22 +0000 (21:00 +0000)]
Remove inclusion of <sys/diskmbr.h>. We have no business knowing
anything related to MBR in this file.

11 years agoFixing a typo.
Hiren Panchasara [Sun, 4 Aug 2013 19:54:47 +0000 (19:54 +0000)]
Fixing a typo.

Approved by: sbruno (mentor, implicit)

11 years agoRegen for if_rsu.
Rui Paulo [Sun, 4 Aug 2013 19:36:46 +0000 (19:36 +0000)]
Regen for if_rsu.

11 years agoFix implicit declaration of warnx().
Robert Millan [Sun, 4 Aug 2013 16:25:46 +0000 (16:25 +0000)]
Fix implicit declaration of warnx().

11 years agoRemove unnecessary soft busy of the page before to do vn_rdwr() in
Attilio Rao [Sun, 4 Aug 2013 15:56:19 +0000 (15:56 +0000)]
Remove unnecessary soft busy of the page before to do vn_rdwr() in
kern_sendfile() which is unnecessary.
The page is already wired so it will not be subjected to pagefault.
The content cannot be effectively protected as it is full of races
already.
Multiple accesses to the same indexes are serialized through vn_rdwr().

Sponsored by: EMC / Isilon storage division
Reviewed by: alc, jeff
Tested by: pho

11 years agozfs_ioc_rename should not leave the value of zc_name passed in via zc altered
Steven Hartland [Sun, 4 Aug 2013 11:38:08 +0000 (11:38 +0000)]
zfs_ioc_rename should not leave the value of zc_name passed in via zc altered
on return.

MFC after: 1 week

11 years agoMove the call to Job_SetPrefix() to Job_Init() so that
Simon J. Gerraty [Sun, 4 Aug 2013 07:10:16 +0000 (07:10 +0000)]
Move the call to Job_SetPrefix() to Job_Init() so that
makefiles have had a chance to set .MAKE.JOB.PREFIX

11 years ago- Reimplement $gif_interfaces as a variant of $cloned_interfaces.
Hiroki Sato [Sun, 4 Aug 2013 06:36:17 +0000 (06:36 +0000)]
- Reimplement $gif_interfaces as a variant of $cloned_interfaces.
  Newly-configured systems should use $cloned_interfaces.

- Call clone_{up,down}() and ifnet_rename() in rc.d/netif {start,stop}.
  ifnet_rename() now accepts an interface name list as its argument.

- Add rc.d/netif clear.  The "clear" subcommand is basically equivalent to
  "stop" but it does not call clone_down().

- Add "ifname:sticky" keyword into $cloned_interfaces.  If :sticky is
  specified, the interface will not be destroyed in rc.d/netif stop.

- Add cloned_interfaces_sticky={YES,NO}.  This variable globally sets
  :sticky keyword above for all interfaces.  The default value is NO.
  When cloned_interfaces_sticky=YES, :nosticky keyword can be used to
  override it on per interface basis.

11 years agoMake r253899 compile.
Marius Strobl [Sat, 3 Aug 2013 21:24:52 +0000 (21:24 +0000)]
Make r253899 compile.

11 years agoFix the bootable CD:
Marcel Moolenaar [Sat, 3 Aug 2013 20:14:29 +0000 (20:14 +0000)]
Fix the bootable CD:
o   We need wait a bit before attempting the root mount. The CD drives
    on HP machines (typical) go through the management controller so
    that it can be virtualized. In practice what this means is that it
    is slow to detect and attach.
o   Tell the kernel what to use as the root file system. The /etc/fstab
    trick doesn't work, because we're on the EFI-compatble file system.

11 years agoRemove duplicate definition of SPR MMCR0.
Justin Hibbits [Sat, 3 Aug 2013 18:05:12 +0000 (18:05 +0000)]
Remove duplicate definition of SPR MMCR0.

MFC after: 3 days

11 years agoAfter r253839, which modifies ld's behaviour to not automatically pull
Dimitry Andric [Sat, 3 Aug 2013 16:23:43 +0000 (16:23 +0000)]
After r253839, which modifies ld's behaviour to not automatically pull
in needed libraries, change libc++.so into a linker script, so it can
automatically pull in libcxxrt.so.

MFC after: 1 week

11 years agoFix typo.
Edward Tomasz Napierala [Sat, 3 Aug 2013 13:38:56 +0000 (13:38 +0000)]
Fix typo.

11 years agoTweak the imx debug console code so that it works with multiple SoCs.
Ian Lepore [Sat, 3 Aug 2013 13:31:10 +0000 (13:31 +0000)]
Tweak the imx debug console code so that it works with multiple SoCs.

Instead of hard-coding the uart register addresses for the imx51, use
a variable that defaults to the imx51 address.  When debugging another
imx-family SoC, the variable can be set early in initarm() to provide
full console/printf support for debugging early boot.

11 years agoAdd missing depend.
Ulrich Spörlein [Sat, 3 Aug 2013 08:21:35 +0000 (08:21 +0000)]
Add missing depend.

11 years agoAdd a tunable for the default timeout.
Marcel Moolenaar [Sat, 3 Aug 2013 04:25:25 +0000 (04:25 +0000)]
Add a tunable for the default timeout.

11 years agoFollow-up commit to fix CR0 issues. Maintain
Peter Grehan [Sat, 3 Aug 2013 03:16:42 +0000 (03:16 +0000)]
Follow-up commit to fix CR0 issues. Maintain
architectural state on CR vmexits by guaranteeing
that EFER, CR0 and the VMCS entry controls are
all in sync when transitioning to IA-32e mode.

Submitted by: Tycho Nightingale (tycho.nightingale <at> plurisbusnetworks.com)

11 years agoConst'ify scc_driver_name.
Marius Strobl [Fri, 2 Aug 2013 23:31:51 +0000 (23:31 +0000)]
Const'ify scc_driver_name.