public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Tejun Heo <tj@kernel.org>
Cc: maksim.rayskiy@gmail.com, linux-scsi@vger.kernel.org
Subject: Re: [RFC] Deferred disk spinup during system resume
Date: Fri, 07 Jan 2011 14:29:13 -0500	[thread overview]
Message-ID: <4D276989.1000501@pobox.com> (raw)
In-Reply-To: <20110107190644.GB7355@mtj.dyndns.org>

On 01/07/2011 02:06 PM, Tejun Heo wrote:
> Hello,
>
> On Thu, Jan 06, 2011 at 05:27:06PM -0800, maksim.rayskiy@gmail.com wrote:
>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
>> index 7f77c67..0a9d400 100644
>> --- a/drivers/ata/libata-core.c
>> +++ b/drivers/ata/libata-core.c
>> @@ -4978,6 +4978,14 @@ void ata_qc_issue(struct ata_queued_cmd *qc)
>>   	struct ata_link *link = qc->dev->link;
>>   	u8 prot = qc->tf.protocol;
>>
>> +	if (unlikely(link->eh_info.dev_action[qc->dev->devno]&
>> +			ATA_EH_VERIFY)) {
>> +		ata_port_schedule_eh(ap);
>> +		qc->scsidone(qc->scsicmd);
>> +		ata_qc_free(qc);
>> +		return;
>
> Hmm... this is weird.  You'll probably want to define a qc flag to
> indicate that the command is for verify and then schedule EH from
> ata_qc_issue().  That said, I'm not quite sure whether that's any
> better than scheduling EH from libata-scsi.  It's not like the
> boundary is clearly defined.  We already play with EH for other stuff
> from libata-scsi.  Jeff, do you think going through QCFLAG is
> important?

The boundary is clearly defined.  It's just not a file boundary :) 
libata-scsi contains EH callouts, but all of those are (a) sysfs 
attribute handling, (b) for callers located outside libata-scsi, or (c) 
the SCSI host scan.

The command translation and execution hot path is notably not in that list.

It is a clear laying violation to call out from the middle of a command 
translation, to directly execute some EH actions.  Remember, this is the 
stage at which we are QUEUEING commands.  There may be other commands in 
the queue, or currently executing.  If someone sends a READ VERIFY, we 
do not want to IMMEDIATELY schedule EH, we want to execute an EH action 
when the READ VERIFY command is ready to be executed.

It is quite incorrect to assume that READ VERIFY will only be sent to 
libata for execution during system resume.  The removal of READ VERIFY 
translation from ata_scsi_start_stop_xlat() is clearly wrong.

	Jeff




  reply	other threads:[~2011-01-07 19:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07  1:27 [RFC] Deferred disk spinup during system resume maksim.rayskiy
2011-01-07 19:06 ` Tejun Heo
2011-01-07 19:29   ` Jeff Garzik [this message]
2011-01-07 20:46     ` Maksim Rayskiy
  -- strict thread matches above, loose matches on Subject: below --
2011-01-06 20:20 maksim.rayskiy
2011-01-06 22:12 ` Jeff Garzik
2010-12-30 19:40 Maksim Rayskiy

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=4D276989.1000501@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=maksim.rayskiy@gmail.com \
    --cc=tj@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