Date: Sun, 28 Jul 2002 14:06:15 -0700 (PDT) From: Don Lewis <truckman@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern kern_sysctl.c Message-ID: <200207282106.g6SL6FWT093267@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
truckman 2002/07/28 14:06:15 PDT
Modified files:
sys/kern kern_sysctl.c
Log:
Make a temporary copy of the output data in the generic sysctl handlers
so that the data is less likely to be inconsistent if SYSCTL_OUT() blocks.
If the data is large, wire the output buffer instead.
This is somewhat less than optimal, since the handler could skip the copy
if it knew that the data was static.
If the data is dynamic, we are still not guaranteed to get a consistent
copy since another processor could change the data while the copy is in
progress because the data is not locked. This problem could be solved if
the generic handlers had the ability to grab the proper lock before the
copy and release it afterwards.
This may duplicate work done in other sysctl handlers in the kernel which
also copy the data, possibly while a lock is held, before calling they call
a generic handler to output the data. These handlers should probably call
SYSCTL_OUT() directly.
Revision Changes Path
1.129 +45 -6 src/sys/kern/kern_sysctl.c
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207282106.g6SL6FWT093267>
