Commit Graph

2281 Commits

Author SHA1 Message Date
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
Alexander V. Chernikov
4dab1a18a3 Make PFIL use per-VNET lock instead of per-AF lock. Since most used packet
filters (ipfw and PF) use the same ruleset with the same lock for both
AF_INET and AF_INET6 there is no need in more fine-grade locking.
However, it is possible to request personal lock by specifying
PFIL_FLAG_PRIVATE_LOCK flag in pfil_head structure (see pfil.9 for
more details).

Export PFIL lock via rw_lock(9)/rm_lock(9)-like API permitting pfil consumers
to use this lock instead of own lock. This help reducing locks on main
traffic path.

pfil_assert() is currently not implemented due to absense of rm_assert().
Waiting for some kind of r234648 to be merged in HEAD.

This change is part of bigger patch reducing routing locking.

Sponsored by:	Yandex LLC
Reviewed by:	glebius, ae
OK'd by:	silence on net@
MFC after:	3 weeks
2012-10-22 14:10:17 +00:00
Kevin Lo
61ec8e057f Since the moduledata structure member priv is a void pointer, using
NULL instead of 0 when dealing with pointers.
2012-10-12 01:31:02 +00:00
Kevin Lo
9823d52705 Revert previous commit...
Pointyhat to:	kevlo (myself)
2012-10-10 08:36:38 +00:00
Kevin Lo
a10cee30c9 Prefer NULL over 0 for pointers 2012-10-09 08:27:40 +00:00
Gleb Smirnoff
21d172a3f1 A step in resolving mess with byte ordering for AF_INET. After this change:
- All packets in NETISR_IP queue are in net byte order.
  - ip_input() is entered in net byte order and converts packet
    to host byte order right _after_ processing pfil(9) hooks.
  - ip_output() is entered in host byte order and converts packet
    to net byte order right _before_ processing pfil(9) hooks.
  - ip_fragment() accepts and emits packet in net byte order.
  - ip_forward(), ip_mloopback() use host byte order (untouched actually).
  - ip_fastforward() no longer modifies packet at all (except ip_ttl).
  - Swapping of byte order there and back removed from the following modules:
    pf(4), ipfw(4), enc(4), if_bridge(4).
  - Swapping of byte order added to ipfilter(4), based on __FreeBSD_version
  - __FreeBSD_version bumped.
  - pfil(9) manual page updated.

Reviewed by:	ray, luigi, eri, melifaro
Tested by:	glebius (LE), ray (BE)
2012-10-06 10:02:11 +00:00
Joel Dahl
2ccfa03129 mdoc: remove superfluous paragraph macro. 2012-09-30 07:51:57 +00:00
Gleb Smirnoff
063efed28c The drbr(9) API appeared to be so unclear, that most drivers in
tree used it incorrectly, which lead to inaccurate overrated
if_obytes accounting. The drbr(9) used to update ifnet stats on
drbr_enqueue(), which is not accurate since enqueuing doesn't
imply successful processing by driver. Dequeuing neither mean
that. Most drivers also called drbr_stats_update() which did
accounting again, leading to doubled if_obytes statistics. And
in case of severe transmitting, when a packet could be several
times enqueued and dequeued it could have been accounted several
times.

o Thus, make drbr(9) API thinner. Now drbr(9) merely chooses between
  ALTQ queueing or buf_ring(9) queueing.
  - It doesn't touch the buf_ring stats any more.
  - It doesn't touch ifnet stats anymore.
  - drbr_stats_update() no longer exists.

o buf_ring(9) handles its stats itself:
  - It handles br_drops itself.
  - br_prod_bytes stats are dropped. Rationale: no one ever
    reads them but update of a common counter on every packet
    negatively affects performance due to excessive cache
    invalidation.
  - buf_ring_enqueue_bytes() reduced to buf_ring_enqueue(), since
    we no longer account bytes.

o Drivers handle their stats theirselves: if_obytes, if_omcasts.

o mlx4(4), igb(4), em(4), vxge(4), oce(4) and  ixv(4) no longer
  use drbr_stats_update(), and update ifnet stats theirselves.

o bxe(4) was the most correct driver, it didn't call
  drbr_stats_update(), thus it was the only driver accurate under
  moderate load. Now it also maintains stats itself.

o ixgbe(4) had already taken stats from hardware, so just
  - drop software stats updating.
  - take multicast packet count from hardware as well.

o mxge(4) just no longer needs NO_SLOW_STATS define.

o cxgb(4), cxgbe(4) need no change, since they obtain stats
  from hardware.

Reviewed by:	jfv, gnn
2012-09-28 18:28:27 +00:00
Kevin Lo
201e2cd64b Remove references to brelse and bremfree, which don't actually exist. 2012-09-20 07:07:35 +00:00
Joel Dahl
9f668383b7 Remove trailing whitespace. 2012-09-16 21:17:28 +00:00
Alexander V. Chernikov
54202ab3d1 Add section describing existing filtering points.
Document byteorder behavior in AF_INET[6] hooks in new section.

MFC after:	2 weeks
2012-09-16 13:13:02 +00:00
Kevin Lo
c25372b320 Add references to VFS_SET(9) and VOP_VPTOFH(9) 2012-09-12 03:39:32 +00:00
Gleb Smirnoff
62208ca5d2 - Move jenkins.h to jenkins_hash.c
- Provide missing function that can do hashing of arbitrary sized buffer.
- Refetch lookup3.c and do only minimal edits to it, so that diff between
  our jenkins_hash.c and lookup3.c is minimal.
- Add declarations for jenkins_hash(), jenkins_hash32() to sys/hash.h.
- Document these functions in hash(9)

Obtained from:	http://burtleburtle.net/bob/c/lookup3.c
2012-09-04 12:07:33 +00:00
John Baldwin
28b5187f44 Clarify that bus_dma does not stall future load requests once a load is
deferred.  The caller is required to enforce that if that is desired.

MFC after:	2 weeks
2012-08-30 14:44:30 +00:00
Sergey Kandaurov
f2fbdacbf8 Remove a duplicated "thread". 2012-08-30 11:52:26 +00:00
Sergey Kandaurov
08783659c5 Follow r239818 and remove no more relevant vslock() ENOMEM error.
Reviewed by:	zont
MFC after:	2 weeks
2012-08-29 13:00:00 +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
Hans Petter Selasky
07da61a6cc Streamline use of cdevpriv and correct some corner cases.
1) It is not useful to call "devfs_clear_cdevpriv()" from
"d_close" callbacks, hence for example read, write, ioctl and
so on might be sleeping at the time of "d_close" being called
and then then freed private data can still be accessed.
Examples: dtrace, linux_compat, ksyms (all fixed by this patch)

2) In sys/dev/drm* there are some cases in which memory will
be freed twice, if open fails, first by code in the open
routine, secondly by the cdevpriv destructor. Move registration
of the cdevpriv to the end of the drm open routines.

3) devfs_clear_cdevpriv() is not called if the "d_open" callback
registered cdevpriv data and the "d_open" callback function
returned an error. Fix this.

Discussed with:	phk
MFC after:	2 weeks
2012-08-15 16:19:39 +00:00
Kevin Lo
d14fdb79fe Put parenthesis around sizeof args. 2012-07-17 02:05:39 +00:00
Gleb Smirnoff
d8115a8690 Document RO_RTFREE() macro. 2012-07-04 07:42:12 +00:00
Jens Schweikhardt
b21a8885cf Correct a grammo. 2012-07-01 19:40:51 +00:00
Julian Elischer
2139f5e0df Try clean up some of my original text and neaten a table.
MFC after:	1 week
2012-06-27 01:13:37 +00:00
Kenneth D. Merry
c3fb2891f0 Fix a bug which causes a panic in daopen(). The panic is caused by
a da(4) instance going away while GEOM is still probing it.

In this case, the GEOM disk class instance has been created by
disk_create(), and the taste of the disk is queued in the GEOM
event queue.

While that event is queued, the da(4) instance goes away.  When the
open call comes into the da(4) driver, it dereferences the freed
(but non-NULL) peripheral pointer provided by GEOM, which results
in a panic.

The solution is to add a callback to the GEOM disk code that is
called when all of its resources are cleaned up.  This is
implemented inside GEOM by adding an optional callback that is
called when all consumers have detached from a provider, and the
provider is about to be deleted.

scsi_cd.c,
scsi_da.c:	In the register routine for the cd(4) and da(4)
		routines, acquire a reference to the CAM peripheral
		instance just before we call disk_create().

		Use the new GEOM disk d_gone() callback to register
		a callback (dadiskgonecb()/cddiskgonecb()) that
		decrements the peripheral reference count once GEOM
		has finished cleaning up its resources.

		In the cd(4) driver, clean up open and close
		behavior slightly.  GEOM makes sure we only get one
		open() and one close call, so there is no need to
		set an open flag and decrement the reference count
		if we are not the first open.

		In the cd(4) driver, use cam_periph_release_locked()
		in a couple of error scenarios to avoid extra mutex
		calls.

geom.h:		Add a new, optional, providergone callback that
		is called when a provider is about to be deleted.

geom_disk.h:	Add a new d_gone() callback to the GEOM disk
		interface.

		Bump the DISK_VERSION to version 2.  This probably
		should have been done after a couple of previous
		changes, especially the addition of the d_getattr()
		callback.

geom_disk.c:	Add a providergone callback for the disk class,
		g_disk_providergone(), that calls the user's
		d_gone() callback if it exists.

		Bump the DISK_VERSION to 2.

geom_subr.c:	In g_destroy_provider(), call the providergone
		callback if it has been provided.

		In g_new_geomf(), propagate the class's
		providergone callback to the new geom instance.

blkfront.c:	Callers of disk_create() are supposed to pass in
		DISK_VERSION, not an explicit disk API version
		number.  Update the blkfront driver to do that.

disk.9:		Update the disk(9) man page to include information
		on the new d_gone() callback, as well as the
		previously added d_getattr() callback, d_descr
		field, and HBA PCI ID fields.

MFC after:	5 days
2012-06-24 04:29:03 +00:00
John Baldwin
8403b19372 Several updates:
- Consistently refer to rmlocks as "read-mostly locks".
- Relate rmlocks to rwlocks rather than sx locks since they are closer to
  rwlocks.
- Add a separate paragraph on sleepable read-mostly locks contrasting them
  with "normal" read-mostly locks.
- The flag passed to rm_init_flags() to enable recursion for readers is
  RM_RECURSE, not LO_RECURSABLE.
- Fix the description for RM_RECURSE (it allows readers to recurse, not
  writers).
- Explicitly note that rm_try_rlock() honors RM_RECURSE.
- Fix some minor grammar nits.
2012-06-08 21:30:35 +00:00
John Baldwin
3d2a7480b3 Use the defined terms "readers" and "writers" to simplify some text. 2012-06-06 13:35:30 +00:00
Edward Tomasz Napierala
18183ca93f Fix lock interaction table for rmlocks - by default they cannot sleep,
just like rwlocks.

MFC after:	1 week
2012-05-29 14:41:16 +00:00
Alexander V. Chernikov
6c74ff0ea6 Fix panic on attaching to non-existent interface (introduced by r233937, pointed by hrs@)
Fix panic on tcpdump being attached to interface being removed (introduced by r233937, pointed by hrs@ and adrian@)
Protect most of bpf_setf() by BPF global lock

Add several forgotten assertions (thanks to adrian@)

Document current locking model inside bpf.c
Document EVENTHANDLER(9) usage inside BPF.

Approved by:       kib(mentor)
Tested by:         gnn
MFC in:            4 weeks
2012-05-21 22:13:48 +00:00
Glen Barber
73bbeaa529 Typo and mdoc(7) style fixes.
PR:		168117
Submitted by:	Nobuyuki Koganemaru (kogane&jp!freebsd!org)
MFC after:	3 days
2012-05-20 16:43:47 +00:00
Glen Barber
f32235d532 Remove leading .Ns macro to silence mdoc(7) warning. 2012-05-12 20:53:00 +00:00
Glen Barber
ecb0bac9ab mdoc(7) markup cleanup. 2012-05-12 20:46:19 +00:00
Glen Barber
e525498959 Fix mdoc(7) markup. 2012-05-12 20:41:40 +00:00
Glen Barber
9255dffde1 Set formatting width and offset in DB_COMMAND(9). 2012-05-12 20:08:16 +00:00
Glen Barber
437f059811 Fix an mdoc(7) nit. 2012-05-12 20:06:17 +00:00
Glen Barber
0dded3391e Remove duplicate words in mdoc(7) pages.
PR:		167810
Submitted by:	Bryan Drewery {bryan!shatow%net} (hackers lounge)
Found with:	textproc/igor
MFC after:	3 days
2012-05-12 03:46:43 +00:00
Sergey Kandaurov
52116a1cb9 - Update the rest of struct ithd references.
- net_ih and softclock_ih cookies have gone away.

MFC after:	1 week
2012-04-19 16:13:15 +00:00
Sergey Kandaurov
eb55f31beb Document swi_remove(9).
Reviewed by:	jhb
MFC after:	1 week
2012-04-19 15:29:09 +00:00
Sergey Kandaurov
4b47ece986 Update the swi_add prototype after struct ithd was split up into
struct intr_event and struct intr_thread.

PR:		docs/166864
Reviewed by:	jhb (older version)
MFC after:	1 week
2012-04-12 16:02:45 +00:00
Joel Dahl
9b86e50de6 Remove end of line whitespace. 2012-03-31 07:10:16 +00:00
Joel Dahl
4008d26a11 Fix typo from last commit.
Noticed by:	brueffer
2012-03-29 20:55:45 +00:00
Joel Dahl
10b4d262da Remove unnecessary Xo/Xc.
Reviewed by:	brueffer
2012-03-29 20:23:35 +00:00
Eitan Adler
50d675f7a9 Remove trailing whitespace per mdoc lint warning
Disussed with:	gavin
No objection from:	doc
Approved by:	joel
MFC after:	3 days
2012-03-29 05:02:12 +00:00
Joel Dahl
c2965cd185 mdoc: terminate quoted strings.
Reviewed by:	brueffer
2012-03-26 15:18:14 +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
Joel Dahl
3030137a23 Remove superfluous paragraph macro. 2012-03-24 13:37:57 +00:00
Sergey Kandaurov
19d3a14cde Expand contraction.
Spotted by:	bjk
2012-03-23 16:24:07 +00:00
Sergey Kandaurov
7ddc82cc53 Update IFCAP_* macro descriptions.
Reviewed by:	attilio (polling part, a previous version)
MFC after:	1 week
2012-03-23 10:39:50 +00:00
Sergey Kandaurov
b5c871bfe5 Clean up from the old kern.polling.
Reviewed by:	attilio
MFC after:	1 week
2012-03-23 10:33:24 +00:00
Sergey Kandaurov
e8809d66d1 Document IFT_USB referenced by IFF_CANTCONFIG since the previous change,
so that ifnet(9) is self contained.

MFC after:	1 week
2012-03-23 06:06:37 +00:00
Sergey Kandaurov
dac61c3d62 Update IFF_* macro descriptions.
MFC after:	1 week
2012-03-23 06:01:16 +00:00
Sergey Kandaurov
8a9b1b14f6 Update the list of struct ifnet fields.
- Document if_vnet, if_home_vnet, if_carp, if_vlantrunk, if_multiaddrs,
  if_amcount, if_addr, if_llsoftc stub, if_broadcastaddr, if_bridge,
  if_label, if_afdata, if_afdata_initialized, if_afdata_lock, if_linktask,
  if_addr_mtx (now if_addr_lock), if_clones, if_groups, if_pf_kif, if_lagg,
  if_alloctype
- G/c now defunct and/or commented out in the manual page if_ipending,
  if_poll_slowq, if_done, if_poll_recv, if_poll_xmit, if_poll_slowinput,
  if_poll_intren
- Update if_snd type changed with ALTQ integration.

MFC after:	1 week
2012-03-20 16:56:35 +00:00
Sergey Kandaurov
c46ad71972 Move struct if_data basic description to a more suitable place, and remove
a bit of .Bx 4.4 history.

MFC after:	1 week
2012-03-07 14:53:53 +00:00
Maxim Konovalov
92bf2c1bc3 o Sync LOCK_PROFILING manpage with the current code: remove
unexistent sysctls, add new ones.

Reviewed by:	gjb
Sponsored by:	Nginx, Inc.
2012-03-07 14:50:14 +00:00
Sergey Kandaurov
3f978c3537 Reflect that if_output changed to take a struct route as its fourth
argument (r191148).

MFC after:	1 week
2012-03-07 11:29:43 +00:00
Sergey Kandaurov
c469a8f18f Update ifa_rtrequest() description after post-4.4BSD change made in r85074.
3rd argument of ifa->ifa_rtrequest is now ``rt_addrinfo *'' instead of
``sockaddr *''. While here, un-document RTM_RESOLVE cmd argument for
ifa_rtrequest() that became a stub after separating L2 tables in r186119.

MFC after:	1 week
2012-03-07 09:42:19 +00:00
Sergey Kandaurov
5aa77f88ec Remove if_watchdog remnants after if_timer/if_watchdog removal in r199975.
This part was missed in r199992.

MFC after:	1 week
2012-03-06 12:20:37 +00:00
Sergey Kandaurov
8b7b8e14a8 Fix a typo: use lower case in "A Shorthand".
Noted by:	maxim
2012-03-06 09:57:50 +00:00
Sergey Kandaurov
4f0ab9dc95 Kill EoL whitespaces. 2012-03-06 09:40:34 +00:00
Sergey Kandaurov
40b39918be The missing part of r232588 that documents ifaddr_byindex() itself.
MFC after:	1 week
2012-03-06 09:04:53 +00:00
Sergey Kandaurov
2abee21cd7 - ifnet_addrs has gone and replaced by ifaddr_byindex(), as per r83130
- access to the AF_LINK address through if_addrhead is deprecated (r128315)

MFC after:	1 week
2012-03-06 08:59:42 +00:00
Sergey Kandaurov
dfef665819 Actually bump date, sigh. 2012-03-05 20:04:28 +00:00
John Baldwin
281a359e83 Fix three instances of a missing word.
Submitted by:	bjk
2012-03-05 19:38:59 +00:00
Sergey Kandaurov
642c499386 Fix typo. Bump .Dd for the previous change. 2012-03-05 17:38:44 +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
Sergey Kandaurov
c136083e86 Reflect the renaming of ifmaof_ifpforaddr() to if_findmulti() in r148652.
MFC after:	1 week
2012-03-02 09:52:42 +00:00
Sergey Kandaurov
1e0f75d313 ifp->if_ioctl() has moved to u_long cmd in r36735.
Somehow that change had not reached here together with ifioctl().

MFC after:	1 week
2012-03-02 09:30:54 +00:00
John Baldwin
adb6390718 Update the documentation on pci_get/set_powerstate(). These methods are
not ACPI-specific at all, but deal with PCI power states.  Also,
pci_set_powerstate() fails with EOPNOTSUPP if a request is made that the
underlying device does not support rather than falling back to somehow
setting D0.
2012-03-01 20:36:50 +00:00
John Baldwin
0a9c80e520 Sort function prototypes. 2012-03-01 20:32:02 +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
John Baldwin
5c8d3de02b Update for adjusted types for boundary arguments in 232356. 2012-03-01 20:19:21 +00:00
Jaakko Heinonen
8bffca5eb2 Since r199137 namei() returns EINVAL for DELETE and RENAME operations if
the last component of the pathname is ".".

Reviewed by:	kib
MFC after:	1 week
2012-03-01 18:17:45 +00:00
Sergey Kandaurov
40d5e8a628 Changes in ifaddr refcounting: ifa_refcnt IFAREF/IFAFREE macros
moved to ifa_ref()/ifa_free() refcounting functions.

MFC after:	1 week
2012-03-01 12:52:14 +00:00
Sergey Kandaurov
8963e1b501 Refine r232333 [1] and put note about ifnet refcount caller responsibility.
Spotted by:	gavin [1]
MFC after:	1 week
2012-03-01 12:30:57 +00:00
Sergey Kandaurov
1c6fed25bb Reflect that ifa_ifwithnet() gained ignore_ptp argument.
MFC after:	1 week
2012-03-01 12:16:00 +00:00
Sergey Kandaurov
86d2665cdb Document ifunit_ref function.
MFC after:	1 week
2012-03-01 12:03:52 +00:00
Sergey Kandaurov
89eb4374e3 Document ifnet refcount.
MFC after:	1 week
2012-03-01 11:03:39 +00:00
Andrew Thompson
6b9597aac4 Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
system tunable has never been implemented. This flag is only used by sysctl(8)
to provide a helpful error message.

Discussed with:	dwhite, kan
2012-02-29 22:41:40 +00:00
Kevin Lo
9aae28359d Fix typos 2012-02-28 15:07:05 +00:00
Glen Barber
3102cfe2e2 Fix various typos in manual pages.
Submitted by:	amdmi3
PR:		165431
MFC after:	1 week
2012-02-25 14:31:25 +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
Ed Schouten
6b99842ada Globally replace u_int*_t from (non-contributed) man pages.
The reasoning behind this, is that if we are consistent in our
documentation about the uint*_t stuff, people will be less tempted to
write new code that uses the non-standard types.

I am not going to bump the man page dates, as these changes can be
considered style nits. The meaning of the man pages is unaffected.

MFC after:	1 month
2012-02-12 18:29:56 +00:00
Ed Schouten
b5d1ccb470 Remove outdated piece of information.
devtoname() always returns a pathname to the device. It will never
return a #major/minor string.

MFC after:	2 weeks
2012-02-10 11:20:13 +00:00
Glen Barber
814b16ba92 Fix some Xr references:
- ada(4): ad(4) - removed, ada(4) would be a self-referencing entry
- cd(4): ad(4) -> ada(4)
- da(4): ad(4) -> ada(4)
- DEVICE_PROBE(9):  ugen(5) -> ugen(4)
- ed(4): dhclinet(8) -> dhclient(8) (typo)
- lmc(4): Netgraph(4) -> netgraph(4)
- security(7): rc.conf(8) -> rc.conf(5)
- sfxge(4): cpuset(8) -> cpuset(1)
- sbp(4): sysctl(1) -> sysctl(8)
- portindex(5): build(1) -> build(7)
- u3g(4): usbconfig(5) -> usbconfig(8)
- usb_quirk(4): usbconfig(5) -> usbconfig(8)

Found with:	textproc/igor
MFC after:	3 days
2012-02-09 04:37:30 +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
Kip Macy
c3bd46fe5b update .Dd 2012-01-28 23:30:39 +00:00
Kip Macy
e013216e41 alphabetically sort optional flags and add documentation for VM_ALLOC_NODUMP 2012-01-28 17:27:58 +00:00
Kip Macy
986e5ec7af document M_NODUMP flag 2012-01-28 17:21:12 +00:00
Gleb Smirnoff
2930db16a0 List supported ioctl commands instead of old one. 2012-01-26 11:08:55 +00:00
Ed Schouten
5dc6c3a38a Remove remnants of dev_t.
These functions take a `struct cdev *' -- not a dev_t. Inside the
kernel, dev_t has the same use as in userspace, namely to store a device
identifier.

MFC after:	2 weeks
2012-01-19 09:51:07 +00:00
Kevin Lo
1dc8fb4d77 NOOBJ is long time dead
Reviewed by:	kib
2012-01-18 02:29:11 +00:00
Kevin Lo
0ad9a4f449 vfs_object_create() function is obsolete. Use vnode_create_vobject()
to create the backing object.

Reviewed by:	kib
2012-01-18 02:27:09 +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
Ed Schouten
a4ec012311 Fix typo; return -> returns. 2012-01-01 20:30:48 +00:00
Ed Schouten
de85bfc508 Introducing memcchr(3).
It seems two of the file system drivers we have in the tree, namely ufs
and ext3, use a function called `skpc()'. The meaning of this function
does not seem to be documented in FreeBSD, but it turns out one needs to
be a VAX programmer to understand what it does.

SPKC is an instruction on the VAX that does the opposite of memchr(). It
searches for the non-equal character. Add a new function called
memcchr() to the tree that has the following advantages over skpc():

- It has a name that makes more sense than skpc(). Just like strcspn()
  matches the complement of strspn(), memcchr() is the complement of
  memchr().

- It is faster than skpc(). Similar to our strlen() in libc, it compares
  entire words, instead of single bytes. It seems that for this routine
  this yields a sixfold performance increase on amd64.

- It has a man page.
2012-01-01 20:26:11 +00:00
Jaakko Heinonen
c5a0813d43 Follow style(9) more closely in the example. 2011-12-21 17:03:30 +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
Ruslan Ermilov
e9a2004460 Fixed some of markup.
Reviewed by:	jhb
2011-12-17 06:57:35 +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
Gleb Smirnoff
9aa3cab968 Update this page to describe modern interfaces. 2011-12-14 14:52:50 +00:00
Jaakko Heinonen
569dd0f3be sbuf_data() hasn't returned NULL for overflowed buffers since r71721. 2011-12-09 13:28:41 +00:00
Jaakko Heinonen
c0825cd535 - Fix markup.
- Remove trailing whitespace.
2011-12-09 13:15:19 +00:00
Marius Strobl
788a85e884 - Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t'
and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from
  device drivers.
- Update the example in driver.9 to use DEVMETHOD_END.

Submitted by:	jhb
MFC after:	3 days
2011-11-22 19:31:43 +00:00
Konstantin Belousov
46154a3b3b Update the manpage for r227697.
MFC after:	3 weeks
2011-11-19 07:52:39 +00:00
Pawel Jakub Dawidek
d576deedb5 Constify arguments for locking KPIs where possible.
This enables locking consumers to pass their own structures around as const and
be able to assert locks embedded into those structures.

Reviewed by:	ed, kib, jhb
2011-11-16 21:51:17 +00:00
Pawel Jakub Dawidek
a20358302f Constify stack argument for functions that don't modify it.
Reviewed by:	ed, kib, jhb
2011-11-16 19:06:55 +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
John-Mark Gurney
4ce04b3d91 group functions together by function...
document knlist_delete, and better document what knlist_clear does...  Note
that both of these functions may sleep, and also unlock/relock the list
lock...

document knlist_init_mtx (forgotten by kib)...

other minor improvements

Reviewed by:	ru (previous rev)
MFC after:	1 week
2011-11-05 17:55:49 +00:00
Gleb Smirnoff
19b5c7c246 Spelling.
Submitted by:	dougb
2011-10-21 20:23:40 +00:00
Gleb Smirnoff
93ecaabdcb Note that it is still not possible to guard special kind of allocations, those
that have special relationships with uma(9). Currently only mbuf clusters.
2011-10-21 13:54:17 +00:00
Eitan Adler
36daf0495a - change "is is" to "is" or "it is"
- change "the the" to "the"

Approved by:	lstewart
Approved by:	sahil (mentor)
MFC after:	3 days
2011-10-16 14:30:28 +00:00
Gleb Smirnoff
0e775b6d17 Document that memguard(9) now can guard uma(9) allocations. 2011-10-12 18:46:48 +00:00
Dag-Erling Smørgrav
4c7ad48309 Mention tdsignal(9).
MFC after:	1 week
2011-10-07 22:14:18 +00:00
Sergey Kandaurov
06dafde167 Fix typo in OSIOCGIFADDR.
MFC after:	3 days
2011-09-27 07:05:41 +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
Adrian Chadd
d2849f27bc Ensure that ta_pending doesn't overflow u_short by capping its value at USHRT_MAX.
If it overflows before the taskqueue can run, the task will be
re-added to the taskqueue and cause a loop in the task list.

Reported by:	Arnaud Lacombe <lacombar@gmail.com>
Submitted by:	Ryan Stone <rysto32@gmail.com>
Reviewed by:	jhb
Approved by:	re (kib)
MFC after:	1 day
2011-09-15 08:42:06 +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
Konstantin Belousov
4d066e4519 Fix markup.
Approved by:	re (hrs)
2011-08-01 08:52:05 +00:00
Glen Barber
fa53ff8858 Update vfs_getopt(9) to reflect 32-bit to 64-bit change from
r224290.

PR:		159324
Submitted by:	Brandon Gooch (jamesbrandongooch % gmail ! com)
Approved by:	re (kib)
2011-07-31 21:04:47 +00:00
Alan Cox
6a34e6cea1 Remove the old vm_map_clean man page. 2011-07-09 19:09:20 +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
d5a9ee9fb0 Oops. These changes should have been included in r223891.
MFC after:	1 week
2011-07-09 18:09:57 +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
Matthew D Fleming
b5bd50ae40 Add an option to have a fail point term only execute when run by a
specified pid.  This is helpful for automated testing involving a global
knob that would otherwise be executed by many other threads.

MFC after: 1 week
2011-07-08 20:41:12 +00:00
Bjoern A. Zeeb
35fd7bc020 Add infrastructure to allow all frames/packets received on an interface
to be assigned to a non-default FIB instance.

You may need to recompile world or ports due to the change of struct ifnet.

Submitted by:	cjsp
Submitted by:	Alexander V. Chernikov (melifaro ipfw.ru)
		(original versions)
Reviewed by:	julian
Reviewed by:	Alexander V. Chernikov (melifaro ipfw.ru)
MFC after:	2 weeks
X-MFC:		use spare in struct ifnet
2011-07-03 12:22:02 +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
Bjoern A. Zeeb
dabc7ac21a Correct a typo in the function name.
MFC after:	1 week
2011-06-18 13:03:06 +00:00
Ulrich Spörlein
135bce2a9e mdoc: reorder sections consistently 2011-06-02 09:56:53 +00:00
Ruslan Ermilov
a6d11f7139 [mdoc] Fixed .Dt call. 2011-05-25 14:13:53 +00:00
Ulrich Spörlein
6e18fca127 Re-encode files from ISO-8859-1 to UTF-8 2011-05-22 14:03:30 +00:00
Poul-Henning Kamp
c920aa7a9d When adding examples to man-pages, try to make them at least
look like they might work.

Prodded by:	Vadim Goncharov
2011-05-19 13:42:19 +00:00
Poul-Henning Kamp
6ab7244a4d Try to explain what sbufs do and add an example to show it.
Clarify return values.
2011-05-17 18:24:59 +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
Andrey V. Elsukov
580a458787 Formatting fixes:
o Fix date
 o Break sentences
 o Remove trailing whitespaces
 o Sort xrefs by section number

Requested by:	ru
MFC after:	2 weeks
2011-05-05 09:55:55 +00:00
Glen Barber
c19b8489b8 Remove unneeded tab after .Ed to make manlint happy.
Reported by:	manlint
2011-05-04 18:16:05 +00:00
Andrey V. Elsukov
8137364f6e Document make_dev_alias_p().
MFC after:	2 weeks
2011-05-03 18:55:16 +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
Konstantin Belousov
c3bd10b434 Document timeout_task.
While there, fix the type of the func argument of INIT_TASK macro,
and use the modern name of the analogous facility from Linux kernel.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
2011-04-26 11:43:57 +00:00
Gleb Smirnoff
fa05d2156e It is already seven years since mbuf allocator uses same
M_WAITOK/M_NOWAIT flags as malloc(9). Update manual page.

Submitted by:	Vadim Goncharov <vadimnuclight tpu.ru>
2011-04-18 15:30:25 +00:00
Lawrence Stewart
891b8ed467 Use the full and proper company name for Swinburne University of Technology
throughout the source tree.

Requested by:	Grenville Armitage, Director of CAIA at Swinburne University of
			Technology
MFC after:	3 days
2011-04-12 08:13:18 +00:00
Andrey V. Elsukov
95d4707398 Remove duplicate sentence. 2011-03-30 11:34:40 +00:00
Jung-uk Kim
c26c38740d Fix a typo in the previous commit. AMD64 and Intel 64 are two brand names. 2011-03-15 17:59:30 +00:00
Jung-uk Kim
d8ea2a492e Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this
function is almost exclusively used for random harvesting, there is no need
for micro-optimization.  Adjust the manual page accordingly.
2011-03-15 17:14:26 +00:00
Hans Petter Selasky
1c49736857 - Add support for software pre-scaling of ISOCHRONOUS transfers.
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-02-28 17:23:15 +00:00
Lawrence Stewart
29f269dc1f Final commit to round out the "Five New TCP Congestion Control Algorithms for
FreeBSD" FreeBSD Foundation funded project.

- Add new man pages for the modular congestion control, Khelp and Hhook
  frameworks (cc.4, cc.9, khelp.9 and hhook.9).

- Add new man pages for each available congestion control algorithm (cc_chd.4,
  cc_cubic.4, cc_hd.4, cc_htcp.4, cc_newreno.4 and cc_vegas.4).

- Add a new man page for the Enhanced Round Trip Time (ERTT) Khelp module
  (h_ertt.4).

- Update the TCP (tcp.4) man page to mention the TCP_CONGESTION socket option,
  cross reference to cc.4 and remove references to the retired
  "net.inet.tcp.newreno" sysctl MIB variable.

In collaboration with:	David Hayes <dahayes at swin edu au> and
				Grenville Armitage <garmitage at swin edu au>
Sponsored by:	FreeBSD Foundation
MFC after:	3 months
2011-02-21 11:56:11 +00:00
Warner Losh
9f6985c483 Document requirement that sys/types.h be included before rman.h.
Submitted by:	Raphael Kubo da Costa
MFC after:	2 weeks
2011-02-10 04:55:51 +00:00
Matthew D Fleming
00f0e671ff Explicitly wire the user buffer rather than doing it implicitly in
sbuf_new_for_sysctl(9).  This allows using an sbuf with a SYSCTL_OUT
drain for extremely large amounts of data where the caller knows that
appropriate references are held, and sleeping is not an issue.

Inspired by:	rwatson
2011-01-27 00:34:12 +00:00
Matthew D Fleming
7c2dd57bdb Document sbuf_new_for_sysctl(9).
Pointed out by:	lstewart
2011-01-25 17:39:52 +00:00
Jaakko Heinonen
353429bfd2 Fix typos. 2011-01-22 15:19:25 +00:00
Matthew D Fleming
cbc134ad03 Introduce signed and unsigned version of CTLTYPE_QUAD, renaming
existing uses.  Rename sysctl_handle_quad() to sysctl_handle_64().
2011-01-19 23:00:25 +00:00
John-Mark Gurney
2634879bbb document that even when wakeup_one is used to wakeup, msleep and friends
may still return a non-zero value... You are not guaranteed to get a one
to one mapping between wakeup_one and zero return values...

Reviewed by:	kib
MFC after:	3 days
2011-01-19 22:16:42 +00:00
Matthew D Fleming
f8e4b4ef49 sysctl(8) should use the CTLTYPE to determine the type of data when
reading.  (This was already done for writing to a sysctl).  This
requires all SYSCTL setups to specify a type.  Most of them are now
checked at compile-time.

Remove SYSCTL_*X* sysctl additions as the print being in hex should be
controlled by the -x flag to sysctl(8).

Succested by:	bde
2011-01-19 17:04:07 +00:00
Edward Tomasz Napierala
102f2f352f Restore comment describing /* NOTREACHED */, updated to match reality. 2011-01-07 08:34:12 +00:00
John Baldwin
49fe354a54 Retire the INTR_FAST flag as it was obsoleted by the introduction of the
filter argument to bus_setup_intr().
2011-01-06 21:14:34 +00:00
Edward Tomasz Napierala
0b13dbc38b Get rid of bad advice regarding /* NOTREACHED */. Compilers don't
really need it (one can use __dead2 instead), and style(9) was not
even consistent with itself in this regard.
2011-01-06 08:33:48 +00:00
Lawrence Stewart
61f8e2a786 Fix a whitespace nit.
MFC after:	1 week
X-MFC with:	r216995
2011-01-06 04:05:25 +00:00
Lawrence Stewart
4a2b56eb8a Add a man page for the Object Specific Data (OSD) KPI.
Although not directly related the FreeBSD Foundation funded "Five New TCP
Congestion Control Algorithms for FreeBSD" project, the understanding and
inspiration required to write this documentation was significantly bolstered
by the Foundation's support.

Reviewed by:	pjd
MFC after:	1 week
2011-01-05 11:49:23 +00:00
Pawel Jakub Dawidek
24e75069cd Correct cookie type to match reality. 2010-12-19 18:07:10 +00:00
John Baldwin
c529e287e5 Add a manpage for SYSINIT() and SYSUNINIT().
PR:		docs/132884
Submitted by:	pluknet, hmp
2010-12-06 15:19:03 +00:00
Rebecca Cran
01688065e7 Document the fact that passing in a count of zero to the bus_space functions
will result in undefined behaviour.
Taken from NetBSD's bus_space(9).
2010-12-03 18:30:55 +00:00
Rebecca Cran
c90f7d9b44 Revert r216134. This checkin broke platforms where bus_space are macros:
they need to be a single statement, and do { } while (0) doesn't work in this
situation so revert until a solution can be devised.
2010-12-03 07:09:23 +00:00
Rebecca Cran
15b4888a24 Disallow passing in a count of zero bytes to the bus_space(9) functions.
Passing a count of zero on i386 and amd64 for [I386|AMD64]_BUS_SPACE_MEM
causes a crash/hang since the 'loop' instruction decrements the counter
before checking if it's zero.

PR:	kern/80980
Discussed with:	jhb
2010-12-02 22:19:30 +00:00
Konstantin Belousov
2e88da356c Remove the note about possible unlocking during vunref(9). It might
only happen if VOP_INACTIVATE() drops the vnode lock, which is quite
unreasonable behaviour for filesystem, and should not be mentioned
in the description of VFS primitives.

MFC after:	1 week
2010-11-24 12:34:25 +00:00
Sergey Kandaurov
396a7f5025 Stop documenting vgonel() after its converting to the static function:
svn r147332 (by jeff): "Don't make vgonel() globally visible".
While here, specify the vnode locking scheme for vgone().

Discussed on:	freebsd-hackers@
Approved by:	kib (mentor)
MFC after:	10 days
2010-11-12 12:07:36 +00:00
Matthew D Fleming
f46276a9b0 Add a taskqueue_cancel(9) to cancel a pending task without waiting for
it to run as taskqueue_drain(9) does.

Requested by:	hselasky
Original code:	jeff
Reviewed by:	jhb
MFC after:	2 weeks
2010-11-08 20:56:31 +00:00
Edward Tomasz Napierala
8de599ec35 Xref BUS_SETUP_INTR(9) and locking(9). 2010-11-03 18:49:50 +00:00
John Baldwin
bd19a23baa Fix a few typos and style nits in the example code.
Submitted by:	Arnaud Lacombe  lacombar of gmail
MFC after:	3 days
2010-11-02 12:40:13 +00:00
Jaakko Heinonen
95adbc959b Use .Dv with NULL. 2010-10-24 16:10:32 +00:00
Jaakko Heinonen
f36575b51c Document make_dev_p(9).
Reviewed by:	brueffer, kib
2010-10-24 15:56:21 +00:00
Ulrich Spörlein
2914feeb7e mdoc: make pages render with mandoc
It's a bit more pedantic regarding .Bl list elements. This has an added
benefit of unbreaking the ipfw(8) manpage, where groff was silently
skipping one list element.
2010-10-21 12:27:13 +00:00
Andriy Gapon
7f0ab7f026 catch up manual pages with rename of vm_page_sleep_busy to vm_page_sleep_if_busy
Suggested by:	alc
MFC after:	4 days
2010-10-20 06:29:11 +00:00
Andriy Gapon
c3fdd2de24 VOP_GETPAGES.9: clarify and correct description of parameters and requirements
In cooperation with alc and kib, who provided valuable insights and
suggestions.

Reviewed by:	alc, kib (earlier version)
MFC after:	4 days
2010-10-20 05:57:54 +00:00
Andriy Gapon
55144670c2 PG_BUSY -> VPO_BUSY, PG_WANTED -> VPO_WANTED in manual pages and comments
Reviewed by:	alc
MFC after:	4 days
2010-10-20 05:17:23 +00:00
Matthew D Fleming
20ed0cb0c6 uma_zfree(zone, NULL) should do nothing, to match free(9).
Noticed by:	Ron Steinke <rsteinke at isilon dot com>
MFC after:	3 days
2010-10-19 16:06:00 +00:00
Ulrich Spörlein
52e9e8dcca mdoc: fix markup typo
MFC after:	1 week (together with r213983)
2010-10-19 15:26:08 +00:00
Pawel Jakub Dawidek
ad4f4b2be8 Update links for taskqueue(9) functions. 2010-10-18 12:35:48 +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
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
Matthew D Fleming
bf73d4d28e Use a safer mechanism for determining if a task is currently running,
that does not rely on the lifetime of pointers being the same. This also
restores the task KBI.

Suggested by:	jhb
MFC after:	1 month
2010-10-13 22:59:04 +00:00
Matthew D Fleming
a92f0ee866 Re-expose and briefly document taskqueue_run(9). The function is used
in at least one 3rd party driver.

Requested by:	jhb
2010-10-12 18:36:03 +00:00
Ulrich Spörlein
0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Jaakko Heinonen
68f7a01392 Check the device name validity on device registration.
A new function prep_devname() sanitizes a device name by removing
leading and redundant sequential slashes. The function returns an error
for names which already exist or are considered invalid.

A new flag MAKEDEV_CHECKNAME for make_dev_p(9) and make_dev_credf(9)
indicates that the caller is prepared to handle an error related to the
device name. An invalid name triggers a panic if the flag is not
specified.

Document the MAKEDEV_CHECKNAME flag in the make_dev(9) manual page.

Idea from:	kib
Reviewed by:	kib
2010-10-07 18:00:55 +00:00
Glen Barber
8d89b8f2a2 I believe the majority of Gregorian calendars would agree the current
year is 2010, not 2005.

Approved by:	keramida (mentor)
Pointy hat to:	gjb
MFC after:	1 week
2010-09-12 17:53:36 +00:00
Glen Barber
f3f9858578 Bump date from r212440.
Approved by:	keramida (mentor)
MFC after:	1 week
2010-09-12 14:04:54 +00:00
Glen Barber
9d839c44c1 Add RETURN VALUES section to devclass_get_maxunit(9).
PR:		149979
Submitted by:	gcooper
Patch by:	gcooper
Approved by:	keramida (mentor)
MFC after:	1 week
2010-09-10 23:22:01 +00:00
Matthew D Fleming
4d369413e1 Replace sbuf_overflowed() with sbuf_error(), which returns any error
code associated with overflow or with the drain function.  While this
function is not expected to be used often, it produces more information
in the form of an errno that sbuf_overflowed() did.
2010-09-10 16:42:16 +00:00
Matthew D Fleming
4351ba272c Add drain functionality to sbufs. The drain is a function that is
called when the sbuf internal buffer is filled.  For kernel sbufs with a
drain, the internal buffer will never be expanded.  For userland sbufs
with a drain, the internal buffer may still be expanded by
sbuf_[v]printf(3).

Sbufs now have three basic uses:
1) static string manipulation.  Overflow is marked.
2) dynamic string manipulation.  Overflow triggers string growth.
3) drained string manipulation.  Overflow triggers draining.

In all cases the manipulation is 'safe' in that overflow is detected and
managed.

Reviewed by:	phk (the previous version)
2010-09-09 17:49:18 +00:00
Matthew D Fleming
db960cf00a Fix small errors in the sbuf(9) man page. 2010-09-09 16:27:02 +00:00
Konstantin Belousov
5e9cd1dbf8 Document MAKEDEV_ETERNAL.
MFC after:	3 days
2010-09-05 14:47:46 +00:00
Max Laier
36058c09e4 rmlock(9) two additions and one change/fix:
- add rm_try_rlock().
 - add RM_SLEEPABLE to use sx(9) as the back-end lock in order to sleep while
   holding the write lock.
 - change rm_noreadtoken to a cpu bitmask to indicate which CPUs need to go
   through the lock/unlock in order to synchronize.  As a side effect, this
   also avoids IPI to CPUs without any readers during rm_wlock.

Discussed with:		ups@, rwatson@ on arch@
Sponsored by:		Isilon Systems, Inc.
2010-09-01 19:50:03 +00:00
Rebecca Cran
e7f8dd75b3 Fix incorrect usage of 'assure' and 'insure'.
Approved by: rrs (mentor)
2010-08-28 16:32:01 +00:00
Edward Tomasz Napierala
6b85cd6ddc s/ithread/interrupt thread/ 2010-08-24 21:38:44 +00:00
Ed Schouten
cd1c27af36 Add missing mlink for insmntque1().
MFC after:	1 week
2010-08-22 16:42:46 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Christian Brueffer
0f7e249192 Fixed a typo.
PR:		148701
Submitted by:	Glen Barber <glen.j.barber@gmail.com>
MFC after:	1 week
2010-08-15 21:37:30 +00:00
Christian Brueffer
6a8d8aa193 Tie up some loose ends r88509 left behind:
- chooseproc() is long gone, MLINK choosethread instead
- Update NAME section for choosethread
- Mark chooseproc.9 for removal

PR:             149549
Submitted by:   pluknet
MFC after:	1 week
2010-08-15 21:25:52 +00:00
Matthew D Fleming
e3813573bd Rework memguard(9) to reserve significantly more KVA to detect
use-after-free over a longer time.  Also release the backing pages of
a guarded allocation at free(9) time to reduce the overhead of using
memguard(9).  Allow setting and varying the malloc type at run-time.
Add knobs to allow:

 - randomly guarding memory
 - adding un-backed KVA guard pages to detect underflow and overflow
 - a lower limit on the size of allocations that are guarded

Reviewed by:    alc
Reviewed by:    brueffer, Ulrich Spörlein <uqs spoerlein net> (man page)
Silence from:   -arch
Approved by:    zml (mentor)
MFC after:      1 month
2010-08-11 22:10:37 +00:00
Dag-Erling Smørgrav
c3a2dbe9e5 Document the MEXTADD macro.
MFC after:	2 weeks
2010-08-07 13:26:08 +00:00
Stefan Farfeleder
6da339ce79 Add links for destroy_dev_drain, destroy_dev_sched, destroy_dev_sched_cb,
make_dev_cred and make_dev_credf.
2010-08-06 16:50:48 +00:00
Joel Dahl
f6ac23919b Fix typos and spelling mistakes. 2010-08-06 14:33:42 +00:00
Pawel Jakub Dawidek
3035649e73 Correct function name.
MFC after:	3 days
2010-08-01 21:54:25 +00:00
Joel Dahl
b06cfd40f9 Fix a bunch of typos and spelling mistakes. 2010-07-31 12:14:28 +00:00
Joel Dahl
9ba4735280 Spelling fixes. 2010-07-31 10:01:15 +00:00
Simon L. B. Nielsen
74aed54846 Missing IFCAP_* macro descriptions in ifnet(9).
PR:		docs/148952
Submitted by:	Lars Hartmann <lars@chaotika.org>
MFC after:	2 weeks
2010-07-27 08:45:29 +00:00
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