brooks [Tue, 23 Oct 2012 21:20:05 +0000 (21:20 +0000)]
MFC r228120:
Allow NO_FOO to override WITH_FOO that could be specified in /etc/src.conf.
This is required to override knobs (e.g. WITH_PROFILE) during buildworld
stages in Makefile.inc1 (otherwise the build is stopped due to both WITH_FOO
and WITHOUT_FOO defined).
marius [Sun, 21 Oct 2012 11:43:47 +0000 (11:43 +0000)]
MFC: r241679
It turns out that as documented, PCF8563_R_SECOND_VL (i.e. battery low)
doesn't automatically clear when VDD rises above Vlow again and needs to be
cleared manually. However, apparently this needs all of the time registers
to be set, i.e. pcf8563_settime(), and not just PCF8563_R_SECOND in order
for PCF8563_R_SECOND_VL to stick. Thus, we just issue a warning during
pcf8563_attach() rather than failing with ENXIO in case it is set.
mav [Fri, 19 Oct 2012 17:45:56 +0000 (17:45 +0000)]
MFC r241375:
Cast vendor-specific spell on VIA VT1818S codecs alike to VT1708S to
make analog input loopback and dual-stream playback work by enabling
signal mixing by nid 22, as it should be according to info returned by
the CODEC. Otherwise pin nid 28 receives only signal from DAC nid 16.
jhb [Fri, 19 Oct 2012 11:01:39 +0000 (11:01 +0000)]
MFC 206082,206179,207056,207057,210612,210636,210656,212423,212426,228121,
228124,228137,228140,228141,228147,228153,228158,228311,241395,241396:
Convert WITH_CTF into a normal build option where MK_CTF is set to yes/no
depending on WITH_CTF/WITHOUT_CTF. In addition, WITH_CTF can now be
specified in src.conf (not recommended, there are some problems with
static executables), make.conf (would also affect ports which do not use
GNU make and do not override the compile targets) or in the kernel config
(via "makeoptions WITH_CTF=yes").
marius [Thu, 18 Oct 2012 14:57:11 +0000 (14:57 +0000)]
MFC: r239864
- Unlike cache invalidation and TLB demapping IPIs, reading registers from
other CPUs doesn't require locking so get rid of it. As the latter is used
for the timecounter on certain machine models, using a spin lock in this
case can lead to a deadlock with the upcoming callout(9) rework.
- Merge r134227/r167250 from x86:
Avoid cross-IPI SMP deadlock by using the smp_ipi_mtx spin lock not only
for smp_rendezvous_cpus() but also for the MD cache invalidation and TLB
demapping IPIs.
- Mark some unused function arguments as such.
rmacklem [Mon, 15 Oct 2012 01:13:36 +0000 (01:13 +0000)]
MFC: r241097
Attila Bogar and Herbert Poeckl both reported similar problems
w.r.t. a Linux NFS client doing a krb5 NFS mount against the
FreeBSD server. We determined this was a Linux bug:
http://www.spinics.net/lists/linux-nfs/msg32466.html, however
the mount failed to work, because the Destroy operation with a
bogus encrypted checksum destroyed the authenticator handle.
This patch changes the rpcsec_gss code so that it doesn't
Destroy the authenticator handle for this case and, as such,
the Linux mount will work.
jimharris [Tue, 9 Oct 2012 19:59:22 +0000 (19:59 +0000)]
MFC r240901:
Use CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE to report missing targets or
LUNs respectively. This removes a huge number of error messages
from CAM during bus scans.
jimharris [Tue, 9 Oct 2012 19:57:18 +0000 (19:57 +0000)]
MFC r240900:
Specify MTX_RECURSE for the controller's io_lock. Without it, tws(4)
immediately panics on boot with INVARIANTS enabled. The driver already
clearly expects to be able to recurse on this mutex - the main I/O path
is always recursing on this lock.
jhb [Tue, 9 Oct 2012 18:45:08 +0000 (18:45 +0000)]
MFC 201279,201280,201286,213907,214146,220195,222753,223371,225515,235833:
Various fixes to managing PCI BARs including proper support for managing
PCI ROM BARs:
- Teach the PCI bus driver to handle PCIR_BIOS BARs properly and remove
special handling for the PCIR_BIOS decoding enable bit from the cardbus
driver. The PCIR_BIOS BAR does include type bits like other BARs.
Instead, it is always a 32-bit non-prefetchable memory BAR where the low
bit is used as a flag to enable decoding.
- Explicitly track the state of all known BARs for each PCI device. The PCI
bus driver will now remember the size of a BAR obtained during the initial
bus scan and use that size when doing lazy resource allocation rather than
resizing the BAR. The bus driver will now also report unallocated BARs to
userland for display by 'pciconf -lb'.
- Add a constant for the offset of the ROM BIOS BAR in PCI-PCI bridges and
properly handle ROM BIOS BARs in PCI-PCI bridges. The PCI bus now also
properly handles the lack of a ROM BIOS BAR in a PCI-Cardbus bridge.
sbruno [Tue, 9 Oct 2012 18:02:05 +0000 (18:02 +0000)]
MFC r240879
This patch fixes a nit in the em, lem, and igb driver statistics. Increment
adapter->dropped_pkts instead of if_ierrors because if_ierrors is
overwritten by hw stats collection.
Submitted by: Andrew Boyer <aboyer@averesystems.com>
Reviewed by: Jack F Vogel <jfv@freebsd.org>
obrien [Tue, 9 Oct 2012 05:06:30 +0000 (05:06 +0000)]
MF9: r237100: MFC r236338, r236339, r236346, r236347, r236365, & r236977
* Deprecate the FreeBSD 10's make's ":U" (to-upper case) and ":L"
(to-lower case) modifiers for ":tu" and ":tl".
* make it easier to test newly-built make.
* Add "-V '${VAR}'" variable expansion from Portable Berkeley Make.
* regression test for '-V' command line option and the :t[lu] modifiers.
rmacklem [Mon, 8 Oct 2012 13:14:00 +0000 (13:14 +0000)]
MFC: r240902
Attila Bogar reported a bug in mountd when multiple export
entries with different security flavors are in the exports(5)
file. For that case, mountd replies with the security flavors
of the last entry and not the correct one for the client host.
This patch fixes that by storing separate copies of the flavors
for each host/net case, plus a default one for the case where
no hosts/nets are specified on an entry in the exports(5) file.
Unlike the patch in the PR, it replies with the security flavors
for the entry instead of merging the security flavors for all
the entries and replying with that.
jhb [Sun, 7 Oct 2012 21:33:04 +0000 (21:33 +0000)]
MFC 239955-239957:
Cleanups and fixes for building firmware modules into a kernel:
- Add common rules for building firmware object files (NORMAL_FW to run
uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those
instead of explicit ld/uudecode invocations in sys/conf/files. Apart from
increasing readability, this makes it possible to adjust the flags used for
firmware objects in one place.
- Similar to how r171350 fixed linking of kernel modules containing
firmware objects by adding --no-warn-mismatch to the linker flags,
add --no-warn-mismatch when linking firmware objects (*.fwo) as
well as to the link of the main kernel file. This permits firmware
modules to be statically linked into an ia64 kernel.
jhb [Sun, 7 Oct 2012 20:17:24 +0000 (20:17 +0000)]
MFC 212429:
Add real dependancies on the uuencoded firmwares.
Now when one does 'make kernel ; make kernel' the second invocation
only does: `kernel.ko' is up to date.
rather than reproduce all the .fw files and relink the kernel.
jhb [Sun, 7 Oct 2012 18:57:52 +0000 (18:57 +0000)]
MFC 239440,239519:
Refine the changes made in r208212 to avoid bogus failures from
if_delmulti() when clearing the configuration for a subinterface when
the parent interface is being detached. The current code was still
triggering an assertion in if_delmulti() due to the parent interface being
partially detached. Fix this by not calling if_delmulti() at all if the
parent interface is being detached. Warn if if_delmulti() fails when the
parent is not being detached (but similar to 208212, still proceed with
tearing down the vlan state).
jhb [Sun, 7 Oct 2012 18:31:17 +0000 (18:31 +0000)]
MFC 226961,239951:
Add a -h flag similar to the -h flag for ln to force mv(1) to treat a
symbolic link to a directory for the target as a symbolic link instead of
a directory. This makes it possible to atomically update a symbolic
link using rename().
jhb [Sun, 7 Oct 2012 18:25:48 +0000 (18:25 +0000)]
MFC 239906:
Clarify that bus_dma does not stall future load requests once a load is
deferred. The caller is required to enforce that if that is desired.
jhb [Sun, 7 Oct 2012 18:19:13 +0000 (18:19 +0000)]
MFC 239913:
Attach interrupt handlers during attach instead of during the first time
the interface is brought up. Without this, the boot time interrupt
round-robin assignment does not think the allocated interrupt resources
are active and leaves them assigned to CPU 0.
While here, add descriptive tags to each interrupt handler when MSI-X
is used.
rmacklem [Sat, 6 Oct 2012 22:14:19 +0000 (22:14 +0000)]
MFC: r240720
Modify the NFSv4 client so that it can handle owner
and owner_group strings that consist entirely of
digits, interpreting them as the uid/gid number.
This change was needed since new (>= 3.3) Linux
servers reply with these strings by default.
This change is mandated by the rfc3530bis draft.
Reported on freebsd-stable@ under the Subject
heading "Problem with Linux >= 3.3 as NFSv4 server"
by Norbert Aschendorff on Aug. 20, 2012.
mav [Sat, 6 Oct 2012 14:04:36 +0000 (14:04 +0000)]
MFC r239185, r239196:
Some minor tunings/cleanups inspired by bde@ after previous commits:
- remove extra dynamic variable initializations;
- restore (4BSD) and implement (ULE) hogticks variable setting;
- make sched_rr_interval() more tolerant to options;
- restore (4BSD) and implement (ULE) kern.sched.quantum sysctl, a more
user-friendly wrapper for sched_slice;
- tune some sysctl descriptions;
- make some style fixes.
mav [Sat, 6 Oct 2012 13:43:56 +0000 (13:43 +0000)]
MFC r239157:
Rework r220198 change (by fabient). I believe it solves the problem from
the wrong direction. Before it, if preemption and end of time slice happen
same time, thread was put to the head of the queue as for only preemption.
It could cause single thread to run for indefinitely long time. r220198
handles it by not clearing TDF_NEEDRESCHED in case of preemption. But that
causes delayed context switch every time preemption happens, even when not
needed.
Solve problem by introducing scheduler-specifoc thread flag TDF_SLICEEND,
set when thread's time slice is over and it should be put to the tail of
queue. Using SW_PREEMPT flag for that purpose as it was before just not
enough informative to work correctly.
On my tests this by 2-3 times reduces run time deviation (improves fairness)
in cases when several threads share one CPU.
mav [Sat, 6 Oct 2012 13:42:21 +0000 (13:42 +0000)]
MFC r239153:
SCHED_4BSD scheduling quantum mechanism appears to be broken for some time.
With switchticks variable being reset each time thread preempted (that is
done regularly by interrupt threads) scheduling quantum may never expire.
It was not noticed in time because several other factors still regularly
trigger context switches.
Handle the problem by replacing that mechanism with its equivalent from
SCHED_ULE called time slice. It is effectively the same, just measured in
context of stathz instead of hz. Some unification is probably not bad.
mav [Sat, 6 Oct 2012 13:38:49 +0000 (13:38 +0000)]
MFC r212455:
Merge some SCHED_ULE features to SCHED_4BSD:
- Teach SCHED_4BSD to inform cpu_idle() about high sleep/wakeup rate to
choose optimized handler. In case of x86 it is MONITOR/MWAIT. Also it
will be needed to bypass forthcoming idle tick skipping logic to not
consume resources on events rescheduling when it won't give any benefits.
- Teach SCHED_4BSD to wake up idle CPUs without using IPI. In case of x86,
when MONITOR/MWAIT is active, it require just single memory write. This
doubles performance on some heavily switching test loads.
mav [Sat, 6 Oct 2012 12:25:13 +0000 (12:25 +0000)]
MFC r232207, r232454, r234066:
Rework CPU load balancing in SCHED_ULE:
- In sched_pickcpu() be more careful taking previous CPU on SMT systems.
Do it only if all other logical CPUs of that physical one are idle to avoid
extra resource sharing.
- In sched_pickcpu() change general logic of CPU selection. First
look for idle CPU, sharing last level cache with previously used one,
skipping SMT CPU groups. If none found, search all CPUs for the least loaded
one, where the thread with its priority can run now. If none found, search
just for the least loaded CPU.
- Make cpu_search() compare lowest/highest CPU load when comparing CPU
groups with equal load. That allows to differentiate 1+1 and 2+0 loads.
- Make cpu_search() to prefer specified (previous) CPU or group if load
is equal. This improves cache affinity for more complicated topologies.
- Randomize CPU selection if above factors are equal. Previous code tend
to prefer CPUs with lower IDs, causing unneeded collisions.
- Rework periodic balancer in sched_balance_group(). With cpu_search()
more intelligent now, make balansing process flat, removing recursion
over the topology tree. That fixes double swap problem and makes load
distribution more even and predictable.
All together this gives 10-15% performance improvement in many tests on
CPUs with SMT, such as Core i7, for number of threads is less then number
of logical CPUs. In some tests it also gives positive effect to systems
without SMT.
eadler [Fri, 5 Oct 2012 22:42:57 +0000 (22:42 +0000)]
MFC r241116:
Correct the tip about finding all the directories on the system
Add a tip about clearing the screen.
Make things more consistent by removing quotes around 'make search'
rmacklem [Thu, 4 Oct 2012 21:55:37 +0000 (21:55 +0000)]
MFC: r240289
Add a simple printf() based debug facility to the new nfs client.
Use it for a printf() that can be harmlessly generated for mmap()'d
files. It will be used extensively for the NFSv4.1 client.
Debugging printf()s are enabled by setting vfs.nfs.debuglevel to
a non-zero value. The higher the value, the more debugging printf()s.