From owner-freebsd-ia64@FreeBSD.ORG Tue Feb 3 19:09:56 2009 Return-Path: Delivered-To: ia64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D76E81065674; Tue, 3 Feb 2009 19:09:56 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout015.mac.com (asmtpout015.mac.com [17.148.16.90]) by mx1.freebsd.org (Postfix) with ESMTP id C23578FC17; Tue, 3 Feb 2009 19:09:56 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from ubuntu.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp015.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KEI00EY67VZ9A60@asmtp015.mac.com>; Tue, 03 Feb 2009 11:09:36 -0800 (PST) Message-id: From: Marcel Moolenaar To: John Baldwin In-reply-to: <200902031107.52507.jhb@freebsd.org> Date: Tue, 03 Feb 2009 11:09:35 -0800 References: <200902021344.19249.jhb@freebsd.org> <5396BD91-541F-4EDF-9034-106477C99B7F@mac.com> <200902031107.52507.jhb@freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: ia64@freebsd.org Subject: Re: Change ia64 mca sysctls to use standard dynamic sysctls X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2009 19:09:57 -0000 On Feb 3, 2009, at 8:07 AM, John Baldwin wrote: > On Monday 02 February 2009 7:59:11 pm Marcel Moolenaar wrote: >> >> On Feb 2, 2009, at 10:44 AM, John Baldwin wrote: >> >>> While working on the locking for the sysctl tree, I ran into the >>> pseudo-dynamic machine check sysctls in ia64. It is not really a >>> good idea >>> to call sysctl_register_oid() with a spin lock held and once I add >>> locking to >>> sysctl it becomes a bad LOR. This changes the code to use the >>> public API for >>> adding dynamic sysctls outside of the spin lock. Please test this >>> as it is a >>> prerequisite for finishing the locking of the sysctl tree. >> >> This won't be a solution, because eventually this code gets called >> for machine checks, which means that locks can be held (which is >> then the least of our worries :-) >> >> In any case: malloc(M_WAITOK) cannot be used. We should probably >> delay updating the sysctl tree and do it in a more controlled >> environment. If you can implement a simple linked list to store >> the saved state and remove the call to SYSCTL_ADD_OID, then I'll >> work on that part after you're done. Does that sound like a plan? > > Ok. Checking for failures from M_NOWAIT is important, too. :) Here's > an updated patch that uses the queue. I haven't implemented the stuff > to schedule calls to the populate routine to drain the queue though. > Would you be able to do that? Yes, I will. Getting everything right takes some careful testing and probably requires deliberate error injection. I can't ask that of you :-) -- Marcel Moolenaar xcllnt@mac.com