Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 2010 09:48:54 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        mdf@freebsd.org
Subject:   Re: coretemp(4)/amdtemp(4) and sysctl nodes
Message-ID:  <201012060948.54126.jhb@freebsd.org>
In-Reply-To: <AANLkTikNJ29AcE1fBXqq_atUU8PQBz9VUos0V%2BwBFQJs@mail.gmail.com>
References:  <AANLkTikNJ29AcE1fBXqq_atUU8PQBz9VUos0V%2BwBFQJs@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, December 03, 2010 1:05:02 pm mdf@freebsd.org wrote:
> There are very few uses in FreeBSD mainline code of
> sysctl_remove_oid(), and I was looking at potentially removing them.
> However, the use in coretemp/amdtemp has me slightly stumped.
> 
> Each device provides a device_get_sysctl_ctx sysctl_ctx that is
> automatically cleaned up when the device goes away.  Yet the sysctl
> nodes for both amdtemp and coretemp use the context of other devices,
> rather than their own.  I can't quite figure out why, though the two
> are slightly different enough that they may have different reasons.
> 
> For coretmp(4) I don't see how the parent device can be removed first,
> since we are a child device.  So from my understanding it makes no
> sense to have an explicit sysctl_remove_oid() and attach in the
> parent's sysctl_ctx.

Well, you would want 'kldunload coretemp.ko' to remove the sysctl node even 
though the parent device is still around.  I suspect the same case is true
for amdtemp.  Probably these drivers should use a separate sysctl context.
I'm not sure how the sysctl code handles removing a node that has an active 
context though.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012060948.54126.jhb>