Module Name:    src
Committed By:   jruoho
Date:           Thu Oct  6 05:23:41 UTC 2011

Modified Files:
        src/distrib/sets/lists/comp: mi
        src/share/man/man9: Makefile
Added Files:
        src/share/man/man9: kcpuset.9

Log Message:
Add kcpuset(9). Ok rmind@.


To generate a diff of this commit:
cvs rdiff -u -r1.1687 -r1.1688 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.353 -r1.354 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man9/kcpuset.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1687 src/distrib/sets/lists/comp/mi:1.1688
--- src/distrib/sets/lists/comp/mi:1.1687	Mon Oct  3 13:12:15 2011
+++ src/distrib/sets/lists/comp/mi	Thu Oct  6 05:23:39 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1687 2011/10/03 13:12:15 roy Exp $
+#	$NetBSD: mi,v 1.1688 2011/10/06 05:23:39 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -10076,6 +10076,24 @@
 ./usr/share/man/cat9/kauth.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/kcont.0			comp-obsolete		obsolete
 ./usr/share/man/cat9/kcopy.0			comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset.0			comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_create.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_destroy.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_copy.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_use.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_unuse.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_copyin.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_copyout.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_zero.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_fill.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_set.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_clear.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_isset.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_iszero.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_match.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_merge.0		comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_atomic_set.0	comp-sys-catman		.cat
+./usr/share/man/cat9/kcpuset_atomic_clear.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/kernacc.0			comp-obsolete		obsolete
 ./usr/share/man/cat9/kfilter_register.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/kfilter_unregister.0	comp-sys-catman		.cat
@@ -16152,6 +16170,24 @@
 ./usr/share/man/html9/itimerfix.html		comp-sys-htmlman	html
 ./usr/share/man/html9/kauth.html		comp-sys-htmlman	html
 ./usr/share/man/html9/kcopy.html		comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset.html		comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_create.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_destroy.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_copy.html		comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_use.html		comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_unuse.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_copyin.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_copyout.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_zero.html		comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_fill.html		comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_set.html		comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_clear.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_isset.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_iszero.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_match.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_merge.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_atomic_set.html	comp-sys-htmlman	html
+./usr/share/man/html9/kcpuset_atomic_clear.html	comp-sys-htmlman	html
 ./usr/share/man/html9/kfilter_register.html	comp-sys-htmlman	html
 ./usr/share/man/html9/kfilter_unregister.html	comp-sys-htmlman	html
 ./usr/share/man/html9/killproc.html		comp-sys-htmlman	html
@@ -22383,6 +22419,24 @@
 ./usr/share/man/man9/kauth.9			comp-sys-man		.man
 ./usr/share/man/man9/kcont.9			comp-obsolete		obsolete
 ./usr/share/man/man9/kcopy.9			comp-sys-man		.man
+./usr/share/man/man9/kcpuset.9			comp-sys-man		.man
+./usr/share/man/man9/kcpuset_create.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_destroy.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_copy.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_use.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_unuse.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_copyin.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_copyout.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_zero.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_fill.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_set.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_clear.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_isset.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_iszero.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_match.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_merge.9		comp-sys-man		.man
+./usr/share/man/man9/kcpuset_atomic_set.9	comp-sys-man		.man
+./usr/share/man/man9/kcpuset_atomic_clear.9	comp-sys-man		.man
 ./usr/share/man/man9/kernacc.9			comp-obsolete		obsolete
 ./usr/share/man/man9/kfilter_register.9		comp-sys-man		.man
 ./usr/share/man/man9/kfilter_unregister.9	comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.353 src/share/man/man9/Makefile:1.354
--- src/share/man/man9/Makefile:1.353	Fri Sep 30 15:47:20 2011
+++ src/share/man/man9/Makefile	Thu Oct  6 05:23:41 2011
@@ -1,4 +1,4 @@
-#       $NetBSD: Makefile,v 1.353 2011/09/30 15:47:20 njoly Exp $
+#       $NetBSD: Makefile,v 1.354 2011/10/06 05:23:41 jruoho Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -26,7 +26,7 @@ MAN=	accept_filter.9 accf_data.9 accf_ht
 	ieee80211_radiotap.9 iic.9 imax.9 \
 	in_getifa.9 \
 	in4_cksum.9 inittodr.9 intro.9 ioasic.9 ioctl.9 ipkdb.9 isa.9 \
-	isapnp.9 itimerfix.9 kauth.9 kcopy.9 kmem.9 \
+	isapnp.9 itimerfix.9 kauth.9 kcopy.9 kcpuset.9 kmem.9 \
 	kpause.9 \
 	kfilter_register.9 knote.9 \
 	kprintf.9 kthread.9 linedisc.9 lock.9 log.9 ltsleep.9 \
@@ -375,6 +375,23 @@ MLINKS+=isapnp.9 isapnp_devmatch.9 \
 	isapnp.9 isapnp_unconfig.9
 MLINKS+=knote.9 KNOTE.9 \
 	kfilter_register.9 kfilter_unregister.9
+MLINKS+=kcpuset.9 kcpuset_create.9 \
+	kcpuset.9 kcpuset_destroy.9 \
+	kcpuset.9 kcpuset_copy.9 \
+	kcpuset.9 kcpuset_use.9 \
+	kcpuset.9 kcpuset_unuse.9 \
+	kcpuset.9 kcpuset_copyin.9 \
+	kcpuset.9 kcpuset_copyout.9 \
+	kcpuset.9 kcpuset_zero.9 \
+	kcpuset.9 kcpuset_fill.9 \
+	kcpuset.9 kcpuset_set.9 \
+	kcpuset.9 kcpuset_clear.9 \
+	kcpuset.9 kcpuset_isset.9 \
+	kcpuset.9 kcpuset_iszero.9 \
+	kcpuset.9 kcpuset_match.9 \
+	kcpuset.9 kcpuset_merge.9 \
+	kcpuset.9 kcpuset_atomic_set.9 \
+	kcpuset.9 kcpuset_atomic_clear.9
 MLINKS+=kmem.9 kmem_alloc.9 \
 	kmem.9 kmem_free.9 \
 	kmem.9 kmem_zalloc.9 \

Added files:

Index: src/share/man/man9/kcpuset.9
diff -u /dev/null src/share/man/man9/kcpuset.9:1.1
--- /dev/null	Thu Oct  6 05:23:41 2011
+++ src/share/man/man9/kcpuset.9	Thu Oct  6 05:23:41 2011
@@ -0,0 +1,230 @@
+.\" $NetBSD: kcpuset.9,v 1.1 2011/10/06 05:23:41 jruoho Exp $ */
+.\"
+.\" Copyright (c) 2011 Jukka Ruohonen <jruohonen.iki.fi>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd October 6, 2011
+.Dt KCPUSET 9
+.Os
+.Sh NAME
+.Nm kcpuset ,
+.Nm kcpuset_create ,
+.Nm kcpuset_destroy ,
+.Nm kcpuset_copy ,
+.Nm kcpuset_use ,
+.Nm kcpuset_unuse ,
+.Nm kcpuset_copyin ,
+.Nm kcpuset_copyout ,
+.Nm kcpuset_zero ,
+.Nm kcpuset_fill ,
+.Nm kcpuset_set ,
+.Nm kcpuset_clear ,
+.Nm kcpuset_isset ,
+.Nm kcpuset_iszero ,
+.Nm kcpuset_match ,
+.Nm kcpuset_merge ,
+.Nm kcpuset_atomic_set ,
+.Nm kcpuset_atomic_clear
+.Nd dynamic kernel CPU sets
+.Sh SYNOPSIS
+.In sys/kcpuset.h
+.Ft void
+.Fn kcpuset_create "kcpuset_t **retkcp" "bool zero"
+.Ft void
+.Fn kcpuset_destroy "kcpuset_t *kcp"
+.Ft void
+.Fn kcpuset_copy "kcpuset_t *dkcp" "kcpuset_t *skcp"
+.Ft void
+.Fn kcpuset_use "kcpuset_t *kcp"
+.Ft void
+.Fn kcpuset_unuse "kcpuset_t *kcp" "kcpuset_t **lst"
+.Ft int
+.Fn kcpuset_copyin "const cpuset_t *ucp" "kcpuset_t *kcp" "size_t len"
+.Ft int
+.Fn kcpuset_copyout "kcpuset_t *kcp" "cpuset_t *ucp" "size_t len"
+.Ft void
+.Fn kcpuset_zero "kcpuset_t *kcp"
+.Ft void
+.Fn kcpuset_fill "kcpuset_t *kcp"
+.Ft void
+.Fn kcpuset_set "kcpuset_t *kcp" "cpuid_t cpu"
+.Ft void
+.Fn kcpuset_clear "kcpuset_t *kcp" "cpuid_t cpu"
+.Ft int
+.Fn kcpuset_isset "kcpuset_t * kcp" "cpuid_t cpu"
+.Ft bool
+.Fn kcpuset_iszero "kcpuset_t *kcp"
+.Ft bool
+.Fn kcpuset_match "const kcpuset_t *kcp1" "const kcpuset_t *kcp2"
+.Ft void
+.Fn kcpuset_merge "kcpuset_t *kcp1" "kcpuset_t *kcp2"
+.Ft void
+.Fn kcpuset_atomic_set "kcpuset_t *kcp" "cpuid_t cpu"
+.Ft void
+.Fn kcpuset_atomic_clear "kcpuset_t *kcp" "cpuid_t cpu"
+.Sh DESCRIPTION
+The machine-independent
+.Nm
+subsystem provides support for dynamic processor sets.
+Conceptually
+.Nm
+can be understood to be the kernel equivalent of the user space
+.Xr cpuset 3
+interface.
+.Sh FUNCTIONS
+.Bl -tag -width compact
+.It Fn kcpuset_create "retkcp" "zero"
+The
+.Fn kcpuset_create
+function creates a dynamic
+.Tn CPU
+set and stores the result to
+.Fa retkcp .
+If the boolean
+.Fa zero
+is not false, the allocated set is also initialized to zero.
+.It Fn kcpuset_destroy "kcp"
+Destroys the
+.Tn CPU
+set
+.Fa kcp
+and schedules any linked CPU sets for deferred destruction.
+.It Fn kcpuset_copy "dkcp" "skcp"
+Copies the
+.Tn CPU
+set pointed by
+.Fa skcp
+to
+.Fa dkcp .
+.It Fn kcpuset_use "kcp"
+Marks
+.Fa kcp
+as being in use by increasing the reference count of the object.
+Note that initially
+.Fn kcpuset_create
+sets the reference count to 1.
+.It Fn kcpuset_unuse "kcp" "lst"
+Decreases the internal reference count of
+.Fa kcp ,
+and on the last reference (when the count reaches zero), destroys
+.Fa kcp .
+If
+.Fa lst
+is not
+.Dv NULL ,
+then instead of destroying,
+.Fa kcp
+will be added to the
+.Fa lst
+list for a deferred destruction.
+.It Fn kcpuset_copyin "ucp" "kcp" "len"
+Copies the
+.Fa len
+bytes long user-space
+.Tn CPU
+set
+.Fa ucp
+to the kernel
+.Tn CPU
+set
+.Fa kcp .
+.It Fn kcpuset_copyout "kcp" "ucp" "len"
+Copies the kernel
+.Tn CPU
+set
+.Fa kcp
+to the user-space
+.Tn CPU
+set
+.Fa ucp .
+.It Fn kcpuset_zero "kcp"
+Clears the set
+.Fa kcp .
+.It Fn kcpuset_fill "kcp"
+Fills the whole set
+.Fa kcp
+with ones.
+.It Fn kcpuset_set "kcp" "cpu"
+Adds
+.Fa cpu
+to the set
+.Fa kcp .
+.It Fn kcpuset_clear "kcp" "cpu"
+Removes
+.Fa cpu
+from the set
+.Fa kcp .
+.It Fn kcpuset_isset "kcp" "cpu"
+Returns 1 if
+.Fa cpu
+is part of the
+.Tn CPU
+set
+.Fa kcp .
+.It Fn kcpuset_iszero "kcp"
+Returns true if the set
+.Fa kcp
+is empty.
+.It Fn kcpuset_match "kcp1" "kcp2"
+Compares the sets
+.Fa kcp1
+and
+.Fa kcp2 ,
+returning true if these are identical.
+.It Fn kcpuset_merge "kcp1" "kcp2"
+Merges the set
+.Fa kcp2
+to the set
+.Fa kcp1 .
+.It Fn kcpuset_atomic_set "kcp" "cpu"
+The
+.Fn kcpuset_atomic_set
+function operates as
+.Fn kcpuset_set ,
+but the operation is atomic; see
+.Xr atomic_ops 3
+for more details.
+.It Fn kcpuset_atomic_clear "kcp" "cpu"
+Removes
+.Fa cpu
+from the
+.Tn CPU
+set
+.Fa kcp
+atomically.
+.El
+.Sh CODE REFERENCES
+The
+.Nm
+subsystem is implemented within
+.Pa sys/kern/subr_kcpuset.c .
+.Pp
+.Sh SEE ALSO
+.Xr cpuset 3
+.Sh HISTORY
+The
+.Nm
+subsystem first appeared in
+.Nx 6.0 .

Reply via email to