Commit Graph

1967 Commits

Author SHA1 Message Date
Matthew D Fleming
242ed5d96c Fix taskqueue_drain(9) to not have false negatives. For threaded
taskqueues, more than one task can be running simultaneously.

Also make taskqueue_run(9) static to the file, since there are no
consumers in the base kernel and the function signature needs to change
with this fix.

Remove mention of taskqueue_run(9) and taskqueue_run_fast(9) from the
taskqueue(9) man page.

Reviewed by:    jhb
Approved by:    zml (mentor)
2010-07-22 16:41:09 +00:00
Jaakko Heinonen
13c02cbb18 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
2010-07-05 16:23:55 +00:00
Alan Cox
b64400a03f 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
2010-07-03 18:25:37 +00:00
Colin Percival
bb48785424 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.
2010-06-27 02:30:19 +00:00
Jaakko Heinonen
3141712daa Update vfs_busy(9) and vfs_unbusy(9) manual pages to better match the
current behaviour of the functions.

Discussed with:	attilio
2010-06-14 17:31:46 +00:00
Ulrich Spörlein
134d45e8c6 mdoc nitpicking: the title argument shall be uppercase 2010-06-11 06:03:47 +00:00
Ulrich Spörlein
e10c1be450 mdoc cleanup
Garbage collect unused sections, macros and arguments. Fix prologue and
remove empty lines.

Found by: mdocml
2010-06-02 10:20:23 +00:00
Ulrich Spörlein
25c8b07fc2 mdoc: Garbage collect unused/unneeded macros 2010-05-27 13:56:27 +00:00
Ulrich Spörlein
668d8dd3c8 These features will first appear in 8.1, soon to be released
MFC after:	3 days
2010-05-24 11:14:40 +00:00
Ulrich Spörlein
62486687ed mdoc: consistently spell our email addresses <foo@FreeBSD.org>
Reviewed by:	ru
2010-05-19 08:57:53 +00:00
Ulrich Spörlein
0b31f1f731 mdoc: move remaining sections into consistent order
This pertains mostly to FILES, HISTORY, EXIT STATUS and AUTHORS sections.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:08:11 +00:00
Ulrich Spörlein
0afc94c17a mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:07:55 +00:00
Konstantin Belousov
2b848cb1f5 Document MAKEDEV_NOWAIT flag for make_dev_credf(9).
Reviewed by:	jh
MFC after:	2 weeks
2010-05-06 19:23:49 +00:00
Rui Paulo
54862540ba Couple of fixes from DragonFly (typos).
Obtained from:	DragonFlyBSD
2010-04-28 13:29:48 +00:00
Lawrence Stewart
7d11e744c1 - Rework the underlying ALQ storage to be a circular buffer, which amongst other
things allows variable length messages to be easily supported.

- Extend KPI with alq_writen() and alq_getn() to support variable length
  messages, which is enabled at ALQ creation time depending on the
  arguments passed to alq_open(). Also add variants of alq_open() and
  alq_post() that accept a flags argument. The KPI is still fully
  backwards compatible and shouldn't require any change in ALQ consumers
  unless they wish to utilise the new features.

- Introduce the ALQ_NOACTIVATE and ALQ_ORDERED flags to allow ALQ consumers
  to have more control over IO scheduling and resource acquisition
  respectively.

- Strengthen invariants checking.

- Document ALQ changes in ALQ(9) man page.

Sponsored by:	FreeBSD Foundation
Reviewed by:	gnn, jeff, rpaulo, rwatson
MFC after:	1 month
2010-04-26 13:48:22 +00:00
Ulrich Spörlein
aa12cea2cc mdoc: order prologue macros consistently by Dd/Dt/Os
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 19:08:06 +00:00
Ed Maste
a69a51149e Remove extraneous '>'. 2010-04-07 19:13:31 +00:00
Edward Tomasz Napierala
11b168b80e Fix references. 2010-03-29 17:39:38 +00:00
Konstantin Belousov
40c05da5e0 Correct the type for uio_resid.
MFC after:	3 days
2010-03-21 16:14:19 +00:00
Andriy Gapon
212909cc32 vfs_mount.9: drop cross-reference to a removed manual
MFC after:	3 days
2010-03-19 14:35:38 +00:00
Ulrich Spörlein
63d46d1d5e Fix several typos in macros or macro misusage.
Found by:	make manlint
Reviewed by:	ru
Approved by:	philip (mentor)
2010-03-12 10:01:06 +00:00
Gleb Smirnoff
20e26ae67a Remove C99 initializer, since dominant style is to use non-C99 initializers.
Requested by:	jhb
2010-03-03 18:49:15 +00:00
Joel Dahl
c0de7d2f15 The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 21:50:36 +00:00
Gleb Smirnoff
0884cae17b - Add missing includes to make example "compilable".
- Use C99 initializer just in case if driver_t may change in future.
- Use NULL for pointer arguments instead of 0.
2010-03-02 21:10:44 +00:00
Konstantin Belousov
c46221d700 Update man page for vm_page_alloc(9).
Based on the submission by:	Giovanni Trematerra <giovanni.trematerra gmail com>
MFC after:	3 days
2010-02-27 17:11:15 +00:00
Xin LI
0a431e0795 Add several necessary .El's.
MFC after:	2 weeks
2010-02-27 01:17:44 +00:00
John Baldwin
1d800a676e Fix spelling of EACCES.
PR:		docs/144112
Submitted by:	Alexander Best
MFC after:	3 days
2010-02-24 13:13:29 +00:00
Bernhard Schmidt
69699faa81 Fix some typos.
Approved by:	rpaulo (mentor)
MFC after:	1 week
2010-02-22 17:03:26 +00:00
Robert Watson
497c391c9b Cross-reference netstat(1) from netisr(9) since you can now use it to
monitor netisr status.

MFC after:	1 week
Sponsored by:	Juniper Networks
2010-02-22 16:02:17 +00:00
Edward Tomasz Napierala
88238a0805 Some rewording and language fixes.
PR:		docs/136918, docs/134074
Submitted by:	Ben Kaduk <kaduk at mit dot edu>, Haven Hash <havenster at gmail dot com>
2010-02-15 17:41:59 +00:00
Edward Tomasz Napierala
ddcd2bc9ec Remove list of locking primitives, which is kind of redundant, move
information about witness(9) to the section about interactions, and
expand 'contexts' table.
2010-02-13 12:03:03 +00:00
Edward Tomasz Napierala
a26a657cd2 Fix VBAD description. 2010-02-13 11:54:01 +00:00
Edward Tomasz Napierala
b132183383 Start sentences with a new line.
Submitted by:	brueffer
2010-02-10 19:03:48 +00:00
Edward Tomasz Napierala
0b0b48c06a Improve description for Giant and mention blocking inside interrupt threads. 2010-02-10 17:02:06 +00:00
Edward Tomasz Napierala
13d034bf5d Remove VOP_VPTOFH(9) from references in VFS(9), as it's a VOP,
not VFS operation.
2010-02-09 21:01:18 +00:00
Edward Tomasz Napierala
8e20a412b1 Add references to VOP_* man pages to vnode(9). 2010-02-09 20:58:39 +00:00
Gavin Atkinson
7ee901ef6b Correct arguments to free_unr(), "item" was missing.
MFC after:	1 week
2010-02-07 20:36:23 +00:00
Edward Tomasz Napierala
6e53c1bb55 Add missing coma. 2010-02-06 14:10:45 +00:00
Edward Tomasz Napierala
4ff467dc65 Cosmetic fixes. 2010-01-28 21:14:12 +00:00
Edward Tomasz Napierala
561205dff6 Add description of bounded sleep vs unbounded sleep (aka blocking). Move
rules into their own section.
2010-01-28 19:57:24 +00:00
Edward Tomasz Napierala
815e47727e Improve descriptions, remove turnstiles (since, from what I understand,
they are only used to implement other synchronization primitives), tweak
formatting.
2010-01-28 17:09:47 +00:00
Attilio Rao
a50e80dcdd - Fix the kthread_{suspend, resume, suspend_check}() locking.
In the current code, the locking is completely broken and may lead
  easilly to deadlocks. Fix it by using the proc_mtx, linked to the
  suspending thread, as lock for the operation.  Keep using the
  thread_lock for setting and reading the flag even if it is not entirely
  necessary (atomic ops may do it as well, but this way the code is more
  readable).
- Fix a deadlock within kthread_suspend().
  The suspender should not sleep on a different channel wrt the suspended
  thread, or, otherwise, the awaker should wakeup both. Uniform the
  interface to what the kproc_* counterparts do (sleeping on the same
  channel).
- Change the kthread_suspend_check() prototype.
  kthread_suspend_check() always assumes curthread and must only refer to
  it, so skip the thread pointer as it may be easilly mistaken.
  If curthread is not a kthread, the system will panic.

In collabouration with:	jhb
Tested by:		Giovanni Trematerra
			<giovanni dot trematerra at gmail dot com>
MFC:			2 weeks
2010-01-24 15:07:00 +00:00
John Baldwin
6849f8d790 Sort NDHASGIANT.9 link properly. 2010-01-19 20:36:15 +00:00
Gavin Atkinson
f3066f2be7 Xref sysctl(3)
Approved by:	ed (mentor)
2010-01-16 14:31:01 +00:00
Ruslan Ermilov
aa4a335bae Use the newly brought %U macro. 2010-01-15 16:01:22 +00:00
John Baldwin
54721dc9f4 - Note that if_xname, if_dname, and if_dunit are usually initialized via
if_initname().
- Document if_drv_flags and replace references to IFF_(RUNNING|OACTIVE)
  with references to IFF_DRV_(RUNNING|OACTIVE).
- Complete truncated sentence in the description of if_transmit by copying
  from the description in if_qflush.
- Add missing line breaks for translators.

Reviewed by:	brooks (1)
MFC after:	3 days
2010-01-14 14:43:16 +00:00
John Baldwin
94fa222a96 - Update required headers for namei() to add <sys/fcntl.h> and remove
<sys/proc.h>.
- Add RETURN VALUES and ERROR sections for namei()'s error return values.
- Add a missing link to NDHASGIANT.9.

PR:		docs/142815, docs/142816
Submitted by:	Lachlan Kang (1, 2)
MFC after:	3 days
2010-01-14 14:36:39 +00:00
Attilio Rao
f7829d0d5c Introduce the new kernel thread called "deadlock resolver".
While the name is pretentious, a good explanation of its targets is
reported in this 17 months old presentation e-mail:
http://lists.freebsd.org/pipermail/freebsd-arch/2008-August/008452.html

In order to implement it, the sq_type in sleepqueues is mandatory and not
only compiled along with INVARIANTS option. Additively, a new sleepqueue
function, sleepq_type() is added, returning the type of the sleepqueue
linked to a wchan.
Three new sysctls are added in order to configure the thread:
debug.deadlkres.slptime_threshold
debug.deadlkres.blktime_threshold
debug.deadlkres.sleepfreq

rappresenting the thresholds for sleep and block time that will lead to
a deadlock matching (when exceeded), while the sleepfreq rappresents the
number of seconds between 2 consecutive thread runnings.
In order to enable the deadlock resolver thread recompile your kernel
with the option DEADLKRES.

Reviewed by:	jeff
Tested by:	pho, Giovanni Trematerra
Sponsored by:	Nokia Incorporated, Sandvine Incorporated
MFC after:	2 weeks
2010-01-09 01:46:38 +00:00
Christian Brueffer
37d3a10d84 Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened
almost three years ago in r166794.

PR:		140989
Submitted by:	Lachlan Kang
MFC after:	1 week
2010-01-04 22:22:00 +00:00
Konstantin Belousov
ed12757873 PG_NOSYNC is called VPO_NOSYNC for long time.
MFC after:	3 days
2010-01-04 14:58:41 +00:00
Ruslan Ermilov
7f3c22be14 Removed duplicate usbd_xfer_state(9) link. 2009-12-22 16:05:28 +00:00
Ruslan Ermilov
b4dfd2d9cd Sort mlinks. 2009-12-22 16:02:08 +00:00
Julian Elischer
84bc0aa3b0 Make man page reflect the output columns
MFC after:	1 week
2009-12-16 19:37:38 +00:00
Konstantin Belousov
ec897c886d Document PBDRY and SLEEPQ_STOP_ON_BDRY.
Requested and reviewed by:	attilio
MFC after:	3 days
2009-12-12 22:08:37 +00:00
Attilio Rao
2028867def In current code, threads performing an interruptible sleep (on both
sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will
leave the waiters flag on forcing the owner to do a wakeup even when if
the waiter queue is empty.
That operation may lead to a deadlock in the case of doing a fake wakeup
on the "preferred" (based on the wakeup algorithm) queue while the other
queue has real waiters on it, because nobody is going to wakeup the 2nd
queue waiters and they will sleep indefinitively.

A similar bug, is present, for lockmgr in the case the waiters are
sleeping with LK_SLEEPFAIL on.  In this case, even if the waiters queue
is not empty, the waiters won't progress after being awake but they will
just fail, still not taking care of the 2nd queue waiters (as instead the
lock owned doing the wakeup would expect).

In order to fix this bug in a cheap way (without adding too much locking
and complicating too much the semantic) add a sleepqueue interface which
does report the actual number of waiters on a specified queue of a
waitchannel (sleepq_sleepcnt()) and use it in order to determine if the
exclusive waiters (or shared waiters) are actually present on the lockmgr
(or sx) before to give them precedence in the wakeup algorithm.
This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to
cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters
a lockmgr has and if all the waiters on the exclusive waiters queue are
LK_SLEEPFAIL just wake both queues.

The sleepq_sleepcnt() introduction and ABI breakage require
__FreeBSD_version bumping.

Reported by:	avg, kib, pho
Reviewed by:	kib
Tested by:	pho
2009-12-12 21:31:07 +00:00
Edward Tomasz Napierala
4cbe4bf979 Add missing parameter description. 2009-12-02 18:11:14 +00:00
Bjoern A. Zeeb
aaae58c491 Unbreak user space after if_timer/if_watchdog removal in r199975.
Tested by:	glebius
2009-12-01 14:56:00 +00:00
Ruslan Ermilov
9589412053 Back in 2003, get_cyclecount() was changed to use binuptime() instead
of nanotime().  Reflect this change in a manpage.

Reviewed by:	phk, markm
2009-10-29 09:45:05 +00:00
Ed Maste
e04cb6afe4 Add link for callout_schedule(9). 2009-10-27 14:37:25 +00:00
Christian Brueffer
7024354df3 Sort SEE ALSO. 2009-10-16 12:32:07 +00:00
John Baldwin
37b8ef16cd Add a facility for associating optional descriptions with active interrupt
handlers.  This is primarily intended as a way to allow devices that use
multiple interrupts (e.g. MSI) to meaningfully distinguish the various
interrupt handlers.
- Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate
  a description with an active interrupt handler setup by BUS_SETUP_INTR.
  It has a default method (bus_generic_describe_intr()) which simply passes
  the request up to the parent device.
- Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports
  printf(9) style formatting using var args.
- Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of
  an interrupt handler and copy the name passed to intr_event_add_handler()
  into that buffer instead of just saving the pointer to the name.
- Add a new intr_event_describe_handler() which appends a description string
  to an interrupt handler's name.
- Implement support for interrupt descriptions on amd64 and i386 by having
  the nexus(4) driver supply a custom bus_describe_intr method that invokes
  a new intr_describe() MD routine which in turn looks up the associated
  interrupt event and invokes intr_event_describe_handler().

Requested by:	many
Reviewed by:	scottl
MFC after:	2 weeks
2009-10-15 14:54:35 +00:00
John Baldwin
38d3501a8e Oops, add a return values section to note that these routines return an error
on failure or zero on success.
2009-10-14 16:00:20 +00:00
John Baldwin
2783151570 Add a manual page for BUS_BIND_INTR() and bus_bind_intr().
MFC after:	1 week
2009-10-14 15:58:59 +00:00
Edward Tomasz Napierala
55b95b33ed Make fetch(9) and store(9) manual pages closer to reality. 2009-10-05 15:16:28 +00:00
Edward Tomasz Napierala
a9315dded6 Add pieces of infrastructure required for NFSv4 ACL support in UFS.
Reviewed by:	rwatson
2009-09-22 15:15:03 +00:00
Christian Brueffer
aa8775c640 Fix mdoc, typos, contractions.
This includes:
PR:		135520
Submitted by:	Nobuyuki Koganemaru
Patch by:	gavin
MFC after:	3 days
2009-09-18 14:05:56 +00:00
Christian Brueffer
ace02a6d46 Various mdoc, spelling etc fixes.
MFC after:	3 days
2009-09-18 00:33:47 +00:00
Julian Elischer
58cf5c84e0 Add claraifications to the kproc and kthread manpages and link
the kthread_create(9) man page to the kproc(9) page as it had migrated and
people looking for it may need a hand to find its new name.

MFC after:	1 week
2009-08-23 07:48:11 +00:00
John Baldwin
eb5a1e8f38 This patch fixes two bugs in sglist(9) and improves robustness of the API via
better semantics if a request to append an address range to an existing list
fails.
- When cloning an sglist, properly set the length in the new sglist instead of
  leaving the new list empty.
- Properly compute the amount of data added to an sglist via
  _sglist_append_buf().  This allows sglist_consume_uio() to properly update
  uio_resid.
- When a request to append an address range to a scatter/gather list fails,
  restore the sglist to the state it had at the start of the function call
  instead of resetting it to an empty list.

Requested by:	np (3)
Approved by:	re (kib)
2009-08-21 02:59:07 +00:00
John Baldwin
0cef25aeb2 Change the 'resid' parameter to sglist_consume_uio() from an int to a
size_t to match the recent type change of the uio_resid member of struct
uio.

Approved by:	re (kib)
2009-08-20 19:23:58 +00:00
Pawel Jakub Dawidek
e477e4fe8e Remove unused taskqueue_find() function.
Reviewed by:	dfr
Approved by:	re (kib)
2009-08-18 13:55:48 +00:00
Pawel Jakub Dawidek
9c1a8ce494 Correct typo in the previous commit.
Noticed by:	pluknet <pluknet@gmail.com>
Approved by:	re (kib, implicit)
2009-08-17 10:20:22 +00:00
Pawel Jakub Dawidek
159ef108e1 Remove OpenSolaris taskq port (it performs very poorly in our kernel) and
replace it with wrappers around our taskqueue(9).
To make it possible implement taskqueue_member() function which returns 1
if the given thread was created by the given taskqueue.

Approved by:	re (kib)
2009-08-17 09:01:20 +00:00
Sam Leffler
692eebe092 First (early) draft of net80211 documentation. Note this is
focused on driver writers (as opposed to folks adding to net80211).

Reviewed by:	wkoszek
Approved by:	re (rwatson)
2009-08-12 21:03:16 +00:00
Bjoern A. Zeeb
d0ea47437a Update epair(4) to the new netisr implementation and polish
things a bit:
- use dpcpu data to track the ifps with packets queued up,
- per-cpu locking and driver flags
- along with .nh_drainedcpu and NETISR_POLICY_CPU.
- Put the mbufs in flight reference count, preventing interfaces
  from going away, under INVARIANTS as this is a general problem
  of the stack and should be solved in if.c/netisr but still good
  to verify the internal queuing logic.
- Permit changing the MTU to virtually everythinkg like we do for loopback.

Hook epair(4) up to the build.

Approved by:	re (kib)
2009-07-26 12:20:07 +00:00
Colin Percival
383334b383 Fix typo: kproc_resume,.9 -> kproc_resume.9.
Approved by:	re (kib)
2009-07-11 17:36:59 +00:00
Andrew Thompson
b35f050eb2 Move programming info from usb(4) to usbdi(9) and update for the usb stack
changeover. Needs much more content still.
2009-06-24 17:01:17 +00:00
Robert Watson
36fecbf302 Add stack_print_short() and stack_print_short_ddb() interfaces to
stack(9), which generate a more compact rendition of a stack trace
via the kernel's printf.

MFC after:	1 week
2009-06-24 12:06:15 +00:00
Konstantin Belousov
c9253e931d Usermode portion of the support for swap allocation accounting:
- update for getrlimit(2) manpage;
- support for setting RLIMIT_SWAP in login class;
- addition to the limits(1) and sh and csh limit-setting builtins;
- tuning(7) documentation on the sysctls controlling overcommit.

In collaboration with:	pho
Reviewed by:	alc
Approved by:	re (kensmith)
2009-06-23 20:57:27 +00:00
Brooks Davis
e8477da212 Document crcopysafe() and crsetgroups().
Reminded by:	julian
2009-06-19 19:16:35 +00:00
Attilio Rao
651175c9db Introduce support for adaptive spinning in lockmgr.
Actually, as it did receive few tuning, the support is disabled by
default, but it can opt-in with the option ADAPTIVE_LOCKMGRS.
Due to the nature of lockmgrs, adaptive spinning needs to be
selectively enabled for any interested lockmgr.
The support is bi-directional, or, in other ways, it will work in both
cases if the lock is held in read or write way.  In particular, the
read path is passible of further tunning using the sysctls
debug.lockmgr.retries and debug.lockmgr.loops .  Ideally, such sysctls
should be axed or compiled out before release.

Addictionally note that adaptive spinning doesn't cope well with
LK_SLEEPFAIL.  The reason is that many (and probabilly all) consumers
of LK_SLEEPFAIL are mainly interested in knowing if the interlock was
dropped or not in order to reacquire it and re-test initial conditions.
This directly interacts with adaptive spinning because lockmgr needs
to drop the interlock while spinning in order to avoid a deadlock
(further details in the comments inside the patch).

Final note: finding someone willing to help on tuning this with
relevant workloads would be either very important and appreciated.

Tested by:	jeff, pho
Requested by:	many
2009-06-17 01:55:42 +00:00
Bjoern A. Zeeb
ed655c8c07 Add an optional callback function that will be invoked when a per-CPU
queue was drained.  It will never fire for a directly dispatched packet.

You will most likely never want to use this for any ordinary netisr usage
and you will never blame netisr in case you try to use it and it does
not work as expected.

Reviewed by:	rwatson
2009-06-14 17:15:18 +00:00
Bjoern A. Zeeb
44549f1334 Remove a line break leaving a function return type attached to the old
function declaration bottom rather than the new function declaration
start.
2009-06-14 12:11:15 +00:00
Warner Losh
7adb51acc7 These are no longer public, so remove the man page. 2009-06-09 23:38:19 +00:00
John Baldwin
4ef60d2686 Add support for multiple passes of the device tree during the boot-time
probe.  The current device order is unchanged.  This commit just adds the
infrastructure and ABI changes so that it is easier to merge later changes
into 8.x.
- Driver attachments now have an associated pass level.  Attachments are
  not allowed to probe or attach to drivers until the system-wide pass level
  is >= the attachment's pass level.  By default driver attachments use the
  "last" pass level (BUS_PASS_DEFAULT).  Driver's that wish to probe during
  an earlier pass use EARLY_DRIVER_MODULE() instead of DRIVER_MODULE() which
  accepts the pass level as an additional parameter.
- A new method BUS_NEW_PASS has been added to the bus interface.  This
  method is invoked when the system-wide pass level is changed to kick off
  a rescan of the device tree so that drivers that have just been made
  "eligible" can probe and attach.
- The bus_generic_new_pass() function provides a default implementation of
  BUS_NEW_PASS().  It first allows drivers that were just made eligible for
  this pass to identify new child devices.  Then it propogates the rescan to
  child devices that already have an attached driver by invoking their
  BUS_NEW_PASS() method.  It also reprobes devices without a driver.
- BUS_PROBE_NOMATCH() is only invoked for devices that do not have
  an attached driver after being scanned during the final pass.
- The bus_set_pass() function is used during boot to raise the pass level.
  Currently it is only called once during root_bus_configure() to raise
  the pass level to BUS_PASS_DEFAULT.  This has the effect of probing all
  devices in a single pass identical to previous behavior.

Reviewed by:	imp
Approved by:	re (kib)
2009-06-09 14:26:23 +00:00
Robert Watson
6b8eb655fd Try again to add beginnings of netisr(8) man page: this time add
netisr.9.
2009-06-07 21:32:01 +00:00
Robert Watson
3c9c33bba1 Add beginnings of a netisr(9) man page. 2009-06-07 21:31:06 +00:00
John Baldwin
b36cfff75d Add a simple API to manage scatter/gather lists of phyiscal addresses.
Each list describes a logical memory object that is backed by one or more
physical address ranges.  To minimize locking, the sglist objects
themselves are immutable once they are shared.

These objects may be used in the future to facilitate I/O requests using
physically-addressed buffers.  For the immediate future I plan to use them
to implement a new type of VM object and pager.

Reviewed by:	jeff, scottl
MFC after:	1 month
2009-06-01 20:35:39 +00:00
Edward Tomasz Napierala
f0fa0e7faa Use the "flag" word consistently.
Submitted by:	Ben Kaduk <minimarmot at gmail.com>
2009-06-01 07:48:27 +00:00
Edward Tomasz Napierala
c97fcdba57 Add VOP_ACCESSX, which can be used to query for newly added V*
permissions, such as VWRITE_ACL.  For a filsystems that don't
implement it, there is a default implementation, which works
as a wrapper around VOP_ACCESS.

Reviewed by:	rwatson@
2009-05-30 13:59:05 +00:00
Robert Watson
1a109c1cb0 Make the rmlock(9) interface a bit more like the rwlock(9) interface:
- Add rm_init_flags() and accept extended options only for that variation.
- Add a flags space specifically for rm_init_flags(), rather than borrowing
  the lock_init() flag space.
- Define flag RM_RECURSE to use instead of LO_RECURSABLE.
- Define flag RM_NOWITNESS to allow an rmlock to be exempt from WITNESS
  checking; this wasn't possible previously as rm_init() always passed
  LO_WITNESS when initializing an rmlock's struct lock.
- Add RM_SYSINIT_FLAGS().
- Rename embedded mutex in rmlocks to make it more obvious what it is.
- Update consumers.
- Update man page.
2009-05-29 10:52:37 +00:00
Attilio Rao
1ae1c2a3bd Reverse the logic for ADAPTIVE_SX option and enable it by default.
Introduce for this operation the reverse NO_ADAPTIVE_SX option.
The flag SX_ADAPTIVESPIN to be passed to sx_init_flags(9) gets suppressed
and the new flag, offering the reversed logic, SX_NOADAPTIVE is added.

Additively implements adaptive spininning for sx held in shared mode.
The spinning limit can be handled through sysctls in order to be tuned
while the code doesn't reach the release, after which time they should
be dropped probabilly.

This change has made been necessary by recent benchmarks where it does
improve concurrency of workloads in presence of high contention
(ie. ZFS).

KPI breakage is documented by __FreeBSD_version bumping, manpage and
UPDATING updates.

Requested by:	jeff, kmacy
Reviewed by:	jeff
Tested by:	pho
2009-05-29 01:49:27 +00:00
Zachary Loafman
eae608ef4c Fix style/grammar issues in fail(9) man page.
Suggested by:       Ben Kaduk
Approved by:        dfr (mentor)
2009-05-28 15:02:52 +00:00
Zachary Loafman
cfeb7489c2 fail(9) support:
Add support for kernel fault injection using KFAIL_POINT_* macros and
fail_point_* infrastructure. Add example fail point in vfs_bio.c to
simulate VM buf pressure.

Approved by:        dfr (mentor)
2009-05-27 16:36:54 +00:00
Edward Tomasz Napierala
4a48670553 There are things too complex to be fixed in one commit.
Fix a typo in acl(9) manual page.

Submitted by:	avg
2009-05-24 20:34:29 +00:00
Tom McLaughlin
c327ec0021 Update man pages after VFS_* changes in r191990.
Approved by:	brueffer, attilio
2009-05-24 18:34:54 +00:00
Edward Tomasz Napierala
7070b4fc87 Fix typo in the manual page. 2009-05-24 17:08:00 +00:00
Edward Tomasz Napierala
3f8cd45f79 Add new constants to the acl(9) manual page. 2009-05-24 09:42:53 +00:00
John Baldwin
e6b089446b Attempt to clarify some confusing wording regarding atomic_load() and
atomic_store().
2009-05-21 13:39:46 +00:00
Christian Brueffer
72fba9d714 Document sbuf_new_auto().
While here, add a missing `-' in phk's name.

MFC after:	3 days
2009-05-17 21:28:37 +00:00
Marius Strobl
08390d3b63 Correct r190283 (partially reverting it) as on sparc64 BUS_DMA_NOCACHE
actually is only valid for bus_dmamap_load().

MFC after:	3 days
2009-05-12 20:56:34 +00:00
Robert Watson
78fc60e401 Garbage collect man page reference to IFF_NEEDSGIANT. 2009-04-18 20:09:43 +00:00
Edward Tomasz Napierala
d0d7c39c72 Remove 'IMPLEMENTATION NOTES' section from acl(9); it was just a copy/paste
from <sys/acl.h> and it would get out-of-date pretty soon.
2009-04-11 10:37:04 +00:00
Robert Watson
cd5213b94b Remove VOP_LEASE(9) man page, as we no longer have a VOP_LEASE() in the
kernel.
2009-04-10 10:59:48 +00:00
Tom Rhodes
cd5e62f992 Catch up with recent locking changes.
PR:		132546
Submitted by:	pluknet <pluknet@gmail.com>
Reviewed by:	alc
2009-04-03 23:52:47 +00:00
Edward Tomasz Napierala
6283502e20 Remove pseudocode from VOP_* manual pages. It was out of date anyway.
Reviewed by:	scottl
Approved by:	rwatson (mentor)
2009-03-30 20:56:37 +00:00
John Baldwin
497435aafd Add a simple manage for the refcount(9) API.
Requested by:	rwatson
2009-03-30 18:01:12 +00:00
Robert Noland
ba0b16188e Correct the documentation to reflect the fact that BUS_DMA_NOCACHE is a
flag to bus_dmamem_alloc() rather than bus_dmamap_load();

Discussed with:	kib
MFC after:	3 days
2009-03-22 21:00:58 +00:00
Joe Marcus Clarke
74999b4cf2 Document the new default implementation of VOP_VPTOCNP(9).
Approved by:	kib
2009-03-08 19:07:44 +00:00
Jamie Gritton
f86bce5ed0 Extend the "vfsopt" mount options for more general use. Make struct
vfsopt and the vfs_buildopts function public, and add some new fields
to struct vfsopt (pos and seen), and new functions vfs_getopt_pos and
vfs_opterror.

Further extend the interface to allow reading options from the kernel
in addition to sending them to the kernel, with vfs_setopt and related
functions.

While this allows the "name=value" option interface to be used for more
than just FS mounts (planned use is for jails), it retains the current
"vfsopt" name and <sys/mount.h> requirement.

Approved by:	bz (mentor)
2009-03-02 23:26:30 +00:00
Edward Tomasz Napierala
cbc1fff1f6 Mention disk_gone() in disk(9).
Approved by:	rwatson (mentor)
2009-02-22 13:38:16 +00:00
Attilio Rao
05fa71ba43 Remove the assertive KA_HELD and KA_UNHELD as long as they are dangerous,
and not really helpful.
2009-02-05 15:09:04 +00:00
Tom Rhodes
49b50876b6 Add ENOMEM to the return values.
Remove invalid return values.
Remove reference to non-existent manual pages.
Remove reference to rfork (it does not discuss RFSTOPPED).
Add sys/unistd.h to the list of includes (required for RFSTOPPED).

PR:		126227
Submitted by:	Mateusz Guzik <mjguzik@gmail.com> (based on, original version)
Reviewed by:	jhb, Christoph Mallon <christoph.mallon@gmx.de>
2009-01-27 00:22:16 +00:00
Christian Brueffer
b9a2c48954 DEBUG_REDZONE needs DDB which needs KDB.
PR:		130324
Submitted by:	Jaakko Heinonen <jh@saunalahti.fi>
MFC after:	3 days
2009-01-09 14:41:36 +00:00
Christian Brueffer
c62a048b6c Language cleanup. 2009-01-08 21:29:40 +00:00
Robert Watson
f38d120723 Remove reference to pr_ousrreq from domain(9) since it's now gone from
struct protosw.

Submitted by:	bz
MFC after:	3 weeks
2009-01-04 19:23:44 +00:00
Christian Brueffer
9d721de31e Mdoc and language cleanup. 2009-01-03 10:37:38 +00:00
Bjoern A. Zeeb
8c639779f4 pr_pfh has been gone from protosw since r120386 (more than 5 years ago).
MFC after:	4 weeks
2008-12-23 16:54:00 +00:00
Dag-Erling Smørgrav
a1432b4c99 Boot out <sysexits.h> once and for all.
MFC after:	1 week
2008-12-17 13:01:19 +00:00
Edward Tomasz Napierala
0da50f6ef8 According to phk@, VOP_STRATEGY should never, _ever_, return
anything other than 0.  Make it so.  This fixes
"panic: VOP_STRATEGY failed bp=0xc320dd90 vp=0xc3b9f648",
encountered when writing to an orphaned filesystem.  Reason
for the panic was the following assert:
KASSERT(i == 0, ("VOP_STRATEGY failed bp=%p vp=%p", bp, bp->b_vp));
at vfs_bio:bufstrategy().

Reviewed by:	scottl, phk
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
2008-12-16 21:13:11 +00:00
Kip Macy
0a420d08ae re-add accidentally deleted line 2008-12-15 07:51:59 +00:00
Qing Li
6e6b3f7cbc This main goals of this project are:
1. separating L2 tables (ARP, NDP) from the L3 routing tables
2. removing as much locking dependencies among these layers as
   possible to allow for some parallelism in the search operations
3. simplify the logic in the routing code,

The most notable end result is the obsolescent of the route
cloning (RTF_CLONING) concept, which translated into code reduction
in both IPv4 ARP and IPv6 NDP related modules, and size reduction in
struct rtentry{}. The change in design obsoletes the semantics of
RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland
applications such as "arp" and "ndp" have been modified to reflect
those changes. The output from "netstat -r" shows only the routing
entries.

Quite a few developers have contributed to this project in the
past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and
Andre Oppermann. And most recently:

- Kip Macy revised the locking code completely, thus completing
  the last piece of the puzzle, Kip has also been conducting
  active functional testing
- Sam Leffler has helped me improving/refactoring the code, and
  provided valuable reviews
- Julian Elischer setup the perforce tree for me and has helped
  me maintaining that branch before the svn conversion
2008-12-15 06:10:57 +00:00
Joe Marcus Clarke
7d5336f0a2 Add a man page for VOP_VPTOCNP.
Reviewed by:	arch
Approved by:	kib
2008-12-12 01:08:28 +00:00
Kip Macy
a2b96afe46 Add entry for if_transmit and if_qflush 2008-12-11 22:51:11 +00:00
Konstantin Belousov
0886d6e46b Clarify the reason to not use the volatile string as an argument to CTR
macros. Note the logging of file and line.

Reviewed by:	dchagin
MFC after:	3 days
2008-11-30 13:18:35 +00:00
Robert Watson
3c8d4fc09b Revert r184509: don't encourage the use of sysexits.h with err() and
errx(),, as there seems to be a general preference against this
practice.

Suggested by:	bde, des, jhb
2008-11-27 08:42:58 +00:00
Hiroki Sato
a4ede73abb Remove vfs_mountedon(9) manual page. The vfs_mountedon(9) has been
removed since 2004.
2008-11-23 20:05:12 +00:00
Hiroki Sato
cc7d6b558e vn_fullpath(9) does not assume vp is locked by the caller now. 2008-11-23 20:02:58 +00:00
Pawel Jakub Dawidek
1ba4a712dd Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.
This bring huge amount of changes, I'll enumerate only user-visible changes:

- Delegated Administration

	Allows regular users to perform ZFS operations, like file system
	creation, snapshot creation, etc.

- L2ARC

	Level 2 cache for ZFS - allows to use additional disks for cache.
	Huge performance improvements mostly for random read of mostly
	static content.

- slog

	Allow to use additional disks for ZFS Intent Log to speed up
	operations like fsync(2).

- vfs.zfs.super_owner

	Allows regular users to perform privileged operations on files stored
	on ZFS file systems owned by him. Very careful with this one.

- chflags(2)

	Not all the flags are supported. This still needs work.

- ZFSBoot

	Support to boot off of ZFS pool. Not finished, AFAIK.

	Submitted by:	dfr

- Snapshot properties

- New failure modes

	Before if write requested failed, system paniced. Now one
	can select from one of three failure modes:
	- panic - panic on write error
	- wait - wait for disk to reappear
	- continue - serve read requests if possible, block write requests

- Refquota, refreservation properties

	Just quota and reservation properties, but don't count space consumed
	by children file systems, clones and snapshots.

- Sparse volumes

	ZVOLs that don't reserve space in the pool.

- External attributes

	Compatible with extattr(2).

- NFSv4-ACLs

	Not sure about the status, might not be complete yet.

	Submitted by:	trasz

- Creation-time properties

- Regression tests for zpool(8) command.

Obtained from:	OpenSolaris
2008-11-17 20:49:29 +00:00
Ed Schouten
6da593a22a Fix argument layout of devfs_get_cdevpriv().
Right now it shows `void' and `**datap' as two different arguments,
while they belong together.
2008-11-16 21:26:56 +00:00
Marius Strobl
afbeac3e60 - For maximum flexibility, sparc64 supports BUS_DMA_COHERENT also
with bus_dmamap_create() and not only bus_dmamem_alloc() so move
  the description of this flag up accordingly in order to document
  this fact. While at, it refine this description with an application
  example.
- Reword the description of BUS_DMA_NOCACHE as this flag is also
  implemented on sparc64.

MFC after:	1 week
2008-11-16 18:30:16 +00:00
Dag-Erling Smørgrav
898a259baa Missing email address
MFC after:	3 weeks
2008-11-05 15:07:42 +00:00
Attilio Rao
1efbe1a4be Reflect changes for the vfs_busy() prototype. 2008-11-02 10:33:57 +00:00
Edward Tomasz Napierala
c63bac11af Remove obsolete pseudocode from VOP_ACCESS.9, replacing it with something
closer to reality.

Approved by:	rwatson (mentor)
2008-11-01 19:02:05 +00:00
Robert Watson
c2911a7ac0 In style(9) examples of err() and errx(), use sysexits(3) errors rather
than returning 1.

Submitted by:	Bruce Cran <bruce at cran dot org dot uk>
MFC after:	3 days
2008-10-31 14:47:15 +00:00
Edward Tomasz Napierala
15bc6b2bd8 Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessary
to add more V* constants, and the variables changed by this patch were often
being assigned to mode_t variables, which is 16 bit.

Approved by:	rwatson (mentor)
2008-10-28 13:44:11 +00:00
Dag-Erling Smørgrav
1ede983cc9 Retire the MALLOC and FREE macros. They are an abomination unto style(9).
MFC after:	3 months
2008-10-23 15:53:51 +00:00
Attilio Rao
b63f51d0d0 Reflect changes into vinvalbuf(9) prototype. 2008-10-20 20:00:34 +00:00
Ed Schouten
66c6ebfe6b Several documentation fixups related to device minor/major numbers:
- Document the minor(3), major(3) and makedev(3) macro's. They also
  apply to umajor() and uminor() in the kernel, but hopefully we'll sort
  that out one day.

- Briefly dev2unit() inside the make_dev(9) manual page, since this is
  now the preferred macro to obtain character device unit numbers inside
  the kernel.

- Remove the device_ids(9) manual page. It contains highly inaccurate
  information, such as a description of the nonexistent major().
2008-09-28 20:15:45 +00:00
Warner Losh
10ec05d8dc Add stronger warning that spl is historical. I almost deleted this
man page entirely, but it is still mildly useful in understanding the
few splxxx usages we still have in the tree.
2008-09-28 03:45:16 +00:00
Ed Schouten
edde874555 Rename the minor' argument of make_dev(9) to unit'.
To prevent any further confusion about device minor and unit numbers,
we'd better just refer to device unit numbers. Many people still think
the numbers we show inside devfs have any relation to the numbers passed
to make_dev(9), which is not the case.

Discussed with:	kib
2008-09-26 14:31:24 +00:00
Attilio Rao
cecd8edba5 Remove the suser(9) interface from the kernel. It has been replaced from
years by the priv_check(9) interface and just very few places are left.
Note that compatibility stub with older FreeBSD version
(all above the 8 limit though) are left in order to reduce diffs against
old versions. It is responsibility of the maintainers for any module, if
they think it is the case, to axe out such cases.

This patch breaks KPI so __FreeBSD_version will be bumped into a later
commit.

This patch needs to be credited 50-50 with rwatson@ as he found time to
explain me how the priv_check() works in detail and to review patches.

Tested by:      Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
Reviewed by:    rwatson
2008-09-17 15:49:44 +00:00
Sam Leffler
5a2637d215 decription of macros to add ddb commands
Submitted by:	Guillaume Ballet <gballet@gmail.com>
MFC after:	1 month
2008-09-15 23:13:29 +00:00
Konstantin Belousov
dcd8bc9a08 Connect dev_clone.9 and devfs_set_cdevpriv.9 to the build. 2008-09-15 10:12:04 +00:00
Konstantin Belousov
0763bc964b Remove unneeded comma.
Noted by:	kensmith
2008-09-12 13:04:39 +00:00
Konstantin Belousov
817bf377d3 Document dev_clone eventhandler interface 2008-09-11 11:43:47 +00:00
Konstantin Belousov
630f2c3ba3 Add a first draft of the cdevpriv(9) documentation 2008-09-11 11:41:33 +00:00
Konstantin Belousov
fe7546493e Document make_dev_credf(9), destroy_dev_sched(9) and destroy_dev_drain(9)
functions.

Reviewed by:	brueffer
2008-09-11 11:38:48 +00:00
Konstantin Belousov
43826d2c06 Update insmntque(9) manpage, bringing it close to reality.
Reviewed by:	brueffer
2008-09-11 11:36:21 +00:00
Konstantin Belousov
d56aeabac3 Document BUS_DMA_NOCACHE.
MFC after:	3 days
2008-09-06 15:21:01 +00:00