From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 8 03:55:49 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F2C3106566B for ; Wed, 8 Dec 2010 03:55:49 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 579AE8FC08 for ; Wed, 8 Dec 2010 03:55:49 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 510491FFC34; Wed, 8 Dec 2010 03:55:48 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1A19D8457B; Wed, 8 Dec 2010 04:55:48 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: mdf@FreeBSD.org References: Date: Wed, 08 Dec 2010 04:55:47 +0100 In-Reply-To: (mdf@freebsd.org's message of "Fri, 3 Dec 2010 10:05:02 -0800") Message-ID: <86r5dsq5oc.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers Subject: Re: coretemp(4)/amdtemp(4) and sysctl nodes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2010 03:55:49 -0000 mdf@FreeBSD.org writes: > 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. I can't speak for amdtemp, but if coretemp used its own context instead of its parent's context, it would show up as dev.coretemp.X.temperature instead of dev.cpu.Y.temperature, where X is not necessarily equal to Y. Since, as you point out, the coretemp device is a child of the corresponding cpu device, there is no risk of orphaning the temperature OID. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no