Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-25 Thread Jens Axboe
On Thu, Aug 25 2005, Jon Escombe wrote: > Alan Cox wrote: > >@@ -1661,6 +1671,9 @@ > >where = ELEVATOR_INSERT_FRONT; > >rq->flags |= REQ_PREEMPT; > >} > >+ if (action == ide_next) > >+ where = ELEVATOR_INSERT_FRONT; > >+ > >__elv_a

Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-25 Thread Jon Escombe
Alan Cox wrote: @@ -1661,6 +1671,9 @@ where = ELEVATOR_INSERT_FRONT; rq->flags |= REQ_PREEMPT; } + if (action == ide_next) + where = ELEVATOR_INSERT_FRONT; + __elv_add_request(drive->queue, rq, where, 0); ide_do_request(h

Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-25 Thread Alan Cox
You need the kernel side timeout. Consider this case One page of memory holds the parking code A second page is swapped to disk and holds the resume code You park the disk You wakeup You got to page in the resume code So you really do want the kernel helping to avoid a deadlock @@ -1661,6 +1671

Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-24 Thread Jon Escombe
Jens Axboe wrote: Ok, I'll give you some hints to get you started... What you really want to do, is: - Insert a park request at the front of the queue - On completion callback on that request, freeze the block queue and schedule it for unfreeze after a given time Am attaching a first att

RE: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-19 Thread Alejandro Bonilla
> On Fri, Aug 19 2005, Jon Escombe wrote: > > For hard disk protection, I prefer the idea of the userspace code > > thawing the drive based on current accelerometer data, rather than > > simply waking up after x seconds (maybe you're running for > a bus rather > > than falling off a table)... > >

Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-19 Thread Stefan Rompf
Dave Hansen wrote: > In reality, that probably means a statically compiled daemon that > mlock()s itself, and any structures that it will need. It _might_ even > need to keep an open file descriptor on the "frozen" file. Because, in > theory, that file could be written out to the sysfs backing s

Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-19 Thread Jens Axboe
On Fri, Aug 19 2005, Jon Escombe wrote: > > Please make it "echo 1 > frozen", then userspace can do "echo 0 > > frozen" > after five seconds. > > > >>>What if the code to do "echo 0 > frozen" is swapped out to disk? ;) > >>> > >>> > >>Emergency head parker needs

Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-19 Thread Jon Escombe
Please make it "echo 1 > frozen", then userspace can do "echo 0 > frozen" after five seconds. What if the code to do "echo 0 > frozen" is swapped out to disk? ;) Emergency head parker needs to be pagelocked for other reasons. You do not want to page it from disk while your note

Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-18 Thread Dave Hansen
On Thu, 2005-08-18 at 17:15 -0400, Adam Goode wrote: > On Thu, 2005-08-18 at 22:49 +0200, Pavel Machek wrote: > > Please make it "echo 1 > frozen", then userspace can do "echo 0 > frozen" > > after five seconds. > > What if the code to do "echo 0 > frozen" is swapped out to disk? ;) In the real wo

Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-16 Thread Jon Escombe
On Tue, Aug 16 2005, Alejandro Bonilla Beeche wrote: If I were in your position, I would just implement this for ide (pata, not sata) right now, since that is what you need to support (or do some of these notebooks come with sata?). So it follows that you add an ide Some notebooks are co

Re: [Hdaps-devel] Re: HDAPS, Need to park the head for real

2005-08-16 Thread Yani Ioannou
On 8/16/05, Alejandro Bonilla Beeche <[EMAIL PROTECTED]> wrote: > On Tue, 2005-08-16 at 22:07 +0200, Jens Axboe wrote: > > On Tue, Aug 16 2005, Alejandro Bonilla Beeche wrote: > > If I were in your position, I would just implement this for ide (pata, > > not sata) right now, since that is what you