From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 22 14:03:43 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A25716A41F for ; Mon, 22 Aug 2005 14:03:43 +0000 (GMT) (envelope-from fli+freebsd-hackers@shapeshifter.se) Received: from mx1.h3q.net (manticore.shapeshifter.se [212.37.5.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id B292543D58 for ; Mon, 22 Aug 2005 14:03:41 +0000 (GMT) (envelope-from fli+freebsd-hackers@shapeshifter.se) Received: from localhost (localhost [127.0.0.1]) by mx1.h3q.net (Postfix) with ESMTP id C4E421A741; Mon, 22 Aug 2005 16:03:38 +0200 (CEST) Received: from mx1.h3q.net ([127.0.0.1]) by localhost (manticore.shapeshifter.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10388-18; Mon, 22 Aug 2005 16:03:37 +0200 (CEST) Received: from [192.168.0.100] (h4n2fls31o270.telia.com [217.208.199.4]) by mx1.h3q.net (Postfix) with ESMTP id EF15C1A73F; Mon, 22 Aug 2005 16:03:36 +0200 (CEST) Message-ID: <4309DB36.2090203@shapeshifter.se> Date: Mon, 22 Aug 2005 16:03:34 +0200 From: Fredrik Lindberg User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050816) X-Accept-Language: en-us, en MIME-Version: 1.0 To: m.ehinger@ltur.de References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: at mail.hamnpolare.net Cc: freebsd-hackers@freebsd.org Subject: Re: IBM Active Protection System Approach 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: Mon, 22 Aug 2005 14:03:43 -0000 m.ehinger@ltur.de wrote: > Hi, > > what would be the best approach to implement aps on FreeBSD? > > I got an Accelerometer driver which will deliver data. First Version is available at > https://sourceforge.net/project/showfiles.php?group_id=138242&package_id=160977 > > We have to poll the device for information quiet often to detect a possible shock early enough to park disk drive heads. > What else must be done to prevent a possible data loss? > > There is also an discussion about that concerning linux. > http://sourceforge.net/mailarchive/forum.php?forum=hdaps-devel > > > Would an daemon be sufficient for that? Reaction time? What about an kernel thread? > > Other solutions? > > thanks in advance > > Maik > This is just some wild ideas... 1) Keeping everything inside the kernel. Will yield fast response time, it will be able to park the head but nothing else. All policy decisions will have to be made through sysctl(3) or similar interface. 2) Let the kernel do all the polling and send asynchronous events through devctl(4). A userland daemon (running mlock(2)ed) catches these events and parks the head (and possibly other actions aswell). A threshold setting could be avaiable through sysctl(3) so that only potential dangerous values are reported to the userland daemon. The biggest problem is probably that devctl(4) only can have one reader, which at the moment is devd(8). If devd is swapped out the response time would suffer, which means that devd must run mlock'ed too?. 3) A userland daemon does the polling. Not sure about the response time, but there will be alot of data transfer between the kernel and userland which usually is expensive. Fredrik Lindberg