]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoExtend the kernel unit number allocator for allocating specific unit
jh [Mon, 5 Jul 2010 16:23:55 +0000 (16:23 +0000)]
Extend the kernel unit number allocator for allocating specific unit
numbers. This change adds a new function alloc_unr_specific() which
returns the requested unit number if it is free. If the number is
already allocated or out of the range, -1 is returned.

Update alloc_unr(9) manual page accordingly and add a MLINK for
alloc_unr_specific(9).

Discussed on: freebsd-hackers

14 years agoIncrement 'sa' at the end of the loop; otherwise, only the first
brucec [Mon, 5 Jul 2010 03:55:49 +0000 (03:55 +0000)]
Increment 'sa' at the end of the loop; otherwise, only the first
address ever gets checked.

Approved by: rrs (mentor)
MFC after: 1 month

14 years agoFix the clear function which has been broken for a bit.
mjacob [Sun, 4 Jul 2010 22:17:56 +0000 (22:17 +0000)]
Fix the clear function which has been broken for a bit.

MFC after: 1 week

14 years agoLet boot(8) refer to the uart(4) serial driver, which is the replacement
bcr [Sun, 4 Jul 2010 20:39:07 +0000 (20:39 +0000)]
Let boot(8) refer to the uart(4) serial driver, which is the replacement
for the obsolete sio(4) driver.

PR:             docs/144498
Submitted by:   Bruce Cran (bruce at cran dot org dot uk)
Approved by:    marcel
MFC after:      2 weeks

14 years agoSeveral cleanups for the r209686:
kib [Sun, 4 Jul 2010 19:02:32 +0000 (19:02 +0000)]
Several cleanups for the r209686:
- remove unused defines;
- remove unused curgeneration argument for vm_object_page_collect_flush();
- always assert that vm_object_page_clean() is called for OBJT_VNODE;
- move vm_page_find_least() into for() statement initial clause.

Submitted by: alc

14 years agoObey sv_syscallnames bounds in syscallname().
kib [Sun, 4 Jul 2010 18:16:17 +0000 (18:16 +0000)]
Obey sv_syscallnames bounds in syscallname().

Reported and tested by: pho

14 years ago- Pin the IPI cache and TLB demap functions in order to prevent migration
marius [Sun, 4 Jul 2010 12:43:12 +0000 (12:43 +0000)]
- Pin the IPI cache and TLB demap functions in order to prevent migration
  between determining the other CPUs and calling cpu_ipi_selected(), which
  apart from generally doing the wrong thing can lead to a panic when a
  CPU is told to IPI itself (which sun4u doesn't support).
  Reported and tested by: Nathaniel W Filardo
- Add __unused where appropriate.

MFC after: 3 days

14 years agoFor "thread signal" command, print some information from siginfo when
kib [Sun, 4 Jul 2010 12:09:30 +0000 (12:09 +0000)]
For "thread signal" command, print some information from siginfo when
available.

Suggested by: davidxu
MFC after: 2 weeks

14 years agoExtend the td_thrinfo_t to include siginfo for the signal that stopped
kib [Sun, 4 Jul 2010 12:08:04 +0000 (12:08 +0000)]
Extend the td_thrinfo_t to include siginfo for the signal that stopped
the target. Take care of ABI.

Suggested by: davidxu
MFC after: 2 weeks

14 years agoExtend ptrace(PT_LWPINFO) to report siginfo for the signal that caused
kib [Sun, 4 Jul 2010 11:48:30 +0000 (11:48 +0000)]
Extend ptrace(PT_LWPINFO) to report siginfo for the signal that caused
debugee stop. The change should keep the ABI. Take care of compat32.

Discussed with: davidxu, jhb
MFC after: 2 weeks

14 years agoConstify source argument for siginfo_to_siginfo32().
kib [Sun, 4 Jul 2010 11:43:53 +0000 (11:43 +0000)]
Constify source argument for siginfo_to_siginfo32().

MFC after: 1 week

14 years agoReimplement vm_object_page_clean(), using the fact that vm object memq
kib [Sun, 4 Jul 2010 11:26:56 +0000 (11:26 +0000)]
Reimplement vm_object_page_clean(), using the fact that vm object memq
is ordered by page index. This greatly simplifies the implementation,
since we no longer need to mark the pages with VPO_CLEANCHK to denote
the progress. It is enough to remember the current position by index
before dropping the object lock.

Remove VPO_CLEANCHK and VM_PAGER_IGNORE_CLEANCHK as unused.
Garbage-collect vm.msync_flush_flags sysctl.

Suggested and reviewed by: alc
Tested by: pho

14 years agoIntroduce a helper function vm_page_find_least(). Use it in several places,
kib [Sun, 4 Jul 2010 11:13:33 +0000 (11:13 +0000)]
Introduce a helper function vm_page_find_least(). Use it in several places,
which inline the function.

Reviewed by: alc
Tested by: pho
MFC after: 1 week

14 years agoUse ISO C99 integer types instead of the BSD-specific u_int*_t.
brucec [Sun, 4 Jul 2010 08:09:33 +0000 (08:09 +0000)]
Use ISO C99 integer types instead of the BSD-specific u_int*_t.

Approved by: rrs (mentor)

14 years agoAdd a safety-belt. If the identified disk has 0 blocks, don't attach
imp [Sun, 4 Jul 2010 07:42:52 +0000 (07:42 +0000)]
Add a safety-belt.  If the identified disk has 0 blocks, don't attach
it.  This can happen in some cases when plugging in SD/SmartCard PC
Cards with empty slots.  It is better to detect this bogosity, and
refuse to attach rather than panic with a division by zero (in one of
many places) down stream.

14 years agoMinor formatting nits.
imp [Sun, 4 Jul 2010 05:58:17 +0000 (05:58 +0000)]
Minor formatting nits.

14 years agosysctlbyname() returns -1 on error and sets errno. It does
marcel [Sat, 3 Jul 2010 22:02:29 +0000 (22:02 +0000)]
sysctlbyname() returns -1 on error and sets errno. It does
not return the error itself.

14 years agoAllocate and setup an interrupt vector for corrected machine checks.
marcel [Sat, 3 Jul 2010 20:19:20 +0000 (20:19 +0000)]
Allocate and setup an interrupt vector for corrected machine checks.
For now, just print when we get the interrupt, but eventually we need
to collect the details and provide a more useful report.

14 years agoAdd a missing conditional. We should not bind the PIC interrupt unless
nwhitehorn [Sat, 3 Jul 2010 20:11:04 +0000 (20:11 +0000)]
Add a missing conditional. We should not bind the PIC interrupt unless
the interrupt's PIC (a) exists and (b) is the root PIC.

Reported by: Andreas Tobler

14 years agoImprove the comment and man page for vm_page_alloc(). Specifically,
alc [Sat, 3 Jul 2010 18:25:37 +0000 (18:25 +0000)]
Improve the comment and man page for vm_page_alloc().  Specifically,
document one of the optional flags; clarify which of the flags are
optional (and which are not), and remove mention of a restriction on
the reclamation of cached pages that no longer holds since version 7.

MFC after: 1 week

14 years agoHook the siftr.4 man page up to the build and alphabetically sort siis into its
lstewart [Sat, 3 Jul 2010 15:05:14 +0000 (15:05 +0000)]
Hook the siftr.4 man page up to the build and alphabetically sort siis into its
correct place whilst there.

Sponsored by: FreeBSD Foundation
Submitted by: pluknet <pluknet at gmail dot com>

14 years agoAdd ata(4) ability to limit initial ATA mode for devices via device hints.
mav [Sat, 3 Jul 2010 14:14:42 +0000 (14:14 +0000)]
Add ata(4) ability to limit initial ATA mode for devices via device hints.
After boot this mode can be changed with atacontrol/camcontrol as usual.
It works for both legacy and ATA_CAM wrapper mode.

PR: kern/123980

14 years agoThis fixes a crash in SCTP. It was possible to have a
rrs [Sat, 3 Jul 2010 14:03:31 +0000 (14:03 +0000)]
This fixes a crash in SCTP. It was possible to have a
large number of packets queued to a crashing process.
In a specific case you may get 2 ABORT's back (from
say two packets in flight). If the aborts happened to
be processed at the same time its possible to have
one free the association while the other is trying
to report all the outbound packets. When this occured
it could lead to a crash.

MFC after: 3 days

14 years agoImport the Statistical Information For TCP Research (SIFTR) kernel module into
lstewart [Sat, 3 Jul 2010 13:32:39 +0000 (13:32 +0000)]
Import the Statistical Information For TCP Research (SIFTR) kernel module into
FreeBSD. SIFTR logs a range of statistics on active TCP connections to a log
file, providing the ability to make highly granular measurements of TCP
connection state. The tool is aimed at system administrators, developers and
researchers alike. Please take it for a spin and test it out - the man page
should have all the information required to get you going.

Many thanks go to the Cisco University Research Program Fund at Community
Foundation Silicon Valley and the FreeBSD Foundation. Their support of our work
at the Centre for Advanced Internet Architectures, Swinburne University of
Technology is greatly appreciated.

Sponsored by: Cisco URP, FreeBSD Foundation
Reviewed by: dwmalone, gnn, rpaulo
Tested by: Many on freebsd-current@ and elsewhere over the years
MFC after: 1 month

14 years agosh: Use $PWD instead of getcwd() for the \w and \W prompt expansions.
jilles [Fri, 2 Jul 2010 22:17:13 +0000 (22:17 +0000)]
sh: Use $PWD instead of getcwd() for the \w and \W prompt expansions.

This ensures that the logical working directory (which may include
symlinks) is shown and is similar to the default behaviour of the pwd
builtin.

14 years agosh: Remove comment that the comma operator is missing in arithmetic
jilles [Fri, 2 Jul 2010 21:31:24 +0000 (21:31 +0000)]
sh: Remove comment that the comma operator is missing in arithmetic
expansion.

The comma operator is not listed in POSIX.1-2008 XCU 1.1.2.1 Arithmetic
Precision and Operations (referenced by XCU 2.6.4 Arithmetic Expansion) and
is therefore not required.

14 years agoPush down the acquisition of the page queues lock into
alc [Fri, 2 Jul 2010 20:56:22 +0000 (20:56 +0000)]
Push down the acquisition of the page queues lock into
vm_pageout_page_stats().  In particular, avoid acquiring the page
queues lock unless iterating over the active queue.

14 years agoUse vm_page_prev() instead of vm_page_lookup() in the implementation of
alc [Fri, 2 Jul 2010 19:59:18 +0000 (19:59 +0000)]
Use vm_page_prev() instead of vm_page_lookup() in the implementation of
vm_fault()'s automatic delete-behind heuristic.
vm_page_prev() is typically faster.

14 years agoRevert r209638. After commit, there appeared to be more people who liked
mav [Fri, 2 Jul 2010 17:22:15 +0000 (17:22 +0000)]
Revert r209638. After commit, there appeared to be more people who liked
previous name of stray interrupt counters, then responded to the list.

14 years agoUse vm_page_next() instead of vm_page_lookup() in exec_map_first_page()
alc [Fri, 2 Jul 2010 15:50:30 +0000 (15:50 +0000)]
Use vm_page_next() instead of vm_page_lookup() in exec_map_first_page()
because vm_page_next() is faster.

14 years agoWith the demise of page coloring, the page queue macros no longer serve any
alc [Fri, 2 Jul 2010 15:02:51 +0000 (15:02 +0000)]
With the demise of page coloring, the page queue macros no longer serve any
useful purpose.  Eliminate them.

Reviewed by: kib

14 years agoAdd support for XLS 108 chips - update board.c/board.h to setup GMAC
jchandra [Fri, 2 Jul 2010 13:30:26 +0000 (13:30 +0000)]
Add support for XLS 108 chips - update board.c/board.h to setup GMAC
driver parameters correctly.

Approved by: rrs (mentor)
Obtained from: Sriram Gorti <srgorti@netlogicmicro.com>

14 years agoRemove save/restore of PageMask in tlb.c functions introduced in r209243.
jchandra [Fri, 2 Jul 2010 12:01:46 +0000 (12:01 +0000)]
Remove save/restore of PageMask in tlb.c functions introduced in r209243.
If we save/restore the PageMask, the value set by the bootloader will
persist, and will cause problems later in TLB exception handler.
This caused a crash in AR71xx boards.

Also fixes the EntryHi mask in pte.h

Reported by: Luiz Otavio O Souza <lists.br@gmail.com>
Tested by:   Luiz Otavio O Souza <lists.br@gmail.com>

Approved by: rrs (mentor)

14 years agoFix a bug that WILL cause a panic. Basically
rrs [Fri, 2 Jul 2010 09:53:26 +0000 (09:53 +0000)]
Fix a bug that WILL cause a panic.  Basically
a read-lock is being called to check the vtag-timewait cache.
Then in two cases (where a vtag is bad i.e. in the time-wait
state) the write-unlock is called NOT the read-unlock. Under
conditions where lots of associations are coming and going
this will cause the system to panic at some point.

MFC after: 3 days

14 years ago<machine/intr.h> removed on powerpc.
marcel [Fri, 2 Jul 2010 02:20:25 +0000 (02:20 +0000)]
<machine/intr.h> removed on powerpc.

14 years agoRemove the unneeded header <machine/intr.h>.
marcel [Fri, 2 Jul 2010 02:17:39 +0000 (02:17 +0000)]
Remove the unneeded header <machine/intr.h>.

14 years agoMake stray irq counters have format alike to other counters. Unified format
mav [Thu, 1 Jul 2010 21:58:46 +0000 (21:58 +0000)]
Make stray irq counters have format alike to other counters. Unified format
makes string processing (for example by `systat -vm`) easier.

14 years agoAdd new source to the loadable em build, thought
jfv [Thu, 1 Jul 2010 21:03:30 +0000 (21:03 +0000)]
Add new source to the loadable em build, thought
it wasnt needed but it is.

14 years ago- Introduce IEEE80211_KEY_NOREPLAY, a per-key flag to ignore replay
bschmidt [Thu, 1 Jul 2010 20:50:12 +0000 (20:50 +0000)]
- Introduce IEEE80211_KEY_NOREPLAY, a per-key flag to ignore replay
  violations.
- Use SIOCGIFMEDIA to determine VAP's opmode, cache it and set
  IEEE80211_KEY_NOREPLAY for AHDEMO and IBSS.

Approved by: rpaulo (mentor)

14 years agoAllow attimer to be hinted at ISA if not reported by ISA PNP or ACPI.
mav [Thu, 1 Jul 2010 18:59:05 +0000 (18:59 +0000)]
Allow attimer to be hinted at ISA if not reported by ISA PNP or ACPI.
Rephrase respective atrtc code same way to be more readable.

14 years agoRework r209456:
mav [Thu, 1 Jul 2010 18:51:18 +0000 (18:51 +0000)]
Rework r209456:
Instead of using fake rid (which ISA doesn't like), delete untrusted
IRQ resource and let it be recreated.

14 years agoThe struct ipfw_rule_ref follows the struct m_tag. Deal with this
glebius [Thu, 1 Jul 2010 17:46:12 +0000 (17:46 +0000)]
The struct ipfw_rule_ref follows the struct m_tag. Deal with this
correctly. This fixes breakage of ng_ipfw(4) in r201527.

Submitted by: Alexander Zagrebin <alexz visp.ru>

14 years agoIf the A flag is supplied, http_request() will attempt the request only
des [Thu, 1 Jul 2010 17:44:33 +0000 (17:44 +0000)]
If the A flag is supplied, http_request() will attempt the request only
once, even if authentication is required, instead of retrying with the
proper credentials.  Fix this by bumping the countdown if the origin or
proxy server requests authentication so that the initial unauthenticated
request does not count as an attempt.

PR: 148087
Submitted by: Tom Evans <tevans.uk@googlemail.com>
MFC after: 2 weeks

14 years agoCorrect explanation for idle and standby subcommands' -t argument.
mav [Thu, 1 Jul 2010 14:10:55 +0000 (14:10 +0000)]
Correct explanation for idle and standby subcommands' -t argument.

14 years agoo Add taras@.
maxim [Thu, 1 Jul 2010 10:26:23 +0000 (10:26 +0000)]
o Add taras@.

Submitted by: taras

14 years agoFix build
kevlo [Thu, 1 Jul 2010 05:03:24 +0000 (05:03 +0000)]
Fix build

14 years agoMFia64:
marcel [Thu, 1 Jul 2010 03:48:45 +0000 (03:48 +0000)]
MFia64:
When compiling with profiling, we define PROF for userspace and GPROF
for the kernel.

14 years agoSimplify the calculation of s_scale by rewriting the FP expression to
marcel [Thu, 1 Jul 2010 00:48:00 +0000 (00:48 +0000)]
Simplify the calculation of s_scale by rewriting the FP expression to
use uintmax_t instead of float and thereby eliminating the need for
a non-FP version.

Tested on: amd64, ia64 & powerpc (book-E)
Suggested by: bde
MFC after: 1 month

14 years agoAdds `Dell Truemobile 1300' to the supported list.
weongyo [Thu, 1 Jul 2010 00:33:50 +0000 (00:33 +0000)]
Adds `Dell Truemobile 1300' to the supported list.

Submitted by: Warren Block <wblock at wonkity.com>

14 years agoWhen compiling with profiling, we define PROF for userspace and GPROF
marcel [Thu, 1 Jul 2010 00:30:35 +0000 (00:30 +0000)]
When compiling with profiling, we define PROF for userspace and GPROF
for the kernel.

14 years agoWhile functions are ideally aligned to a 32-byte boundary, don't
marcel [Wed, 30 Jun 2010 22:29:02 +0000 (22:29 +0000)]
While functions are ideally aligned to a 32-byte boundary, don't
assume this to be the case.

14 years agoOK, I was a bit sleep this morning and checked in
jfv [Wed, 30 Jun 2010 21:05:51 +0000 (21:05 +0000)]
OK, I was a bit sleep this morning and checked in
the core changes but left out the shared code, lol.
Well, and a couple fixes to the core... hopefully
this will all be complete now.

Happy happy joy joy :)

14 years ago- Don't assign the return value from read(2) to a variable of type
jh [Wed, 30 Jun 2010 18:34:45 +0000 (18:34 +0000)]
- Don't assign the return value from read(2) to a variable of type
  int.
- Use errx(3) instead of err(3) to print the error message on short
  reads in readlabel(). errno won't be set on short reads which can
  easily occur here due to the fixed size read request.

PR: 144307
Reviewed by: bde

14 years agoMove prototypes for kern_sigtimedwait() and kern_sigprocmask() to
jhb [Wed, 30 Jun 2010 18:03:42 +0000 (18:03 +0000)]
Move prototypes for kern_sigtimedwait() and kern_sigprocmask() to
<sys/syscallsubr.h> where all other kern_<syscall> prototypes live.

14 years agoUpdate comment for tdsignal() -> tdsendsignal() rename. Forgot to include
jhb [Wed, 30 Jun 2010 18:00:45 +0000 (18:00 +0000)]
Update comment for tdsignal() -> tdsendsignal() rename.  Forgot to include
this in 209592.

14 years agoSR-IOV support added to igb
jfv [Wed, 30 Jun 2010 17:26:47 +0000 (17:26 +0000)]
SR-IOV support added to igb

What this provides is support for the 'virtual function'
interface that a FreeBSD VM may be assigned from a host
like KVM on Linux, or newer versions of Xen with such
support.

When the guest is set up with the capability, a special
limited function 82576 PCI device is present in its virtual
PCI space, so with this driver installed in the guest that
device will be detected and function nearly like the bare
metal, as it were.

The interface is only allowed a single queue in this configuration
however initial performance tests have looked very good.

Enjoy!!

14 years agoSimplify entry to vm_pageout_clean(). Expect the page to be locked.
alc [Wed, 30 Jun 2010 17:20:33 +0000 (17:20 +0000)]
Simplify entry to vm_pageout_clean().  Expect the page to be locked.
Previously, the caller unlocked the page, and vm_pageout_clean()
immediately reacquired the page lock.  Also, assert rather than test
that the page is neither busy nor held.  Since vm_pageout_clean() is
called with the object and page locked, the page can't have changed
state since the caller verified that the page is neither busy nor
held.

14 years agoLeft out header change in last delta - new member
jfv [Wed, 30 Jun 2010 16:28:28 +0000 (16:28 +0000)]
Left out header change in last delta - new member
in adapter so that advertise changes can be done
to one port without the other changing.

14 years agoFix build.
glebius [Wed, 30 Jun 2010 11:17:55 +0000 (11:17 +0000)]
Fix build.

14 years agoImprove bufdone_finish()'s handling of the bogus page. Specifically, if
alc [Wed, 30 Jun 2010 04:52:42 +0000 (04:52 +0000)]
Improve bufdone_finish()'s handling of the bogus page.  Specifically, if
one or more mappings to the bogus page must be replaced, call pmap_qenter()
just once.  Previously, pmap_qenter() was called for each mapping to the
bogus page.

MFC after: 3 weeks

14 years agoOn powerpc, calculate s_scale using the non-FP version previously
marcel [Wed, 30 Jun 2010 01:40:25 +0000 (01:40 +0000)]
On powerpc, calculate s_scale using the non-FP version previously
specific to hp300. Since FreeBSD does not support hp300, hp300 has
been removed from the condition altogether.

The FP version broke profiling on powerpc due to invalid results.
Casting to double instead of float resolved the issue, but with
Book-E not having a FP unit, the non-FP version looked preferrable.
Note that even on AIM hardware the FP version yielded an invalid
value for s_scale, so the problem is most likely with the compiler
or with the expression itself.

14 years agoBAH, I apologize, the wrong version of the code got
jfv [Wed, 30 Jun 2010 01:10:08 +0000 (01:10 +0000)]
BAH, I apologize, the wrong version of the code got
fat fingered in place, this is the correct version
that actually works... <sheepish grin>

MFC: in a week

14 years agoAdd a new sysctl option, this will allow one to
jfv [Wed, 30 Jun 2010 01:01:06 +0000 (01:01 +0000)]
Add a new sysctl option, this will allow one to
limit the advertised speed of an SFP+ to 1G, effectively
"forcing" link at that lower speed. It is off by default
and is enabled by sysctl dev.ix.0.force_gig=1, 0 will
set it back to the norm.

14 years agosh: Forget about terminated background processes sooner.
jilles [Tue, 29 Jun 2010 22:37:45 +0000 (22:37 +0000)]
sh: Forget about terminated background processes sooner.

Unless $! has been referenced for a particular job or $! still contains that
job's pid, forget about it after it has terminated. If $! has been
referenced, remember the job until the wait builtin has reported its
completion (either with the pid as parameter or without parameters).

In interactive mode, jobs are forgotten after termination has been reported,
which happens before primary prompts and through the jobs builtin. Even
then, though, remember a job if $! has been referenced.

This is similar to what is suggested by POSIX and should fix most memory
leaks (which also tend to cause sh to use more CPU time) with long running
scripts that start background jobs.

Caveats:
* Repeatedly referencing $! without ever doing 'wait', like
    while :; do foo & echo started foo: $!; sleep 60; done
  will still use a lot of memory and CPU time in the long run.
* The jobs and jobid builtins do not cause a job to be remembered for longer
  like expanding $! does.

PR: bin/55346

14 years agoChange the mpt driver to allow larger I/O sizes.
ken [Tue, 29 Jun 2010 22:07:53 +0000 (22:07 +0000)]
Change the mpt driver to allow larger I/O sizes.

The mpt driver previously didn't report a 'maxio' size to CAM, and so the
da(4) driver limited I/O sizes to DFLTPHYS (64K) by default.  The number
of scatter gather segments allowed, as reported to busdma, was
(128K / PAGE_SIZE) + 1, or 33 on architectures with 4K pages.

Change things around so that we wait until we've determined how many
segments the adapter can support before creating the busdma tag used for
buffers, so we can potentially support more S/G segments and therefore
larger I/O sizes.

Also, fix some things that were broken about the module unload path.  It
still gets hung up inside CAM, though.

mpt.c: Move some busdma initialization calls in here, and call
them just after we've gotten the IOCFacts, and know how
many S/G segments this adapter can support.

mpt.h: Get rid of MPT_MAXPHYS, it is no longer used.

Add max_cam_seg_cnt, which is used to report our maximum
I/O size up to CAM.

mpt_cam.c: Use max_cam_seg_cnt to report our maximum I/O size to CAM.

Fix the locking in mpt_cam_detach().

mpt_pci.c: Pull some busdma initialization and teardown out and put
it in mpt.c.  We now delay it until we know many scatter
gather segments the adapter can support, and therefore
how to setup our busdma tags.

mpt_raid.c: Make sure we wake up the right wait channel to get the
raid thread to wake up when we're trying to shut it down.

Reviewed by: gibbs, mjacob
MFC after: 2 weeks

14 years agoInitializes the ratectl for a node when the state is changed to RUN.
weongyo [Tue, 29 Jun 2010 21:56:42 +0000 (21:56 +0000)]
Initializes the ratectl for a node when the state is changed to RUN.
This prevents a kernel fault by dividing with zero because the initial
rate was 0 and didn't be initialized.

Tested by: Warren Block <wblock at wonkity.com>
MFC after: 3 days

14 years agoFixes NULL pointer reference that it's occurred when the state is
weongyo [Tue, 29 Jun 2010 21:52:40 +0000 (21:52 +0000)]
Fixes NULL pointer reference that it's occurred when the state is
changed to RUN because ic->ic_newassoc isn't set anywhere now.  In the
previous bwi_newassoc() is used to initialize AMRR rate routines.

Tested by: Warren Block <wblock at wonkity.com>
MFC after: 3 days

14 years agoSort function prototypes (since I didn't manage to insert tdksignal()
jhb [Tue, 29 Jun 2010 20:55:12 +0000 (20:55 +0000)]
Sort function prototypes (since I didn't manage to insert tdksignal()
correctly).

14 years agoSend SIGPIPE to the thread that issued the offending system call
jhb [Tue, 29 Jun 2010 20:44:19 +0000 (20:44 +0000)]
Send SIGPIPE to the thread that issued the offending system call
rather than to the entire process.

Reported by: Anit Chakraborty
Reviewed by: kib, deischen (concept)
MFC after: 1 week

14 years agoTweak the in-kernel API for sending signals to threads:
jhb [Tue, 29 Jun 2010 20:41:52 +0000 (20:41 +0000)]
Tweak the in-kernel API for sending signals to threads:
- Rename tdsignal() to tdsendsignal() and make it private to kern_sig.c.
- Add tdsignal() and tdksignal() routines that mirror psignal() and
  pksignal() except that they accept a thread as an argument instead of
  a process.  They send a signal to a specific thread rather than to an
  individual process.

Reviewed by: kib

14 years agoFix profiling (part 1):
marcel [Tue, 29 Jun 2010 19:07:44 +0000 (19:07 +0000)]
Fix profiling (part 1):
o   Functions are 4-byte aligned for Book-E.
o   We get compiled with -DPROF and not -DGPROF if profiling
    is enabled.

14 years agoDon't lock buses around a call to xptperiphlistmatch- the buses will be
mjacob [Tue, 29 Jun 2010 17:10:55 +0000 (17:10 +0000)]
Don't lock buses around a call to xptperiphlistmatch- the buses will be
locked at appropriate places.

MFC after: 1 week
X-MFC: 208752

14 years agoAfter processing the O_SKIPTO opcode our cmd points to the next rule, and
glebius [Tue, 29 Jun 2010 16:57:30 +0000 (16:57 +0000)]
After processing the O_SKIPTO opcode our cmd points to the next rule, and
"match" processing at the end of inner loop would look ahead into the next
rule, which is incorrect. Particularly, in the case when the next rule
started with F_NOT opcode it was skipped blindly.

To fix this, exit the inner loop with the continue operator forcibly and
explicitly.

PR: kern/147798

14 years ago- The ETIMEDOUT error applies to pthread_timedjoin_np(), not pthread_join().
jhb [Tue, 29 Jun 2010 14:32:01 +0000 (14:32 +0000)]
- The ETIMEDOUT error applies to pthread_timedjoin_np(), not pthread_join().
- Tweak wording in history section for pthread_timedjoin_np().

MFC after: 3 days

14 years agoRevert r209578:
kib [Tue, 29 Jun 2010 14:31:49 +0000 (14:31 +0000)]
Revert r209578:
  Use C99 initializers for the struct sysent generated by MAKE_SYSENT().
C++ does not have designator-initializer facility of C99, not using this
in the header makes us friendly to C++ kernel modules, whoever wants
such schism.

Requested by: mdf
MFC after: 6 days (not really)

14 years agoExpand system into my_system, and add the necessary tidyness that we
imp [Tue, 29 Jun 2010 03:52:12 +0000 (03:52 +0000)]
Expand system into my_system, and add the necessary tidyness that we
need.  Close the pidfile.  Then close all descriptors >= 3 to avoid
information leakage to children.

This solves the problem of not being able to restart devd when you
have, for example, a dhclient forked to configure your network...

MFC after: 3 days

14 years agoIf i is going to be used in the loop unconditionally the declaration
dougb [Tue, 29 Jun 2010 01:04:24 +0000 (01:04 +0000)]
If i is going to be used in the loop unconditionally the declaration
has to be unconditional as well.

Conical head covering to: kib

14 years agoRegenerate
kib [Mon, 28 Jun 2010 18:17:21 +0000 (18:17 +0000)]
Regenerate

14 years agoDespite system call deregistration drains the threads executing System V
kib [Mon, 28 Jun 2010 18:12:42 +0000 (18:12 +0000)]
Despite system call deregistration drains the threads executing System V
shm syscalls, and initial check for the number of allocated segments
in the module deinitialization code, the following might happen:
   after the check for active segment, while waiting for threads to
   leave some other syscall, shmget(2) is called. Then, we can end
   up with the shared segment that cannot be detached since sysvshm
   module is unloaded.

Prevent the leak by rechecking and disclaiming a reference to the vm
object owned by sysvshm module, that might have grown during the drain.

Tested by: pho
Reviewed by: jhb
MFC after: 1 month

14 years agoCount number of threads that enter and leave dynamically registered
kib [Mon, 28 Jun 2010 18:06:46 +0000 (18:06 +0000)]
Count number of threads that enter and leave dynamically registered
syscalls. On the dynamic syscall deregistration, wait until all
threads leave the syscall code. This somewhat increases the safety
of the loadable modules unloading.

Reviewed by: jhb
Tested by: pho
MFC after: 1 month

14 years agoUse C99 initializers for the struct sysent generated by MAKE_SYSENT().
kib [Mon, 28 Jun 2010 17:59:45 +0000 (17:59 +0000)]
Use C99 initializers for the struct sysent generated by MAKE_SYSENT().

MFC after: 1 week

14 years agoFix a lock leak in the deadlock resolver in case the ticks counter
attilio [Mon, 28 Jun 2010 17:45:00 +0000 (17:45 +0000)]
Fix a lock leak in the deadlock resolver in case the ticks counter
wrapped up.

Sponsored by: Sandvine Incorporated
Submitted by: pluknet <pluknet at gmail dot com>
Reported by: Anton Yuzhaninov <citrin at citrin dot ru>
Reviewed by: jhb
MFC after: 3 days

14 years agoVarious changes to make locate compilable with WARNS=6. Note that there
gavin [Mon, 28 Jun 2010 12:04:55 +0000 (12:04 +0000)]
Various changes to make locate compilable with WARNS=6.  Note that there
is still one issue on FreeBSD/arm (signed vs unsigned char) which prevents
actually bumping this to WARNS=6 - I'm still considering the correct
solution to this issue.

Tested by: make universe

14 years agoMake WARNS=6 safe, mainly by casting to intmax_t and printing with %ju
gavin [Mon, 28 Jun 2010 12:00:20 +0000 (12:00 +0000)]
Make WARNS=6 safe, mainly by casting to intmax_t and printing with %ju
where needed.  Also, fix bad indentation on lines already affected by the
above changes.

Tested with: make universe

14 years agoMake WARNS=6 safe.
gavin [Mon, 28 Jun 2010 08:30:10 +0000 (08:30 +0000)]
Make WARNS=6 safe.

Tested by: make universe

14 years agoUse spaces, not tabs.
pjd [Mon, 28 Jun 2010 08:05:30 +0000 (08:05 +0000)]
Use spaces, not tabs.

14 years agoRevert r209544. It papers over a binutils bug, and is not even a reliable
nwhitehorn [Mon, 28 Jun 2010 01:40:56 +0000 (01:40 +0000)]
Revert r209544. It papers over a binutils bug, and is not even a reliable
fix for it.

The bug occurs when using the --as-needed flag to ld in the presence of
synthetic linker-generated symbols that reference symbols defined in
linked-to shared libraries with versioned symbols. When the only symbols
used from a library fall into this category, ld will drop the DT_NEEDED
entry for it, but retain the versioning information. This bug is best
fixed/hacked around in binutils, not in rtld.

Discussed with: kan

14 years agoMake the second example command more closely match the demo output, and as
gavin [Sun, 27 Jun 2010 23:11:35 +0000 (23:11 +0000)]
Make the second example command more closely match the demo output, and as
a side effect more clearly show the change in command lines between the
first and second example invocations.

14 years agoProperly inherit variables from src/usr.sbin/Makefile.inc for
imp [Sun, 27 Jun 2010 17:14:04 +0000 (17:14 +0000)]
Properly inherit variables from src/usr.sbin/Makefile.inc for
subdirectories of pc-sysinstall.  Back out explicit setting in
pc-sysinstall/pc-sysinstall/Makefile.

14 years agoUpdate pc-sysinstall to output list of FTP mirrors as well as some
imp [Sun, 27 Jun 2010 17:04:03 +0000 (17:04 +0000)]
Update pc-sysinstall to output list of FTP mirrors as well as some
installation information.  Export architecture to install.

PR: 148184
Submitted by: John Hixson

14 years agoSpell iXsystems, Inc properly
imp [Sun, 27 Jun 2010 16:46:11 +0000 (16:46 +0000)]
Spell iXsystems, Inc properly

Submitted by: delphij@

14 years agoFix transfer statistics in the "send file" case - The conditional used
gavin [Sun, 27 Jun 2010 14:21:08 +0000 (14:21 +0000)]
Fix transfer statistics in the "send file" case - The conditional used
to print the stats were using an uninitialised variable. [1]

Fix trasnfer statistics in the "receive file" case - the statistics struct
was being cleared both before and after the initial connect to the remote
server.  As a result, the printed time and calculated bandwidth covers
the time to connect ad well as the time to transfer the file.  This may
not be ideal, but now at least matches the "send file" case.

Found by: clang static analyser [1]
Reviewed by: imp

14 years agoFix core dump when server fails to respond.
gavin [Sun, 27 Jun 2010 14:11:03 +0000 (14:11 +0000)]
Fix core dump when server fails to respond.

Reviewed by: imp

14 years agoCorrect a comment typo.
jh [Sun, 27 Jun 2010 12:19:09 +0000 (12:19 +0000)]
Correct a comment typo.

14 years agoFix typo introduced in previous revision.
rpaulo [Sun, 27 Jun 2010 10:17:11 +0000 (10:17 +0000)]
Fix typo introduced in previous revision.

14 years agoNote that internal_underscores should be used in identifier names rather
cperciva [Sun, 27 Jun 2010 02:30:19 +0000 (02:30 +0000)]
Note that internal_underscores should be used in identifier names rather
than camelCase or TitleCase.

According to grep and my checked-out source tree, we're currently at
3733379 internal_underscores, 93024 camelCases, and 80831 TitleCases;
so this commit is merely documenting existing practice.

14 years agoIgnore versioned dependencies on shared objects to which we do not link.
nwhitehorn [Sat, 26 Jun 2010 22:04:52 +0000 (22:04 +0000)]
Ignore versioned dependencies on shared objects to which we do not link.
This fixes an error with files like this created by GNU ld under certain
circumstances.

14 years agoCorrect arguments order.
pjd [Sat, 26 Jun 2010 21:44:45 +0000 (21:44 +0000)]
Correct arguments order.

14 years agoJust like in case of setgroups(2), for getgroups(2) also advice including
pjd [Sat, 26 Jun 2010 21:44:05 +0000 (21:44 +0000)]
Just like in case of setgroups(2), for getgroups(2) also advice including
sys/param.h instead of sys/types.h so we get NGROUPS_MAX and NGROUPS
definitions.

14 years agoFix the AR_SREV_MERLIN_20_OR_LATER() check.
rpaulo [Sat, 26 Jun 2010 20:59:10 +0000 (20:59 +0000)]
Fix the AR_SREV_MERLIN_20_OR_LATER() check.

Submitted by: Alex Kozlov <spam at rm-rf.kiev.ua>
MFC after: 2 weeks