mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@cfl.rr.com>
To: linux-kernel@vger.kernel.org
Subject: New SCSI subsystem in 2.4, and scsi idle patch
Date: Sun, 9 Sep 2001 18:21:13 +0000	[thread overview]
Message-ID: <200109092229.f89MT3M07627@smtp-server2.tampabay.rr.com> (raw)

I'm trying to get my 2.4.9 system to spin down my scsi disk(s) when idle.  
Aparently, this is supported on IDE disks, but not SCSI.  I found an old 
patch to add support for this to the 2.0.34 kernel, and have been trying to 
use it as a guide to fixing the 2.4.9 kernel.  It seems that major changes 
have been done to the scsi layer, so I'm a little confused.  Any help is 
appreciated.  Here is my current status:

It looks like the code path I need to modify is in 
drivers/scsi/sd.c:rw_intr().  It looks to me that this function is called 
when the HBA completes an SRB and it decides if it was an error or not, and 
completes it correctly.  I think I need to check for the NOT_READY sense 
status here, and if it is found, try to spin up the disk.  

Now for my questions:  

1) In the old patch, if the spin up failed, it calls 
end_scsi_request, and then requeue_sd_request.  I'm not sure why it tries to 
requeue a failed request, but the it seems that neither of these functions 
exist in the 2.4 kernel.  What should I use instead?

2) If the spin up worked, the old code called requeue_sd_request, I assume to 
send down the original read/write request to the disk now that it is on.  
Once again, what should I use instead of requeue_sd_request to do this?  
There is a comment still in the 2.4 code describing this function, but the 
function itself is not there.  

3) The old code called scsi_do_cmd to send down a START_STOP SRB to the drive 
when it decides it should spin the drive back up.  This function is also no 
longer there, so what should I use to send down the START_STOP SRB?  

P.S.  I'd like to use a user mode daemon to detect disk idle, and issue the 
existing ioctl code to spin the disk down, and rely on the kernel to spin it 
back up as needed.  Isn't there somewhere in /proc that keeps IO counters on 
the disk I can monitor?  Also, is there a way I could ask the kernel to not 
flush dirty pages to disk unless it gets a whole lot of them so the disk 
won't be spun up all the time just to write a few KB?

-- 
--> Phill Susi

             reply	other threads:[~2001-09-09 22:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-09 18:21 Phillip Susi [this message]
2001-09-10 11:25 ` Alistair Riddell
2001-09-10 14:10   ` Mark Hahn
2001-09-10 16:33     ` idalton
2001-09-10 20:34       ` Daniel Kobras
2001-09-10 21:03 ` Daniel Kobras
2001-09-09 22:53 Robert Love
2001-09-10  9:44 ` Frank Schneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200109092229.f89MT3M07627@smtp-server2.tampabay.rr.com \
    --to=psusi@cfl.rr.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®