linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [DO NOT APPLY] sd take advantage of rotation speed
Date: Sun, 22 Jun 2008 07:19:26 -0600	[thread overview]
Message-ID: <20080622131926.GX4392@parisc-linux.org> (raw)
In-Reply-To: <485E42B1.1060807@panasas.com>

On Sun, Jun 22, 2008 at 03:16:49PM +0300, Boaz Harrosh wrote:
> Matthew Wilcox wrote:
> > Use the noop elevator by default for drives that do not spin
> > 
> <snip> 
> > I've brazenly stolen sd_vpd_inquiry from mkp's patch here:
> > 
> > http://marc.info/?l=linux-scsi&m=121264354724277&w=2
> > 
> > No need to have two copies of that ... but this will conflict with his code.
> > 
> <snip>
> > I think there's an opportunity to improve sd_vpd_inquiry() to remove
> > some of the duplicate code between sd_set_elevator() and sd_block_limits,
> > but it's not terribly important.
> > 
> > +static int sd_vpd_inquiry(struct scsi_disk *sdkp, unsigned char *buffer, u8 page, u8 len)
> > +{
> > +	int result;
> > +	unsigned char cmd[16];
> > +	struct scsi_sense_hdr sshdr;
> > +
> > +	memset(cmd, 0, 16);
> > +	cmd[0] = INQUIRY;
> > +	cmd[1] = 1;		/* EVPD */
> > +	cmd[2] = page;		/* VPD page */
> > +	cmd[3] = len;
> > +	
> > +	result = scsi_execute_req(sdkp->device, cmd, DMA_FROM_DEVICE, buffer,
> > +				  len, &sshdr, SD_TIMEOUT, SD_MAX_RETRIES);
> > +
> > +	if (media_not_present(sdkp, &sshdr))
> > +		return -EIO;
> > +
> > +	if (result) {
> > +		sd_printk(KERN_ERR, sdkp, "EVPD Inquiry failed\n");
> > +		return -EIO;
> > +	}
> > +
> > +	if (buffer[1] != page) {
> > +		sd_printk(KERN_ERR, sdkp, "Page code not %2x (%2x)\n", page,
> > +			  buffer[1]);
> > +		return -EIO;
> > +	}
> > +
> > +	return buffer[3];
> > +}
> 
> I was just copy/pasting the same code into my ULD. Perhaps the low level of above
> could be made into a scsi_vpd_inquiry(...). From a quick search it looks like there
> are 3 more places that issue _vpd_inquiry in the tree today.

Yes, there's nothing sd-specific about it.  Let me just make that minor
improvement and I'll send out a proposal for scsi_vpd_inquiry().

> Some of the more interesting device information are in vpd's. we should have a generic
> user-mode way to inquire them. sysfs structure, ioctl, I'm not sure, something good for
> udev. There are tones of such little knobs that could be tuned according to vpd
> information.

We have sg_inq and sg_vpd from Doug's sg3-utils.

> Thanks for doing this, I will investigate if current iscsi-targets will immediately benefit
> from this too. From my testing I found that it is usually better to let the target side
> elevator do the work, and set the Initiator elevator to noop. Do you know what the standard
> say about the default value should be, in the case the page is not present. I would assume 
> it means "No spinning media" too, right?

It means "Not reported".  Which I translate from standard-ese as
"Could be anything".

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2008-06-22 13:19 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 16:03 [DO NOT APPLY] sd take advantage of rotation speed Matthew Wilcox
2008-06-19 17:12 ` Mike Anderson
2008-06-19 18:10   ` Matthew Wilcox
2008-06-22 12:16 ` Boaz Harrosh
2008-06-22 13:19   ` Matthew Wilcox [this message]
2008-06-22 13:27     ` Boaz Harrosh
2008-06-22 13:38 ` James Bottomley
2008-06-22 14:03   ` Matthew Wilcox
2008-06-22 14:41     ` Martin K. Petersen
2008-06-22 18:44       ` Matthew Wilcox
2008-06-25  2:06         ` Martin K. Petersen
2008-06-22 17:26     ` James Bottomley
2008-06-25 13:47 ` Jens Axboe
2008-06-25 13:57   ` Jens Axboe
2008-06-25 14:24   ` Ric Wheeler
2008-06-25 16:25     ` Boaz Harrosh
2008-06-25 16:57       ` Jens Axboe
2008-06-25 17:20         ` Matthew Wilcox
2008-06-25 17:26           ` Jens Axboe
2008-06-25 17:34             ` Matthew Wilcox
2008-06-25 17:43               ` James Bottomley
2008-06-25 17:53                 ` Matthew Wilcox
2008-06-25 18:01                   ` Jens Axboe
2008-06-25 18:06                   ` James Bottomley
2008-06-25 17:59               ` Jens Axboe
2008-06-25 18:06             ` Martin K. Petersen
2008-06-25 18:12               ` Jens Axboe
2008-07-28 13:36               ` Ric Wheeler
2008-07-28 14:10                 ` James Bottomley
2008-07-28 14:31                 ` Martin K. Petersen
2008-07-31 21:00                   ` Grant Grundler
2008-07-31 21:19                     ` Andrew Patterson
2008-07-31 22:26                     ` Ric Wheeler
2008-07-31 23:44                       ` Grant Grundler

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=20080622131926.GX4392@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=bharrosh@panasas.com \
    --cc=linux-scsi@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;
as well as URLs for NNTP newsgroup(s).