Commit Graph

436 Commits

Author SHA1 Message Date
John-Mark Gurney
52b7bca6fd link mbuf to m_append so it can be found...
Pointed out by:	J David
MFC after:	1 week
2014-01-28 23:40:02 +00:00
Bryan Venteicher
fb6c25186b Add sglist_append_bio(9) to append a struct bio's data to a sglist
Reviewed by:	jhb, kib (long ago)
2014-01-13 04:41:08 +00:00
John-Mark Gurney
5c35eb22d4 document the m_getjcl function... 2013-12-20 23:57:05 +00:00
Eitan Adler
2d8b5d8dac Add missing symlinks for the sbuf man page 2013-10-23 03:27:42 +00:00
John Baldwin
fa24b620c0 Add a manpage for the getenv() family of functions in the kernel. 2013-10-22 20:10:38 +00:00
John Baldwin
ea41f49fc5 Add manpages for VOP_ADVISE() and VOP_ALLOCATE().
Approved by:	re (gjb)
2013-10-07 20:30:05 +00:00
John Baldwin
60a774426c - Document the UQUAD sysctl variants.
- Clarify that exactly one of the "access" flags is required and
  list the optional flags in a separate list.  Prefer bundling
  CTLFLAG_TUN into the access flag by not documenting it as an
  optional flag to set.

Approved by:	re (glebius)
MFC after:	1 week
2013-09-12 20:49:20 +00:00
John-Mark Gurney
7f3bdd0831 add links for the various vmem functions... 2013-09-04 17:48:41 +00:00
Antoine Brodin
0c4367400d Hook vm_page_busy.9 to the build 2013-08-26 16:38:40 +00:00
Attilio Rao
c7aebda8a1 The soft and hard busy mechanism rely on the vm object lock to work.
Unify the 2 concept into a real, minimal, sxlock where the shared
acquisition represent the soft busy and the exclusive acquisition
represent the hard busy.
The old VPO_WANTED mechanism becames the hard-path for this new lock
and it becomes per-page rather than per-object.
The vm_object lock becames an interlock for this functionality:
it can be held in both read or write mode.
However, if the vm_object lock is held in read mode while acquiring
or releasing the busy state, the thread owner cannot make any
assumption on the busy state unless it is also busying it.

Also:
- Add a new flag to directly shared busy pages while vm_page_alloc
  and vm_page_grab are being executed.  This will be very helpful
  once these functions happen under a read object lock.
- Move the swapping sleep into its own per-object flag

The KPI is heavilly changed this is why the version is bumped.
It is very likely that some VM ports users will need to change
their own code.

Sponsored by:	EMC / Isilon storage division
Discussed with:	alc
Reviewed by:	jeff, kib
Tested by:	gavin, bapt (older version)
Tested by:	pho, scottl
2013-08-09 11:11:11 +00:00
Brooks Davis
f1bd660622 Document the sbinuptime() and getsbinuptime() functions introduced in
r247452.

Sponsored by:	DARPA, AFRL
2013-07-25 20:53:15 +00:00
Gleb Smirnoff
1b746e62ae Add manual page for vmem(9). Obtained from NetBSD, modified to match
our implementation.

Obtained from:	NetBSD
2013-07-12 14:25:58 +00:00
Mark Johnston
98491bfaa4 Add a man page for the SDT_* macros, which can be used to define new static
DTrace probes and providers in kernel code.

MFC after:	1 week
2013-07-06 20:31:22 +00:00
John Baldwin
cd32bd7ad1 Several improvements to rmlock(9). Many of these are based on patches
provided by Isilon.
- Add an rm_assert() supporting various lock assertions similar to other
  locking primitives.  Because rmlocks track readers the assertions are
  always fully accurate unlike rw_assert() and sx_assert().
- Flesh out the lock class methods for rmlocks to support sleeping via
  condvars and rm_sleep() (but only while holding write locks), rmlock
  details in 'show lock' in DDB, and the lc_owner method used by
  dtrace.
- Add an internal destroyed cookie so that API functions can assert
  that an rmlock is not destroyed.
- Make use of rm_assert() to add various assertions to the API (e.g.
  to assert locks are held when an unlock routine is called).
- Give RM_SLEEPABLE locks their own lock class and always use the
  rmlock's own lock_object with WITNESS.
- Use THREAD_NO_SLEEPING() / THREAD_SLEEPING_OK() to disallow sleeping
  while holding a read lock on an rmlock.

Submitted by:	andre
Obtained from:	EMC/Isilon
2013-06-25 18:44:15 +00:00
Xin LI
40670f19e2 Remove vfs_mount(9), it have been died since 2004.
Noticed by:	git via alfred
MFC after:	2 weeks
2013-06-17 03:32:27 +00:00
Gleb Smirnoff
4e76af6a41 Merge from projects/counters: counter(9).
Introduce counter(9) API, that implements fast and raceless counters,
provided (but not limited to) for gathering of statistical data.

See http://lists.freebsd.org/pipermail/freebsd-arch/2013-April/014204.html
for more details.

In collaboration with:	kib
Reviewed by:		luigi
Tested by:		ae, ray
Sponsored by:		Nginx, Inc.
2013-04-08 19:40:53 +00:00
Davide Italiano
bf1fc2c2e1 MFcalloutng:
Dcoument the new functions added to condvar(9), sleep(9), sleepqueue(9)
KPIs. Also document recent changes in timeout(9) and eventtimers(4).
2013-03-04 19:10:39 +00:00
Kevin Lo
aef49b2b1a Document pffinddomain().
Reviewed by:	glebius
2012-12-07 02:29:32 +00:00
Edward Tomasz Napierala
207c7ec842 Document disk_resize(9). 2012-10-30 13:05:50 +00:00
Konstantin Belousov
5050aa86cf Remove the support for using non-mpsafe filesystem modules.
In particular, do not lock Giant conditionally when calling into the
filesystem module, remove the VFS_LOCK_GIANT() and related
macros. Stop handling buffers belonging to non-mpsafe filesystems.

The VFS_VERSION is bumped to indicate the interface change which does
not result in the interface signatures changes.

Conducted and reviewed by:	attilio
Tested by:	pho
2012-10-22 17:50:54 +00:00
John Baldwin
f2560cec70 Add a manpage for BUS_CHILD_DETACHED(). 2012-08-21 18:41:38 +00:00
John Baldwin
6f7d0018b0 Add a BUS_CHILD_DELETED() method that a bus can hook to allow it to cleanup
any bus-specific state (such as ivars) when a child device is deleted.

Requested by:	kan
MFC after:	1 month
2012-08-21 18:13:09 +00:00
John Baldwin
988a1851d7 Document DRIVER_MODULE_ORDERED, EARLY_DRIVER_MODULE, and
EARLY_DRIVER_MODULE_ORDERED.
2012-08-21 17:58:39 +00:00
Sergey Kandaurov
eb55f31beb Document swi_remove(9).
Reviewed by:	jhb
MFC after:	1 week
2012-04-19 15:29:09 +00:00
Alexander V. Chernikov
b25711e6b0 - Add knlist_init_rw_reader() function to kqueue(9).
Function acquired reader lock if needed.
Assert check for reader or writer lock (RA_LOCKED / RA_UNLOCKED)
- While here, add knlist_init_mtx.9 to MLINKS and fix some style(9) issues

Reviewed by:    glebius
Approved by:    ae(mentor)

MFC after:      2 weeks
2012-03-26 09:34:17 +00:00
John Baldwin
68bf97175d Document pci_find_extcap() and pci_find_htcap(). 2012-03-04 18:55:33 +00:00
John Baldwin
855ed4c598 Expand and reorganize the pci(9) manpage a bit:
- Document the following routines: pci_alloc_msi(), pci_alloc_msix(),
  pci_find_cap(), pci_get_max_read_req(), pci_get_vpd_ident(),
  pci_get_vpd_readonly(), pci_msi_count(), pci_msix_count(),
  pci_pending_msix(), pci_release_msi(),  pci_remap_msix(), and
  pci_set_max_read_req().
- Group the functions into five sub-sections: raw configuration access,
  locating devices, device information, device configuration, and
  message signaled interrupts.
- Discourage use of pci_disable_io() and pci_enable_io() in device drivers.
  The PCI bus driver handles this automatically as resources are activated.

MFC after:	2 weeks
2012-03-03 14:23:54 +00:00
John Baldwin
9415d1e0ac Add pci_save_state() and pci_restore_state() wrappers around
pci_cfg_save() and pci_cfg_restore() for device drivers to use when
saving and restoring state (e.g. to handle device-specific resets).

Reviewed by:	imp
MFC after:	2 weeks
2012-03-01 20:20:55 +00:00
Christian Brueffer
6bdc1841a9 Catch up with r195837 (2.5 years ago) which renamed net_add_domain() to domain_add().
PR:		165424
Submitted by:	Lachlan Kang
MFC after:	1 week
2012-02-23 17:47:19 +00:00
Christian Brueffer
35f8bc5f64 Manpages for the buf_ring and drbr interfaces.
Submitted by:	kmacy (aeons ago)
MFC after:	1 week
2012-01-30 21:02:25 +00:00
Ed Schouten
194cef3114 Fix sloppyness in memcchr() man page.
I was considering adding it to libc as well, but last minute I thought
it would be good enough to add it to libkern exclusively. I forgot to
rename the man page and hook it up.
2012-01-01 20:59:42 +00:00
Alexander Motin
f42acd0f79 Add eventtimers(9) man page, describing related KPIs.
Sponsored by:	iXsystems, Inc.
MFC after:	1 month
2011-12-20 11:40:22 +00:00
John Baldwin
a7f5f7948b Add a TASK_INITIALIZER() macro that can be used to statically
initialize a task structure.

Reviewed by:	gj
MFC after:	2 weeks
2011-12-19 18:55:13 +00:00
John Baldwin
fb680e16f4 Add a helper API to allow in-kernel code to map portions of shared memory
objects created by shm_open(2) into the kernel's address space.  This
provides a convenient way for creating shared memory buffers between
userland and the kernel without requiring custom character devices.
2011-12-14 22:22:19 +00:00
Gleb Smirnoff
c62cf1f7fe More MLINKS for rtalloc.9 2011-12-14 14:55:19 +00:00
Marius Strobl
d7ecd801ed As it turns out, r186347 actually is insufficient to avoid the use of the
curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style
curthread implementation on sparc64, crashing the kernel in its early
cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the
things we need for that, which leads to a chicken-and-egg problem). What
happens is that due to the fact that the idea of r210623 actually is to
allow the compiler to cache invocations of curthread, it factors out
obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to
before the branch based on kobj_mutex_inited when compiling the kernel
without the debugging options. So change kobj_class_compile_static(9)
to just never acquire kobj_mtx, effectively restricting it to its
documented use, and add a kobj_init_static(9) for initializing objects
using a class compiled with the former and that also avoids using mutex(9)
(and malloc(9)). Also assert in both of these functions that they are
used in their intended way only.
While at it, inline kobj_register_method() and kobj_unregister_method()
as there wasn't much point for factoring them out in the first place
and so that a reader of the code has to figure out the locking for
fewer functions missing a KOBJ_ASSERT.
Tested on powerpc{,64} by andreast.

Reviewed by:	nwhitehorn (earlier version), jhb
MFC after:	3 days
2011-11-15 20:11:03 +00:00
Dag-Erling Smørgrav
4c7ad48309 Mention tdsignal(9).
MFC after:	1 week
2011-10-07 22:14:18 +00:00
Lawrence Stewart
f772f9fe43 Rename the cc.4 and cc.9 modular congestion control related man pages to
mod_cc.4 and mod_cc.9 respectively to avoid any possible confusion with the cc.1
gcc man page. Update references to these man pages where required.

Requested by:	Grenville Armitage
Approved by:	re (kib)
MFC after:	3 days
2011-09-15 12:15:36 +00:00
Konstantin Belousov
43fae19e34 Document vm_page_aflag_set(9), vm_page_aflag_clear(9) and vm_page_reference(9).
Retire vm_page_flag_set() and vm_page_flag_clear() functions.

Reviewed by:	alc
Approved by:	re (bz)
2011-09-06 10:40:21 +00:00
Christian Brueffer
04114c5ee3 Remove information and MLINK for MULTI_DRIVER_MODULE().
The macro was removed in r121129 almost 8 years ago.

PR:		150244
Submitted by:	Gireesh Nagabhushana <dngireesh@avrita.com>
Approved by:	re (kib)
2011-08-27 22:08:01 +00:00
Attilio Rao
1c93fd20a0 Fix an error in the generation of the manpage after r225177.
Sponsored by:	Sandvine Incorporated
Submitted by:	jkim
Approved by:	re (bz)
MFC after:	3 weeks
X-MFC:		r225177
2011-08-25 17:42:27 +00:00
Attilio Rao
6aba400a70 Fix a deficiency in the selinfo interface:
If a selinfo object is recorded (via selrecord()) and then it is
quickly destroyed, with the waiters missing the opportunity to awake,
at the next iteration they will find the selinfo object destroyed,
causing a PF#.

That happens because the selinfo interface has no way to drain the
waiters before to destroy the registered selinfo object. Also this
race is quite rare to get in practice, because it would require a
selrecord(), a poll request by another thread and a quick destruction
of the selrecord()'ed selinfo object.

Fix this by adding the seldrain() routine which should be called
before to destroy the selinfo objects (in order to avoid such case),
and fix the present cases where it might have already been called.
Sometimes, the context is safe enough to prevent this type of race,
like it happens in device drivers which installs selinfo objects on
poll callbacks. There, the destruction of the selinfo object happens
at driver detach time, when all the filedescriptors should be already
closed, thus there cannot be a race.
For this case, mfi(4) device driver can be set as an example, as it
implements a full correct logic for preventing this from happening.

Sponsored by:	Sandvine Incorporated
Reported by:	rstone
Tested by:	pluknet
Reviewed by:	jhb, kib
Approved by:	re (bz)
MFC after:	3 weeks
2011-08-25 15:51:54 +00:00
Alan Cox
1794df1f44 vm_map_clean() was long ago renamed to vm_map_sync(). Also, it no longer
acquires Giant.

MFC after:	1 week
2011-07-09 19:05:28 +00:00
Alan Cox
fdbf90bc50 Remove manual pages for functions that no longer exist.
MFC after:	1 week
2011-07-09 18:05:27 +00:00
Konstantin Belousov
6847f7cfb3 Document copyin_nofault, copyout_nofault, uiomove_nofault.
Submitted by:	alc
2011-07-09 15:24:12 +00:00
Bjoern A. Zeeb
930c182a06 Install symlinks for m_tag_* mbuf tag functions to the mbuf_tags.9 man page.
MFC after:	1 week
2011-06-18 13:08:46 +00:00
Andrey V. Elsukov
35bb01624e Add make_dev_alias_p to MLINKS.
Pointed out by:	pjd
MFC after:	2 weeks
2011-05-05 14:13:08 +00:00
John Baldwin
85ee63c923 Add a new bus method, BUS_ADJUST_RESOURCE() that is intended to be a
wrapper around rman_adjust_resource().  Include a generic implementation,
bus_generic_adjust_resource() which passes the request up to the parent
bus.  There is currently no default implementation.  A
bus_adjust_resource() wrapper is provided for use in drivers.
2011-04-29 21:36:45 +00:00
John Baldwin
bb82622c3e Extend the rman(9) API to support altering an existing resource.
Specifically, these changes allow a resource to back a relocatable and
resizable resource such as the I/O window decoders in PCI-PCI bridges.
- rman_adjust_resource() can adjust the start and end address of an
  existing resource.  It only succeeds if the newly requested address
  space is already free.  It also supports shrinking a resource in
  which case the freed space will be marked unallocated in the rman.
- rman_first_free_region() and rman_last_free_region() return the
  start and end addresses for the first or last unallocated region in
  an rman, respectively.  This can be used to determine by how much
  the resource backing an rman must be adjusted to accomodate an
  allocation request that does not fit into the existing rman.

While here, document the rm_start and rm_end fields in struct rman,
rman_is_region_manager(), the bound argument to
rman_reserve_resource_bound(), and rman_init_from_resource().
2011-04-29 20:05:19 +00:00
Dag-Erling Smørgrav
5d80bf64c1 Rename alloc_unr(9) to unr(9) and adjust the links accordingly.
MFC after:	3 weeks
2011-04-27 01:10:15 +00:00