Commit Graph

158731 Commits

Author SHA1 Message Date
David Xu
a24bcc04b2 Set default type to PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, this
is the type we are using.
2010-10-18 23:37:56 +00:00
Frederic Culot
62778483f7 Replace spaces by a tab after the date.
Reported by:	gavin@, brucec@
Approved by:	sahil@ (mentor)
2010-10-18 19:14:59 +00:00
Konstantin Belousov
223073fd1a Do not synchronously start the nfsiod threads at all. The r212506
fixed the issues with file descriptor locks, but the same problems are
present for vnode lock/user map lock.

If the nfs_asyncio() cannot find the free nfsiod, schedule task to
create new nfsiod and return error. This causes fall back to the
synchronous i/o for nfs_strategy(), or does not start read at all in
the case of readahead. The caller that holds vnode and potentially
user map lock does not wait for kproc_create() to finish, preventing
the LORs.

The change effectively reverts r203072, because we never hand off the
request to newly created nfsiod thread anymore.

Reviewed by:	jhb
Tested by:	jhb, pluknet
MFC after:	3 weeks
2010-10-18 19:06:46 +00:00
Ed Maste
c4965cfc44 We've already set p = td->td_proc, so use it. 2010-10-18 15:46:58 +00:00
Rebecca Cran
dadef94c7a Remove extra word, which looks like a left-over from a deleted sentence. 2010-10-18 14:35:21 +00:00
Rebecca Cran
8834bc521e Fix grammar. 2010-10-18 14:26:29 +00:00
Sergey Kandaurov
c60aecbc90 Fix typo: Offlaod -> Offload.
PR:		docs/150756
Approved by:	avg (mentor)
MFC after:	3 days
2010-10-18 14:13:19 +00:00
Pawel Jakub Dawidek
ad4f4b2be8 Update links for taskqueue(9) functions. 2010-10-18 12:35:48 +00:00
Pawel Jakub Dawidek
9a95b55311 Add links for libradius(3) functions. 2010-10-18 12:35:10 +00:00
Alexander Motin
bda55b6adb Set of legacy mode SATA enchancements:
- Implement proper combined mode decoding for Intel controllers to properly
identify SATA and PATA channels and associate ATA channels with SATA ports.
This fixes wrong reporting and in some cases hard resets to wrong SATA ports.
- Improve SATA registers support to handle hot-plug events and potentially
interface errors. For ICH5/6300ESB chipsets these registers accessible via
PCI config space. For later ones they may be accessible via PCI BAR(5).
- For controllers not generating interrupts on hot-plug events, implement
periodic status polling. Use it to detect hot-plug on Intel and VIA
controllers. Same probably could also be used for Serverworks and SIS.
2010-10-18 11:30:13 +00:00
David Xu
7672cbaaf9 Unbreak buildworld by including pthread_rwlockattr_setkind_np and
pthread_rwlockattr_getkind_np.
2010-10-18 09:44:21 +00:00
Marius Strobl
c1ff8fd19a Revert r213867; while this driver really doesn't use any of the generic
subroutines, at least mii_capabilities is used within itself.
2010-10-18 08:36:03 +00:00
Gleb Smirnoff
bc92b07848 Log if fopen() fails.
Reviewed by:	brian
2010-10-18 07:28:53 +00:00
Edwin Groothuis
2d2d15a964 "b64decode -r" did not handle arbitary breaks in base64 encoded
data. White space should be accepted anywhere in a base64 encoded
stream, not just after every chunk (4 characters).

Test-scenario:

VmVsb2NpdHkgUmV3YXJkcw==

and

VmVsb2NpdHkgUmV3YXJkcw
==

should both produce "Velocity Rewards"

PR:		bin/124739
Submitted by:	Mark Andrews <marka@isc.org>
MFC after:	2 weeks
2010-10-18 05:44:11 +00:00
David Xu
bc15e58058 sort function name. 2010-10-18 05:16:44 +00:00
David Xu
7047ff7588 s/||/&& 2010-10-18 05:15:26 +00:00
David Xu
a6b9b59e04 Add pthread_rwlockattr_setkind_np and pthread_rwlockattr_getkind_np, the
functions set or get pthread_rwlock type, current supported types are:
   PTHREAD_RWLOCK_PREFER_READER_NP,
   PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
   PTHREAD_RWLOCK_PREFER_WRITER_NP,
default is PTHREAD_RWLOCK_PREFER_WRITER_NONCECURSIVE_NP, this maintains
binary compatible with old code.
2010-10-18 05:09:22 +00:00
Marcel Moolenaar
e25daafbb6 Re-implement the root mount logic using a recursive approach, whereby each
root file system (starting with devfs and a synthesized configuration) can
contain directives for mounting another file system as root. The old root
file system is re-mounted under the new root file system (with /.mount or
/mnt as the mount point) to allow access to the underlying file system.

The configuration allows for creating vnode-backed memory disks that can
subsequently be mounted as root. This allows for an efficient and low-
cost way to distribute and boot FreeBSD software images that reside on
some storage media.

When trying a mount, the kernel will wait for the device in question to
arrive. The timeout is configurable and is part of the configuration.
This allows arbitrarily complex GEOM configurations to be constructed
on the fly.

A side-effect of this change is that all root specifications, whether
compiled into the kernel or typed at the prompt can contain root mount
options.
2010-10-18 05:01:53 +00:00
Marcel Moolenaar
c1f0aabb9f In vfs_filteropt(), only print the errmsg when there's no errmsg
mount option. Otherwise errors tend to get printed multiple times.
2010-10-18 04:34:42 +00:00
Marcel Moolenaar
76e18b25a0 Rename boot() to kern_reboot() and make it visible outside of
kern_shutdown.c. This makes it easier for emulators and other
parts of the kernel to initiate a reboot.
2010-10-18 04:30:27 +00:00
Marcel Moolenaar
3d5c947d9d Allow the MDIOCATTACH ioctl operation to originate from within the kernel.
To protect against malicious software, we demand that the file name is at
a particular location (i.e. appended to the mdio structure) for it to be
treated as in-kernel.
2010-10-18 04:26:32 +00:00
Edwin Groothuis
4b26f3413e Stylify of uudecode(1)
Part of PR bin/124739.

PR:		bin/124739
Submitted by:	Mark Andrews <marka@isc.org>
2010-10-18 03:59:55 +00:00
Kevin Lo
4bc8fad7bd Fix a possible race where the directory dirent is moved to the location
that was used by ".." entry.
This change seems fixed panic during attempt to access msdosfs data
over nfs.

Reviewed by:	kib
MFC after:	1 week
2010-10-18 03:34:33 +00:00
Scott Long
34c9624e2d Re-add opt_mps.h and opt_cam.h, lost in the previous rev. 2010-10-17 20:01:56 +00:00
Frederic Culot
d688106259 Add myself to calendar.freebsd.
Approved by:	sahil@ (mentor)
2010-10-17 19:02:42 +00:00
Frederic Culot
1df8e4fb54 Add an entry for myself to committers-ports.dot.
Approved by:	sahil@ (mentor)
2010-10-17 18:48:51 +00:00
Nathan Whitehorn
c8593f7c4d Fix an XXX comment by answering 'no'. OS X does not set the day-of-week
counter on SMU-based systems, which causes FreeBSD to reject the RTC time
when used in a dual-boot environment. Since we don't use the day-of-week
counter anyway, solve this by just not checking that it matches.

MFC after:	3 weeks
2010-10-17 17:31:49 +00:00
Marius Strobl
17f3c8f1e3 - In oneshot-mode it doesn't make sense to try to compensate the clock
drift in order to achieve a more stable clock as the tick intervals may
  vary in the first place. In fact I haven't seen this code kick in when
  in oneshot-mode so just skip it in that case.
- There's no need to explicitly stop the (S)TICK counter in oneshot-mode
  with every tick as it just won't trigger again with the (S)TICK compare
  register set to a value in the past (with a wrap-around once every ~195
  years of uptime at 1.5 GHz this isn't something we have to worry about
  in practice).
- Given that we'll disable interrupts completely anyway there's no
  need to enter critical sections.
2010-10-17 16:46:54 +00:00
Konstantin Belousov
251e7dbf42 Document vunref(9), add some important notes for vrele(9) and vput(9).
Merge all three manpages to one, removing separate file for vput(9).

MFC after:	1 week
2010-10-17 16:30:33 +00:00
Pawel Jakub Dawidek
3f562cce40 Log correct connection when canceling half-open connection.
Submitted by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	3 days
2010-10-17 15:47:27 +00:00
David Xu
21ecd1e977 - Insert thread0 into correct thread hash link list.
- In thr_exit() and kthread_exit(), only remove thread from
  hash if it can directly exit, otherwise let exit1() do it.
- In thread_suspend_check(), fix cleanup code when thread needs
  to exit.
This change seems fixed the "Bad link elm " panic found by
Peter Holm.

Stress testing: pho
2010-10-17 11:01:52 +00:00
Pawel Jakub Dawidek
bb317aa6ea Use one fprintf() instead of two.
MFC after:	3 days
2010-10-16 22:50:12 +00:00
Pawel Jakub Dawidek
c0a124e6ce Clear signal mask before executing a hook.
Submitted by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	3 days
2010-10-16 22:48:48 +00:00
Andriy Gapon
23a1bcf8c6 zfs: add vop_getpages method implementation
This should make vnode_pager_getpages path a bit shorter and clearer.
Also this should eliminate problems with partially valid pages.
Having this method opens room for future optimizations.

To do: try to satisfy other pages besides the required one taking into
account tradeofs between number of page faults, read throughput and read
latency.  Also, eventually vop_putpages should be added too.

Reviewed by:	kib, mm, pjd
MFC after:	3 weeks
2010-10-16 20:43:05 +00:00
Bjoern A. Zeeb
12112cf676 MfP4 CH182763 (original version):
Make it harder to exploit certain in_control() related races between the
intiial lookup at the beginning and the time we will remove the entry
from the lists by re-checking that entry is still in the list before
trying to remove it.

(*) It is believed that with the current code and locking strategy we
    cannot completely fix all race.

Reported by:	Nima Misaghian (nima_misa hotmail.com) on net@ 20100817
Tested by:	Nima Misaghian (nima_misa hotmail.com) (original version)
PR:		kern/146250
Submitted by:	Mikolaj Golub (to.my.trociny gmail.com) (different version)
MFC after:	1 week
2010-10-16 19:53:22 +00:00
Alexander Motin
0aa99d33b5 Allow umass to use bigger transactions for USB 3.0 devices. It is less
important for USB 2.0 devices and some of them reported to have problems
with large transactions. But USB 3.0 benchmarks show that limited number
of transactions per second on USB makes impossible to reach high transfer
speeds without using bigger transactions.

On my tests this change allows to read up to 220MB/s from USB-attached SSD
(at block size of 256-512KB), comparing to only 113MB/s without it.

Reviewed by:	hselasky
2010-10-16 19:29:37 +00:00
Bjoern A. Zeeb
ee7c7fee94 Close a race acquiring the IF_ADDR_LOCK() for each entry while iterating
over all interfaces to make sure the address will neither change nor be
freed while we are working on it.

PR:		kern/146250
Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)
MFC after:	1 week
2010-10-16 19:25:27 +00:00
Bjoern A. Zeeb
fc2bfb3294 lltable_drain() has never been used so far, thus #if 0 it for now.
While touching it add the missing locking to the now disabled code
for the time when we'll resurrect it.

MFC after:	3 days
2010-10-16 18:42:09 +00:00
Benedict Reuschling
54ac64ab0d Fix a grammatical error connected to the previous commit.
Spotted by:	gjb@
2010-10-16 17:30:27 +00:00
Benedict Reuschling
c4fadc2b78 Correct some typos in comments, no functional changes. 2010-10-16 15:24:04 +00:00
Jilles Tjoelker
f1ec058177 sh(1): Clarify subshells/processes for pipelines.
For multi-command pipelines,
1. all commands are direct children of the shell (unlike the original
   Bourne shell)
2. all commands are executed in a subshell (unlike the real Korn shell)

MFC after:	1 week
2010-10-16 14:37:56 +00:00
Jilles Tjoelker
9fa5f4a093 sh: Use <stddef.h> rather than <sys/stddef.h>.
<sys/stddef.h> is only for the kernel and conflicts with <stddef.h>.
2010-10-16 12:40:00 +00:00
Hans Petter Selasky
951acbc0ff - Add support for libusbhid in 32-bit compatibility mode.
- Add missing check for ugd_actlen being too small.
- Add missing inclusion guard to usbvar.h header file.
- This also fixes buildworld breakage since r213852.
2010-10-16 11:20:53 +00:00
Andriy Gapon
2b89f1fc9e atrtc: remove (pre-)historic check of RTC NVRAM at address 0x0e
Old scrolls tell that once upon a time IBM AT BIOS was known to put some
useful system diagnostic information into RTC NVRAM.  It is not really
known if and for how long PC BIOSes followed that convention, but I
believe that many, if not all, modern BIOSes do not do that any more
(not mentioning other types of x86 firmware).
Some diagnostic bits don't even make any sense any longer.
The check results in confusing messages upon boot on some systems.
So I am removing it.

Discussed with:	bde, jhb, mav
MFC after:	3 weeks
2010-10-16 10:45:36 +00:00
Konstantin Belousov
4518d9ae4c Document vfs.ncsizefactor and vfs.ncnegfactor.
MFC after:	2 weeks
2010-10-16 09:46:03 +00:00
Konstantin Belousov
420cfbb460 Provide vfs.ncsizefactor instead of hard-coding namecache ratio.
Move debug.ncnegfactor to vfs.ncnegfactor [1].
Provide some descriptions for the namecache related sysctls [1].

Based on the submission by:	Rogier R. Mulhuijzen <drwilco drwilco net> [1]
MFC after:	2 weeks
X-MFC-note:	remove debug.ncnegfactor in HEAD after MFC
2010-10-16 09:44:31 +00:00
Lawrence Stewart
ca09d7728b Retire the system-wide, per-reassembly queue segment limit. The mechanism is far
too coarse grained to be useful and the default value significantly degrades TCP
performance on moderate to high bandwidth-delay product paths with non-zero loss
(e.g. 5+Mbps connections across the public Internet often suffer).

Replace the outgoing mechanism with an individual per-queue limit based on the
number of MSS segments that fit into the socket's receive buffer. This should
strike a good balance between performance and the potential for resource
exhaustion when FreeBSD is acting as a TCP receiver. With socket buffer
autotuning (which is enabled by default), the reassembly queue tracks the
socket buffer and benefits too.

As the XXX comment suggests, my testing uncovered some unexpected behaviour
which requires further investigation. By using so->so_rcv.sb_hiwat
instead of sbspace(&so->so_rcv), we allow more segments to be held across both
the socket receive buffer and reassembly queue than we probably should. The
tradeoff is better performance in at least one common scenario, versus a devious
sender's ability to consume more resources on a FreeBSD receiver.

Sponsored by:	FreeBSD Foundation
Reviewed by:	andre, gnn, rpaulo
MFC after:	2 weeks
2010-10-16 07:12:39 +00:00
Lawrence Stewart
c8dc0ab886 - Switch the "net.inet.tcp.reass.cursegments" and
"net.inet.tcp.reass.maxsegments" sysctl variables to be based on UMA zone
  stats. The value returned by the cursegments sysctl is approximate owing to
  the way in which uma_zone_get_cur is implemented.

- Discontinue use of V_tcp_reass_qsize as a global reassembly segment count
  variable in the reassembly implementation. The variable was used without
  proper synchronisation and was duplicating accounting done by UMA already. The
  lack of synchronisation was particularly problematic on SMP systems
  terminating many TCP sessions, resulting in poor TCP performance for
  connections with non-zero packet loss.

Sponsored by:	FreeBSD Foundation
Reviewed by:	andre, gnn, rpaulo (as part of a larger patch)
MFC after:	2 weeks
2010-10-16 05:37:45 +00:00
Lawrence Stewart
1c6cae9711 Change uma_zone_set_max to return the effective value of "nitems" after
rounding. The same value can also be obtained with uma_zone_get_max, but this
change avoids a caller having to make two back-to-back calls.

Sponsored by:	FreeBSD Foundation
Reviewed by:	gnn, jhb
2010-10-16 04:41:45 +00:00
Lawrence Stewart
c4ae7908a7 - Simplify implementation of uma_zone_get_max.
- Add uma_zone_get_cur which returns the current approximate occupancy of
  a zone. This is useful for providing stats via sysctl amongst other things.

Sponsored by:	FreeBSD Foundation
Reviewed by:	gnn, jhb
MFC after:	2 weeks
2010-10-16 04:14:45 +00:00