]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoUPDATING entry for r212647
avg [Wed, 15 Sep 2010 10:04:41 +0000 (10:04 +0000)]
UPDATING entry for r212647

13 years agosys/pcpu.h: remove a workaround for a fixed ld bug
avg [Wed, 15 Sep 2010 10:02:46 +0000 (10:02 +0000)]
sys/pcpu.h: remove a workaround for a fixed ld bug

The workaround was incorrectly documented as having something to do with
set_pcpu section's progbits, but in fact it was for incorrect placement
of __start_set_pcpu because of the bug in ld.
The bug was fixed in r210245, see commit message for details.

A side-effect of the workaround was that a zero-size set_pcpu section was
produced for modules, source code of which included pcpu.h but didn't
actually define any dynamic per-cpu variables.
This commit should remove the side-effect.

The same workaround is present sys/net/vnet.h, has an analogous side-effect
and can be removed as well.

An UPDATING entry that warns about a need for recent ld is following.

MFC after: 1 month

13 years agoChange licenses of my manual pages to the recommended 2-clause form.
mav [Wed, 15 Sep 2010 07:10:39 +0000 (07:10 +0000)]
Change licenses of my manual pages to the recommended 2-clause form.

Suggested by: joel

13 years agoAdd eventtimers(7) man page, briefly describing event timers subsystem
mav [Wed, 15 Sep 2010 07:04:14 +0000 (07:04 +0000)]
Add eventtimers(7) man page, briefly describing event timers subsystem
functionality and configuration options.

13 years agoAdd 64-bit SWARM board kernel configs.
neel [Wed, 15 Sep 2010 05:32:10 +0000 (05:32 +0000)]
Add 64-bit SWARM board kernel configs.

13 years agoFactor out the common parts of the swarm board in SWARM_COMMON and start
neel [Wed, 15 Sep 2010 05:29:13 +0000 (05:29 +0000)]
Factor out the common parts of the swarm board in SWARM_COMMON and start
including that in SWARM and SWARM_SMP kernel configs.

13 years agoMake the meaning of the 'mask' argument to 'set_intr_mask(mask)' consistent
neel [Wed, 15 Sep 2010 05:10:50 +0000 (05:10 +0000)]
Make the meaning of the 'mask' argument to 'set_intr_mask(mask)' consistent
with the meaning of IM bits in the status register.

Reviewed by: jmallett, jchandra

13 years agoAdd hpet(4) man page.
mav [Wed, 15 Sep 2010 04:51:07 +0000 (04:51 +0000)]
Add hpet(4) man page.

13 years agoadd code to support stack unwinding when thread exits. note that only
davidxu [Wed, 15 Sep 2010 02:56:32 +0000 (02:56 +0000)]
add code to support stack unwinding when thread exits. note that only
defer-mode cancellation works, asynchrnous mode does not work because
it lacks of libuwind's support. stack unwinding is not enabled unless
LIBTHR_UNWIND_STACK is defined in Makefile.

13 years agoMove back IN_GCLIST flag into field tlflags, since thread list and gc list
davidxu [Wed, 15 Sep 2010 01:21:30 +0000 (01:21 +0000)]
Move back IN_GCLIST flag into field tlflags, since thread list and gc list
still share same lock.

13 years agoAdd some enums and constants from Adaptec's latest driver
emaste [Wed, 15 Sep 2010 01:19:11 +0000 (01:19 +0000)]
Add some enums and constants from Adaptec's latest driver
(build 17911).

13 years agoIntroduce inheritance into the PowerPC MMU kobj interface.
grehan [Wed, 15 Sep 2010 00:17:52 +0000 (00:17 +0000)]
Introduce inheritance into the PowerPC MMU kobj interface.

include/mmuvar.h - Change the MMU_DEF macro to also create the class
definition as well as define the DATA_SET. Add a macro, MMU_DEF_INHERIT,
which has an extra parameter specifying the MMU class to inherit methods
from. Update the comments at the start of the header file to describe the
new macros.

booke/pmap.c
aim/mmu_oea.c
aim/mmu_oea64.c - Collapse mmu_def_t declaration into updated MMU_DEF macro

The MMU_DEF_INHERIT macro will be used in the PS3 MMU implementation to
allow it to inherit the stock powerpc64 MMU methods.

Reviewed by: nwhitehorn

13 years agoFixes spellings and uses the better sentence. While I'm here bumps
weongyo [Tue, 14 Sep 2010 23:27:06 +0000 (23:27 +0000)]
Fixes spellings and uses the better sentence.  While I'm here bumps
date.

Pointed by: imp, Ruslan Mahmatkhanov <cvs-src at yandex dot ru>

13 years agoMFp4 (//depot/projects/mps/...)
ken [Tue, 14 Sep 2010 21:40:29 +0000 (21:40 +0000)]
MFp4 (//depot/projects/mps/...)

Add a man page for the mps(4) driver, and reference it in the
mpt(4) driver man page.

Sponsored by: Spectra Logic Corporation

13 years agoForce commit to note, than the previous change was...
pjd [Tue, 14 Sep 2010 20:55:25 +0000 (20:55 +0000)]
Force commit to note, than the previous change was...

Submitted by: ae

13 years agoRemove dead code.
pjd [Tue, 14 Sep 2010 20:54:22 +0000 (20:54 +0000)]
Remove dead code.

13 years agoUse saner nsegments and maxsegsz parameters when creating certain DMA tags;
marius [Tue, 14 Sep 2010 20:41:06 +0000 (20:41 +0000)]
Use saner nsegments and maxsegsz parameters when creating certain DMA tags;
tags for 1-byte allocations cannot possibly be split across 2 segments and
maxsegsz must not exceed maxsize.

13 years agoRemove a KASSERT which will also trigger for perfectly valid combinations
marius [Tue, 14 Sep 2010 20:31:09 +0000 (20:31 +0000)]
Remove a KASSERT which will also trigger for perfectly valid combinations
of small maxsize and "large" (including BUS_SPACE_UNRESTRICTED) nsegments
parameters. Generally using a presz of 0 (which indeed might indicate the
use of bogus parameters for DMA tag creation) is not fatal, it just means
that no additional DVMA space will be preallocated.

13 years agoRemove redundant raising of the PIL to PIL_TICK as the respective locore
marius [Tue, 14 Sep 2010 19:35:43 +0000 (19:35 +0000)]
Remove redundant raising of the PIL to PIL_TICK as the respective locore
code already did that.

13 years agoRename the field to not confuse readers. The bytes are actually used.
kib [Tue, 14 Sep 2010 18:58:51 +0000 (18:58 +0000)]
Rename the field to not confuse readers. The bytes are actually used.

Discussed with: rmacklem
MFC after: 1 week

13 years agoUpdate comments in soft updates code to more fully describe
mckusick [Tue, 14 Sep 2010 18:04:05 +0000 (18:04 +0000)]
Update comments in soft updates code to more fully describe
the addition of journalling. Only functional change is to
tighten a KASSERT.

Reviewed by: jeff Roberson

13 years agoMFp4: (//depot/projects/mps/...)
ken [Tue, 14 Sep 2010 17:22:06 +0000 (17:22 +0000)]
MFp4: (//depot/projects/mps/...)

Report data overruns properly.

Submitted by: scottl

13 years agoRemove now unused G_TYPE_ASCNUM.
pjd [Tue, 14 Sep 2010 16:22:22 +0000 (16:22 +0000)]
Remove now unused G_TYPE_ASCNUM.

13 years ago- Change all places where G_TYPE_ASCNUM is used to G_TYPE_NUMBER.
pjd [Tue, 14 Sep 2010 16:21:13 +0000 (16:21 +0000)]
- Change all places where G_TYPE_ASCNUM is used to G_TYPE_NUMBER.
  It turns out the new type wasn't really needed.
- Reorganize code a little bit.

13 years agoUpdate two last places where "arg0" should be used instead of "geom".
pjd [Tue, 14 Sep 2010 16:19:09 +0000 (16:19 +0000)]
Update two last places where "arg0" should be used instead of "geom".

13 years agoRemove duplicated VFS_HOLD due to a mismerge.
mm [Tue, 14 Sep 2010 12:12:18 +0000 (12:12 +0000)]
Remove duplicated VFS_HOLD due to a mismerge.

PR: kern/150544
Approved by: delphij (mentor)
MFC after: 1 day

13 years agoSynchronize newfs(8) manual with code.
gjb [Tue, 14 Sep 2010 12:12:07 +0000 (12:12 +0000)]
Synchronize newfs(8) manual with code.

PR: 61716
Submitted by: Radim Kolar <hsn at netmag cz>
Patch by: arundel
Approved by: keramida (mentor)
MFC after: 1 week

13 years agoSimplify the code a bit.
pjd [Tue, 14 Sep 2010 11:42:07 +0000 (11:42 +0000)]
Simplify the code a bit.

13 years agoAll gpart(8) subcommands apart from the 'bootcode' subcommand handle
pjd [Tue, 14 Sep 2010 11:36:26 +0000 (11:36 +0000)]
All gpart(8) subcommands apart from the 'bootcode' subcommand handle
given geom/provider names with and without /dev/ prefix. Teach the
'bootcode' subcommand to handle /dev/<foo> names as well.

13 years agoRemove dot which shouldn't be here, as err(3) will attach error message
pjd [Tue, 14 Sep 2010 11:19:21 +0000 (11:19 +0000)]
Remove dot which shouldn't be here, as err(3) will attach error message
at the end of the string.

13 years agoIntroduce special G_VAL_OPTIONAL define, which when given in value field
pjd [Tue, 14 Sep 2010 11:13:46 +0000 (11:13 +0000)]
Introduce special G_VAL_OPTIONAL define, which when given in value field
tells geom(8) to ignore it when it is not given and don't try to obtain
default value.

13 years agoAdd missing vop_vector zfsctl_ops_shares
mm [Tue, 14 Sep 2010 10:27:32 +0000 (10:27 +0000)]
Add missing vop_vector zfsctl_ops_shares
Add missing locks around VOP_READDIR and VOP_GETATTR with z_shares_dir

PR: kern/150544
Approved by: delphij (mentor)
Obtained from: perforce (pjd)
MFC after: 1 day

13 years agoFix panic on NULL dereference possible after r212541.
mav [Tue, 14 Sep 2010 10:26:49 +0000 (10:26 +0000)]
Fix panic on NULL dereference possible after r212541.

13 years agoMake kern_tc.c provide minimum frequency of tc_ticktock() calls, required
mav [Tue, 14 Sep 2010 08:48:06 +0000 (08:48 +0000)]
Make kern_tc.c provide minimum frequency of tc_ticktock() calls, required
to handle current timecounter wraps. Make kern_clocksource.c to honor that
requirement, scheduling sleeps on first CPU for no more then specified
period. Allow other CPUs to sleep up to 1/4 second (for any case).

13 years agoReplace spin lock with the set of atomics. It is impractical for one
mav [Tue, 14 Sep 2010 04:57:30 +0000 (04:57 +0000)]
Replace spin lock with the set of atomics. It is impractical for one
tc_ticktock() call to wait for another's completion -- just skip it.

13 years agoAdd some foot shooting protection by checking singlemul value correctness.
mav [Tue, 14 Sep 2010 04:48:04 +0000 (04:48 +0000)]
Add some foot shooting protection by checking singlemul value correctness.
Rephrase sysctls descriptions.

Suggested by: edmaste

13 years agoResurrect PSIM support by moving the cacheline size-detection warning
grehan [Tue, 14 Sep 2010 03:18:11 +0000 (03:18 +0000)]
Resurrect PSIM support by moving the cacheline size-detection warning
printf outside of the MMU-disabled region. A call into OpenFirmware
with the MMU off resulted in an internal PSIM assert.

13 years agoAvoid repeatedly spamming the console while a timed out command is waiting
emaste [Tue, 14 Sep 2010 01:51:04 +0000 (01:51 +0000)]
Avoid repeatedly spamming the console while a timed out command is waiting
to complete.  Instead, print one message after the timeout period expires,
and one more when (if) the command eventually completes.

MFC after: 1 month

13 years agoPort r212559 to mips.
neel [Tue, 14 Sep 2010 01:48:01 +0000 (01:48 +0000)]
Port r212559 to mips.

Do not explicitly enable interrupts in smp_init_secondary() because it
renders any spinlock protected code after that point to run with
interrupts enabled. This is because the processor is executing in the
context of idlethread whose 'md_spinlock_count' is already set to 1.

Instead just let sched_throw() re-enable interrupts when it releases
the spinlock.

The original powerpc commit log for r212559 is available here:
http://svn.freebsd.org/viewvc/base?view=revision&revision=212559

13 years agoRemove libf2c. It hasn't been used for more than 11 years, since revision
emaste [Tue, 14 Sep 2010 01:40:59 +0000 (01:40 +0000)]
Remove libf2c.  It hasn't been used for more than 11 years, since revision
1.90 (CVS; SVN r45770) of lib/Makefile.

13 years agoRemove extra ;
emaste [Tue, 14 Sep 2010 01:33:21 +0000 (01:33 +0000)]
Remove extra ;

13 years agoEnforce that pmap_mapdev() always returns uncacheable mappings.
neel [Tue, 14 Sep 2010 01:27:53 +0000 (01:27 +0000)]
Enforce that pmap_mapdev() always returns uncacheable mappings.

Reviewed by: imp, jchandra, jmallett

13 years agoFix a missing set of parantheses that could cause recent versions of libthr
nwhitehorn [Mon, 13 Sep 2010 22:50:05 +0000 (22:50 +0000)]
Fix a missing set of parantheses that could cause recent versions of libthr
to crash deferencing a NULL pointer to the user context on powerpc64
systems with COMPAT_FREEBSD32 defined.

13 years agoFix segment:offset calculation of interrupt vector for relocated video BIOS
jkim [Mon, 13 Sep 2010 19:58:46 +0000 (19:58 +0000)]
Fix segment:offset calculation of interrupt vector for relocated video BIOS
when the original offset is bigger than size of one page.  X86BIOS macros
cannot be used here because it is assumed address is only linear in a page.

Tested by: netchild

13 years agoSplit $ipv6_prefer into $ip6addrctl_policy and $ipv6_activate_all_interfaces.
hrs [Mon, 13 Sep 2010 19:55:40 +0000 (19:55 +0000)]
Split $ipv6_prefer into $ip6addrctl_policy and $ipv6_activate_all_interfaces.

The $ip6addrctl_policy is a variable to choose a pre-defined address
selection policy set by ip6addrctl(8).
The keyword "ipv4_prefer" sets IPv4-preferred one described in Section 10.3,
the keyword "ipv6_prefer" sets IPv6-preferred one in Section 2.1 in RFC 3484,
respectively.  When "AUTO" is specified, it attempts to read
/etc/ip6addrctl.conf first.  If it is found, it reads and installs it as
a policy table.  If not, either of the two pre-defined policy tables is
chosen automatically according to $ipv6_activate_all_interfaces.

When $ipv6_activate_all_interfaces=NO, interfaces which have no corresponding
$ifconfig_IF_ipv6 is marked as IFDISABLED for security reason.

The default values are ip6addrctl_policy=AUTO and
ipv6_activate_all_interfaces=NO.

Discussed with: ume and bz

13 years agoLocalize $_punct_c in get_if_var() and whitespace clean-ups.
hrs [Mon, 13 Sep 2010 19:53:54 +0000 (19:53 +0000)]
Localize $_punct_c in get_if_var() and whitespace clean-ups.

Based on: changes in r206408 by dougb

13 years ago- Check some specific IFs first in ipv6_autoconfif().
hrs [Mon, 13 Sep 2010 19:53:22 +0000 (19:53 +0000)]
- Check some specific IFs first in ipv6_autoconfif().
- $ipv6_enable supports YES|TRUE|ON|1 as in checkyesno().

Based on: changes in r206408 by dougb

13 years agoAdd $ipv6_privacy to support net.inet6.ip6.use_tempaddr. Note that this
hrs [Mon, 13 Sep 2010 19:52:46 +0000 (19:52 +0000)]
Add $ipv6_privacy to support net.inet6.ip6.use_tempaddr.  Note that this
will be replaced with a per-IF version later.

Based on: changes in r206408 by dougb

13 years agoFix $ipv6_network_interfaces and set it as AUTO by default.
hrs [Mon, 13 Sep 2010 19:52:04 +0000 (19:52 +0000)]
Fix $ipv6_network_interfaces and set it as AUTO by default.

Based on: changes in r206408 by dougb

13 years agoRevert changes in r206408.
hrs [Mon, 13 Sep 2010 19:51:15 +0000 (19:51 +0000)]
Revert changes in r206408.

Discussed with: dougb, core.5, and core.6

13 years agoRemove the page queues lock around vm_page_undirty() - it is no longer needed.
pjd [Mon, 13 Sep 2010 19:47:09 +0000 (19:47 +0000)]
Remove the page queues lock around vm_page_undirty() - it is no longer needed.

Reviewed by: alc

13 years agoRevert r212370, as it causes a LOR on powerpc. powerpc does a few
mdf [Mon, 13 Sep 2010 18:48:23 +0000 (18:48 +0000)]
Revert r212370, as it causes a LOR on powerpc.  powerpc does a few
unexpected things in copyout(9) and so wiring the user buffer is not
sufficient to perform a copyout(9) while holding a random mutex.

Requested by: nwhitehorn

13 years agoAllow a kernel config to specify a set but empty value via
emaste [Mon, 13 Sep 2010 18:26:34 +0000 (18:26 +0000)]
Allow a kernel config to specify a set but empty value via
'makeoptions OPTION=' for consistency with the make commandline.

Previously 'makeoptions WERROR=' would result in a syntax error; now
it produces the same effect as 'makeoptions WERROR'.  Both forms now
result in 'WERROR=' in the generated Makefile.

13 years agoBump __FreeBSD_version to reflect the userland DTrace changes.
rpaulo [Mon, 13 Sep 2010 17:53:43 +0000 (17:53 +0000)]
Bump __FreeBSD_version to reflect the userland DTrace changes.

Sponsored by: The FreeBSD Foundation
> Description of fields to fill in above:                     76 columns --|
> PR:            If a GNATS PR is affected by the change.
> Submitted by:  If someone else sent in the change.
> Reviewed by:   If someone else reviewed your modification.
> Approved by:   If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
> Security:      Vulnerability reference (one per line) or description.
> Empty fields above will be automatically removed.

M    param.h

13 years agoAdd a note about userland DTracing.
rpaulo [Mon, 13 Sep 2010 17:49:39 +0000 (17:49 +0000)]
Add a note about userland DTracing.

Sponsored by: The FreeBSD Foundation
> Description of fields to fill in above:                     76 columns --|
> PR:            If a GNATS PR is affected by the change.
> Submitted by:  If someone else sent in the change.
> Reviewed by:   If someone else reviewed your modification.
> Approved by:   If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
> Security:      Vulnerability reference (one per line) or description.
> Empty fields above will be automatically removed.

M    UPDATING

13 years agoTARGET_64BIT isn't needed anymore, GC it (partial merge from tbemd).
imp [Mon, 13 Sep 2010 16:39:33 +0000 (16:39 +0000)]
TARGET_64BIT isn't needed anymore, GC it (partial merge from tbemd).

13 years agoFix a subtle bug uncovered by the recent one-shot timer import in which
nwhitehorn [Mon, 13 Sep 2010 15:36:42 +0000 (15:36 +0000)]
Fix a subtle bug uncovered by the recent one-shot timer import in which
any spin locks acquired between the enabling of interrupts in
machdep_ap_bootstrap() and the invocation of the scheduler would fail to
have interrupts disabled due to the fake spinlock already held by the
idle thread. sched_throw(NULL) will enable interrupts by itself when
exiting this spinlock, so just let it do that and don't enable interrupts
here.

13 years agoMove to using Makefile.arch to include the proper target-specific programs.
imp [Mon, 13 Sep 2010 15:30:09 +0000 (15:30 +0000)]
Move to using Makefile.arch to include the proper target-specific programs.

13 years agoChange call order to enable interrupts only after timer being programmed.
mav [Mon, 13 Sep 2010 14:25:07 +0000 (14:25 +0000)]
Change call order to enable interrupts only after timer being programmed.

Submitted by: nwhitehorn

13 years agoAdd G_TYPE_MULTI flag, which when set for the given option, will
pjd [Mon, 13 Sep 2010 13:59:28 +0000 (13:59 +0000)]
Add G_TYPE_MULTI flag, which when set for the given option, will
allow the option to be specified multiple times. This will help to
implement things like passing multiple keyfiles to geli(8) instead of
cat(1)ing them all into stdin and reading from there using one '-k -'
option.

13 years ago- Remove gc_argname field. It was introduced for gpart(8), but if I
pjd [Mon, 13 Sep 2010 13:48:18 +0000 (13:48 +0000)]
- Remove gc_argname field. It was introduced for gpart(8), but if I
  understand everything correctly, we don't really need it.
- Provide default numeric value as strings. This allows to simplify
  a lot of code.
- Bump version number.

13 years agosys/mips/rmi/msgring.h - fixes and clean up.
jchandra [Mon, 13 Sep 2010 13:11:50 +0000 (13:11 +0000)]
sys/mips/rmi/msgring.h - fixes and clean up.

- Remove sync from msgrng_send, sync needs to be called just once before
  sending.
- Fix retry logic - don't reload registers when retrying in message_send,
  also fix check for send pending fail.
- remove unused message_send_block_fast()
- merge message_receive_fast() to message_receive
- style(9) fixes, and comments
- rge and nlge updated for the sys/mips/rmi/msgring.h changes

13 years agoDon't compare thread pointers again.
davidxu [Mon, 13 Sep 2010 11:58:42 +0000 (11:58 +0000)]
Don't compare thread pointers again.

13 years agoFix copy&paste problem.
davidxu [Mon, 13 Sep 2010 11:57:46 +0000 (11:57 +0000)]
Fix copy&paste problem.

13 years agobus_add_child method is needed now.
jchandra [Mon, 13 Sep 2010 11:47:35 +0000 (11:47 +0000)]
bus_add_child method is needed now.

13 years agoacpi_cpu: do not apply P_LVLx_LAT rules to latencies returned by _CST
avg [Mon, 13 Sep 2010 09:51:24 +0000 (09:51 +0000)]
acpi_cpu: do not apply P_LVLx_LAT rules to latencies returned by _CST

ACPI specification sates that if P_LVL2_LAT > 100, then a system doesn't
support C2; if P_LVL3_LAT > 1000, then C3 is not supported.
But there are no such rules for Cx state data returned by _CST.  If a
state is not supported it should not be included into the return
package.  In other words, any latency value returned by _CST is valid,
it's up to the OS and/or user to decide whether to use it.

Submitted by: nork
Suggested by: mav
MFC after: 1 week

13 years agoUpdate symbol.
davidxu [Mon, 13 Sep 2010 09:23:38 +0000 (09:23 +0000)]
Update symbol.

13 years ago- Allow to specify value as const pointers.
pjd [Mon, 13 Sep 2010 08:56:07 +0000 (08:56 +0000)]
- Allow to specify value as const pointers.
- Make optional string values always an empty string.

13 years agobus_add_child: add specialized default implementation that calls panic
avg [Mon, 13 Sep 2010 08:34:20 +0000 (08:34 +0000)]
bus_add_child: add specialized default implementation that calls panic

If a kobj method doesn't have any explicitly provided default
implementation, then it is auto-assigned kobj_error_method.
kobj_error_method is proper only for methods that return error code,
because it just returns ENXIO.
So, in the case of unimplemented bus_add_child caller would get
(device_t)ENXIO as a return value, which would cause the mistake to go
unnoticed, because return value is typically checked for NULL.
Thus, a specialized null_add_child is added.  It would have sufficied
for correctness to return NULL, but this type of mistake was deemed to
be rare and serious enough to call panic instead.

Watch out for this kind of problem with other kobj methods.

Suggested by: jhb, imp
MFC after: 2 weeks

13 years agoSimplify atomic selection
imp [Mon, 13 Sep 2010 07:29:02 +0000 (07:29 +0000)]
Simplify atomic selection

13 years agoPrefer MACHINE_CPUARCH over MACHINE_ARCH
imp [Mon, 13 Sep 2010 07:27:03 +0000 (07:27 +0000)]
Prefer MACHINE_CPUARCH over MACHINE_ARCH

13 years agoRefactor timer management code with priority to one-shot operation mode.
mav [Mon, 13 Sep 2010 07:25:35 +0000 (07:25 +0000)]
Refactor timer management code with priority to one-shot operation mode.
The main goal of this is to generate timer interrupts only when there is
some work to do. When CPU is busy interrupts are generating at full rate
of hz + stathz to fullfill scheduler and timekeeping requirements. But
when CPU is idle, only minimum set of interrupts (down to 8 interrupts per
second per CPU now), needed to handle scheduled callouts is executed.
This allows significantly increase idle CPU sleep time, increasing effect
of static power-saving technologies. Also it should reduce host CPU load
on virtualized systems, when guest system is idle.

There is set of tunables, also available as writable sysctls, allowing to
control wanted event timer subsystem behavior:
  kern.eventtimer.timer - allows to choose event timer hardware to use.
On x86 there is up to 4 different kinds of timers. Depending on whether
chosen timer is per-CPU, behavior of other options slightly differs.
  kern.eventtimer.periodic - allows to choose periodic and one-shot
operation mode. In periodic mode, current timer hardware taken as the only
source of time for time events. This mode is quite alike to previous kernel
behavior. One-shot mode instead uses currently selected time counter
hardware to schedule all needed events one by one and program timer to
generate interrupt exactly in specified time. Default value depends of
chosen timer capabilities, but one-shot mode is preferred, until other is
forced by user or hardware.
  kern.eventtimer.singlemul - in periodic mode specifies how much times
higher timer frequency should be, to not strictly alias hardclock() and
statclock() events. Default values are 2 and 4, but could be reduced to 1
if extra interrupts are unwanted.
  kern.eventtimer.idletick - makes each CPU to receive every timer interrupt
independently of whether they busy or not. By default this options is
disabled. If chosen timer is per-CPU and runs in periodic mode, this option
has no effect - all interrupts are generating.

As soon as this patch modifies cpu_idle() on some platforms, I have also
refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions
(if supported) under high sleep/wakeup rate, as fast alternative to other
methods. It allows SMP scheduler to wake up sleeping CPUs much faster
without using IPI, significantly increasing performance on some highly
task-switching loads.

Tested by: many (on i386, amd64, sparc64 and powerc)
H/W donated by: Gheorghe Ardelean
Sponsored by: iXsystems, Inc.

13 years agoPrefer MACHINE_CPUARCH to MACHINE_ARCH unless there's a good reason...
imp [Mon, 13 Sep 2010 07:22:14 +0000 (07:22 +0000)]
Prefer MACHINE_CPUARCH to MACHINE_ARCH unless there's a good reason...

13 years agoPS_DEAD state needs not be checked because _thr_find_thread() has already
davidxu [Mon, 13 Sep 2010 07:18:00 +0000 (07:18 +0000)]
PS_DEAD state needs not be checked because _thr_find_thread() has already
checked it.

13 years agoUse MACHINE_CPUARCH as appropriate
imp [Mon, 13 Sep 2010 07:16:48 +0000 (07:16 +0000)]
Use MACHINE_CPUARCH as appropriate
Define __KLD_SHARED to be yes or no depending on if the target uses shared
binaries for klds or not (this also eliminates 4 uses of MACHINE_ARCH).

13 years agoIt turns out that TARGET_CPUARCH doesn't buy us much here, if anything, but
imp [Mon, 13 Sep 2010 07:15:01 +0000 (07:15 +0000)]
It turns out that TARGET_CPUARCH doesn't buy us much here, if anything, but
costs us another copy of the transform.  Revert it.

# Maybe makefile.inc1 should set TARGET_CPUARCH for the cross-tools, but
# it doesn't now.  That would solve problems in other places too.

Submitted by: jmallet@

13 years agoConvert thread list lock from mutex to rwlock.
davidxu [Mon, 13 Sep 2010 07:03:01 +0000 (07:03 +0000)]
Convert thread list lock from mutex to rwlock.

13 years agoDoh! two last second refactoring typos crept in. Fix.
imp [Mon, 13 Sep 2010 06:50:07 +0000 (06:50 +0000)]
Doh! two last second refactoring typos crept in.  Fix.

13 years agoRevert r212513 and reimplement the search order to be ARCH, CPUARCH
imp [Mon, 13 Sep 2010 06:35:35 +0000 (06:35 +0000)]
Revert r212513 and reimplement the search order to be ARCH, CPUARCH

13 years agoAdd tunable 'hint.hpet.X.per_cpu' to specify how much per-CPU timers driver
mav [Mon, 13 Sep 2010 06:32:56 +0000 (06:32 +0000)]
Add tunable 'hint.hpet.X.per_cpu' to specify how much per-CPU timers driver
should provide if there is sufficient hardware. Default is 1.

13 years agoThe functions in sys/mips/mips/psraccess.S can be implemented with
jchandra [Mon, 13 Sep 2010 05:03:37 +0000 (05:03 +0000)]
The functions in sys/mips/mips/psraccess.S can be implemented with
mips_rd_status/mips_wr_status.  Implement them in mips/include/cpufunc.h,
and remove psraccess.S.

Reviewed by: neel, imp

13 years agoThis is exactly the same as the .else, so remove it.
imp [Mon, 13 Sep 2010 04:23:23 +0000 (04:23 +0000)]
This is exactly the same as the .else, so remove it.

13 years agoOoops! Shouldn't have committed this
imp [Mon, 13 Sep 2010 02:26:36 +0000 (02:26 +0000)]
Ooops!  Shouldn't have committed this

13 years agoMF tbemd: Move to using Makefile.arch to select what to build.
imp [Mon, 13 Sep 2010 02:25:21 +0000 (02:25 +0000)]
MF tbemd: Move to using Makefile.arch to select what to build.

Reviewed by: arch@ (no objection)

13 years agoMerge from tbemd: Move to using Makefile.arch to control what's build.
imp [Mon, 13 Sep 2010 02:23:03 +0000 (02:23 +0000)]
Merge from tbemd: Move to using Makefile.arch to control what's build.

Reviewed by: (arch@, no objection)

13 years agoMerge from tbemd: use Makefile.arch to control building.
imp [Mon, 13 Sep 2010 02:21:07 +0000 (02:21 +0000)]
Merge from tbemd: use Makefile.arch to control building.

Reviewed by: arch@ (many times, no objection)

13 years agoMFtbemd: use MACHINE_CPUARCH
imp [Mon, 13 Sep 2010 02:05:42 +0000 (02:05 +0000)]
MFtbemd: use MACHINE_CPUARCH

13 years agoUse :T:Micc here like everywhere else we test icc
imp [Mon, 13 Sep 2010 02:02:20 +0000 (02:02 +0000)]
Use :T:Micc here like everywhere else we test icc

13 years agoMFtbemd: Move to using MACHINE_CPUARCH, now that it is safe.
imp [Mon, 13 Sep 2010 01:44:56 +0000 (01:44 +0000)]
MFtbemd: Move to using MACHINE_CPUARCH, now that it is safe.

13 years agoInclude FreeBSD svn tag
imp [Mon, 13 Sep 2010 01:44:07 +0000 (01:44 +0000)]
Include FreeBSD svn tag

13 years agoMerge from tbemd, with a small amount of rework:
imp [Mon, 13 Sep 2010 01:43:10 +0000 (01:43 +0000)]
Merge from tbemd, with a small amount of rework:
For all libthr contexts, use ${MACHINE_CPUARCH}
for all libc contexts, use ${MACHINE_ARCH} if it exists, otherwise use
${MACHINE_CPUARCH}
Move some common code up a layer (the .PATH statement was the same in
all the arch submakefiles).

# Hope she hasn't busted powerpc64 with this...

13 years agoMerge from tbemd:
imp [Mon, 13 Sep 2010 01:29:51 +0000 (01:29 +0000)]
Merge from tbemd:
Add directory names directly and sort at the end.
Include bsd.arch.inc.mk so we can, in the future, more easily make arch
dependent changes in /bin (unlikely, but is needed for symmetry).

13 years agomerge powerpc and powerpc64 now that we use TARGET_CPUARCH
imp [Mon, 13 Sep 2010 01:20:53 +0000 (01:20 +0000)]
merge powerpc and powerpc64 now that we use TARGET_CPUARCH

13 years agoMove to using TARGET_CPUARCH instead of TARGET_ARCH.
imp [Mon, 13 Sep 2010 01:00:48 +0000 (01:00 +0000)]
Move to using TARGET_CPUARCH instead of TARGET_ARCH.

13 years agoUse TARGET_CPUARCH instead of TARGET_ARCH here. Define TARGET_CPUARCH
imp [Mon, 13 Sep 2010 00:57:48 +0000 (00:57 +0000)]
Use TARGET_CPUARCH instead of TARGET_ARCH here.  Define TARGET_CPUARCH
based on TARGET_ARCH.  Use TARGET_ARCH still for a powerpc64 test.
Futureproof for coming mipsel/mipseb and arm/armeb rename.

13 years agosh: Add __dead2 to two functions that do not return.
jilles [Sun, 12 Sep 2010 22:00:31 +0000 (22:00 +0000)]
sh: Add __dead2 to two functions that do not return.

Apart from helping static analyzers, this also appears to reduce the size of
the binary slightly.

13 years agoIn pmap_remove_all(), do not decrease pm_stats.wired_count if the mapping was
cognet [Sun, 12 Sep 2010 20:46:32 +0000 (20:46 +0000)]
In pmap_remove_all(), do not decrease pm_stats.wired_count if the mapping was
wired, as it's been done later in pmap_nuke_pv().

Submitted by: Mark Tinguely

13 years agoDo not fork nfsiod directly from the vop methods. This causes LORs between
kib [Sun, 12 Sep 2010 19:06:08 +0000 (19:06 +0000)]
Do not fork nfsiod directly from the vop methods. This causes LORs between
vnode lock and several locks needed during fork, like fd lock.

Instead, schedule the task to be executed in the taskqueue context. We
still waiting for the fork to finish, but the context of the thread
executing the task does not make real LORs with our vnode lock.

Submitted by: pluknet at gmail com
Reviewed by: jhb
Tested by: pho
MFC after: 3 weeks

13 years agoIn backup_kernel(), support backing up subdirectories and handle files
jh [Sun, 12 Sep 2010 18:53:44 +0000 (18:53 +0000)]
In backup_kernel(), support backing up subdirectories and handle files
with spaces correctly.

Approved by: cperciva
MFC after: 1 month

13 years agoAdding an address on an interface also requires the loopback route to
qingli [Sun, 12 Sep 2010 18:04:47 +0000 (18:04 +0000)]
Adding an address on an interface also requires the loopback route to
that address be installed.

PR: kern/150481
Submitted by: Ingo Flaschberger <if at xip.at>
MFC after: 5 days