Date: Thu, 30 Sep 2004 07:04:03 +0000 (UTC) From: Poul-Henning Kamp <phk@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/sys systm.h src/sys/conf files src/sys/kern subr_unit.c Message-ID: <200409300704.i8U744rg051025@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
phk 2004-09-30 07:04:03 UTC
FreeBSD src repository
Modified files:
sys/sys systm.h
sys/conf files
Added files:
sys/kern subr_unit.c
Log:
Add a new API for allocating unit number (-like) resources.
Allocation is always lowest free unit number.
A mixed range/bitmap strategy for maximum memory efficiency. In
the typical case where no unit numbers are freed total memory usage
is 56 bytes on i386.
malloc is called M_WAITOK but no locking is provided (yet). A bit of
experience will be necessary to determine the best strategy. Hopefully
a "caller provides locking" strategy can be maintained, but that may
require use of M_NOWAIT allocation and failure handling.
A userland test driver is included.
Revision Changes Path
1.955 +1 -0 src/sys/conf/files
1.1 +597 -0 src/sys/kern/subr_unit.c (new)
1.215 +8 -0 src/sys/sys/systm.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409300704.i8U744rg051025>
