Fix regression introduced in r215088: gpart(8) reports
"arg0 'provider': Invalid argument" after creating new partition
table.
Move code for search of existing geom into g_part_find_geom
function and use this function instead of g_part_parm_geom
in g_part_ctl_create.
The softdep_setup_freeblocks() adds worklist items before
deallocate_dependencies() is done. This opens a race between softdep
thread and the thread that does the truncation:
A write of the indirect block causes the freeblks to become
ALLCOMPLETE while softdep_setup_freeblocks() dropped softdep lock. And
then, softdep_disk_write_complete() would reassign the workitem to the
mount point worklist, causing premature processing of the workitem, or
journal write exhaust the fb_jfreeblkhd and handle_written_jfreeblk does
the same reassign.
indir_trunc() then would find the indirect block that is locked (with lock
owned by kernel) but without any dependencies, causing it to hang in
getblk() waiting for buffer lock.
Do not mark freeblks as DEPCOMPLETE until deallocate_dependencies()
finished.
Analyzed, suggested and reviewed by: jeff
Tested by: pho
In journal_mount(), only set MNTK_SUJ flag after the jblocks are mapped.
I believe there is a window otherwise where jblocks can be accessed
without proper initialization.
Randall Stewart [Thu, 11 Nov 2010 05:40:39 +0000 (05:40 +0000)]
Fix so that a multicast packet can be sent
even if there is no route out to that mcast address. The code in
in_pcb inadvertantly would error (no route) even though
the user may have specified the address with the
proper socket option (to specify the egress interface).
Thanks bz for reminding me I forgot to commit this ;-)
Colin Percival [Thu, 11 Nov 2010 00:29:19 +0000 (00:29 +0000)]
Zero the buffer containing the .gnu_debuglink section before writing
into it. Prior to this commit the .gnu_debuglink section can have up
to 3 bytes of uninitialized garbage; as a result, .ko files could
change vary between builds.
Nick Hibma [Wed, 10 Nov 2010 23:45:44 +0000 (23:45 +0000)]
Add a man page for usb_quirk module, plus references in other man pages,
and updated comments in the usb_quirk.h header file.
The main purpose of this is to expose the quirks for ejecting 3G
modules. usb_modeswitch in Linux does a great job of collecting
information on these, and with the quirks module people can try out the
modeswitch config file entries on FreeBSD, hence the SCSI strings in the
man page.
Nathan Whitehorn [Wed, 10 Nov 2010 20:28:10 +0000 (20:28 +0000)]
Entering deep nap mode on the 970MP requires that both MSR[NAP] and
MSR[DEEPNAP] be set, not just MSR[DEEPNAP]. Fixing this reduces the idle
temperature of my CPUs from 57 to 38 degrees and makes one-shot timer
mode work properly.
Alan Cox [Wed, 10 Nov 2010 17:57:34 +0000 (17:57 +0000)]
Enable reservation-based physical memory allocation. Even without the
creation of large page mappings in the pmap, it can provide modest
performance benefits. In particular, for a "buildworld" on a 2x 1GHz
Ultrasparc IIIi it reduced the wall clock time by 2.2% and the system
time by 12.6%.
Warner Losh [Wed, 10 Nov 2010 06:39:49 +0000 (06:39 +0000)]
Complete the integration of tbemd branch into head.
TARGET_BIG_ENDIAN is now completely dead, except where it was
originally supposed to be used (internally in the toolchain building).
TARGET_ARCH has changed in three cases:
(1) Little endian mips has changed to mipsel.
(2) Big endian mips has changed to mipseb.
(3) Big endian arm has changed to armeb.
Some additional changes are needed to make 'make universe' work on arm
and mips after this change, so those are commented out for now.
UPDATING information will be forthcoming. Any remaining rough edges
will be hammered out in -current.
Warner Losh [Wed, 10 Nov 2010 05:32:36 +0000 (05:32 +0000)]
When we switched to the gpart backend, and provided selection between
MBR & GPT, the MBR full-disk init failed to stamp boot1, and results
in a boot not found error. This patch fixes the issue.
Warner Losh [Tue, 9 Nov 2010 22:32:09 +0000 (22:32 +0000)]
Merge from tbemd:
o TARGET=mips --> little endian 32-bit mips build
o mipsel and mipseb TARGET_ARCH are both mips TARGETs
o Add some more architecture combinations
John Baldwin [Tue, 9 Nov 2010 20:46:41 +0000 (20:46 +0000)]
- Remove <machine/mutex.h>. Most of the headers were empty, and the
contents of the ones that were not empty were stale and unused.
- Now that <machine/mutex.h> no longer exists, there is no need to allow it
to override various helper macros in <sys/mutex.h>.
- Rename various helper macros for low-level operations on mutexes to live
in the _mtx_* or __mtx_* namespaces. While here, change the names to more
closely match the real API functions they are backing.
- Drop support for including <sys/mutex.h> in assembly source files.
Make all OF client interface calls return the maximum kind of
does-not-exist error when no client interface module is installed instead
of dereferencing NULL pointers. This eases implementation of platforms
that may or may not have Open Firmware.
Pyun YongHyeon [Tue, 9 Nov 2010 01:52:09 +0000 (01:52 +0000)]
Only moderate TX completion interrupts. Relying on taskqueue to
suppress RX interrupts seems to give better RX performance than
RX interrupt moderation.
Jilles Tjoelker [Mon, 8 Nov 2010 23:15:10 +0000 (23:15 +0000)]
test: Move tests to tools/regression/bin/test.
Convert the tests to the perl prove format.
Remove obsolete TEST.README (results of an old TEST.sh for some old Unices)
and TEST.csh (old tests without correct values, far less complete than
TEST.sh).
Pyun YongHyeon [Mon, 8 Nov 2010 21:50:50 +0000 (21:50 +0000)]
Follow the lead of vendor's interrupt moderation mechanism.
It seems RTL8169/RTL8168/RTL810xE has a kind of interrupt
moderation mechanism but it is not documented at all. The magic
value dramatically reduced number of interrupts without noticeable
performance drops so apply it to all RTL8169/RTL8169 controllers.
Vendor's FreeBSD driver also applies it to RTL810xE controllers but
their Linux driver explicitly cleared the register, so do not
enable interrupt moderation for RTL810xE controllers.
John Baldwin [Mon, 8 Nov 2010 21:50:45 +0000 (21:50 +0000)]
Remove support for autoloading ACPI from the loader. Leave in the code to
detect ACPI and export info such as the location of the RSDP via hints as
that is still useful.
Juli Mallett [Mon, 8 Nov 2010 21:22:55 +0000 (21:22 +0000)]
o) Recognize the Lanner MR-730.
o) Fix enumeration of PHY addresses on the MR-955.
o) Parse link state for the MR-730 using the Broadcom PHY support in the SDK.
It's not clear that this is entirely-correct, but it seems to work. Since
this board uses a BCM5482S, this may mean that we work correctly for copper
but not SFI, which is untested.
John Baldwin [Mon, 8 Nov 2010 20:44:11 +0000 (20:44 +0000)]
Don't mention 'device acpi' or loading ACPI as a kernel module since the
latter is not supported. This is also more consistent with manpages for
other vendor-specific drivers such as acpi_ibm(4) and acpi_sony(4).
John Baldwin [Mon, 8 Nov 2010 20:35:09 +0000 (20:35 +0000)]
Sync the APIC startup sequence with amd64:
- Register APIC enumerators at SI_SUB_TUNABLES - 1 instead of SI_SUB_CPU - 1.
- Probe CPUs at SI_SUB_TUNABLES - 1. This allows i386 to set a truly
accurate mp_maxid value rather than always setting it to MAXCPU - 1.
John Baldwin [Mon, 8 Nov 2010 20:32:35 +0000 (20:32 +0000)]
Remove stub symbols for APIC-related functions when 'device apic' is not
included in a kernel config. These stubs had existed previously so that
acpi.ko could always include the MADT parsing code and still link with a
kernel that did not include 'device apic'.
John Baldwin [Mon, 8 Nov 2010 20:03:51 +0000 (20:03 +0000)]
Only dump the values of the PMC and CMCI local vector table entries on a
local APIC if those LVT entries are valid. This quiets spurious illegal
register local APIC errors during boot on a CPU that doesn't support those
vectors.
Pyun YongHyeon [Mon, 8 Nov 2010 19:15:31 +0000 (19:15 +0000)]
Reduce spin wait time consumed in GMII register access routine.
There were a couple of attempts in the past to reduce it since it
took more than 1ms. Because mii_tick() periodically polls link
status, waiting more than 1ms for each GMII register access was
overkill. Unfortunately all previous attempts were failed with
various ways on different controllers.
This time, add additional 20us dealy at the end of GMII register
access which seems to requirement of all RealTek controllers to
issue next GMII register access request. This is the same way what
Linux does.
Alexander Motin [Mon, 8 Nov 2010 15:59:41 +0000 (15:59 +0000)]
When requesting sense data for SIM not doing it automatically (such as
ATAPI or USB), request only as much data as requested by consumer.
On the way back -- report how much sense data we have actually received.
Alexander Motin [Mon, 8 Nov 2010 15:25:12 +0000 (15:25 +0000)]
On APs startup skip hard-/statclock events, which time passed before CPU
was lauched. Few seconds event burst, accumulated during long startup,
reported to cause panic in SCHED_ULE priority calculation logic.
Pyun YongHyeon [Mon, 8 Nov 2010 01:15:42 +0000 (01:15 +0000)]
Use shorten model name instead of showing all controller model
numbers. bge(4) supports too many models such that it's
unreasonable to list all these controllers in one line description
of name. While I'm here mention that BCM590x/BCM5779x is Fast
Ethernet controller.
bge(4) still lacks support for some controllers but supporting
these controllers should be easy now and adding new controllers
do not require touching .Nd any more.
Nick Hibma [Sun, 7 Nov 2010 21:57:57 +0000 (21:57 +0000)]
- Set -x flag when executing customisation scripts to aid in debugging them.
- Use KERNCONFDIR with KERNCONF instead of copying the kernel config into the source tree
so included kernel configs work.
- Put more stuff in the _.bk/_.ik log file, not just make statements.
- Add the kernel config name to the pprint during kernel installation.
- Add NANO_MODULES providing a list of modules to build and install.
Alan Cox [Sun, 7 Nov 2010 21:40:34 +0000 (21:40 +0000)]
In case the stack size reaches its limit and its growth must be restricted,
ensure that grow_amount is a multiple of the page size. Otherwise, the
kernel may crash in swap_reserve_by_uid() on HEAD and FreeBSD 8.x, and
produce a core file with a missing stack on FreeBSD 7.x.