Re: [PATCH] sd: implement stop_on_shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, Douglas.

Douglas Gilbert wrote:
>> This patch implements sd attribute stop_on_shutdown.  If set to 1, sd
>> stops the drive on non-restarting shutdown.  stop_on_shutdown is
>> initialized from sd parameter stop_on_shutdown_default which defaults
>> to 0.  So, this patch does not change the default behavior.
> 
> Tejun,
> The IMMED bit in the START STOP UNIT cdb is not being set
> when your patch stops a drive:
> 
> Advantage:
>   - the power won't be dropped immediately after sending
>     the command to the drive (assuming the drive gets
>     its power from the same power supply that shutdown
>     turns off)
> 
> Disadvantage:
>   - it will delay shutdown proportional to the number of
>     drives with the stop_on_shutdown attribute set. Say
>     5 seconds per disk.

We pretty much need the IMMED bit to be cleared.  The goal of this patch
is to allow drives unload their heads before power is cut off and with
IMMED set, we really don't know when is safe to power off the machine.

> Disadvantage (with or without IMMED bit set):
>   - if another initiator (e.g. on another machine) was
>     using a different partition on that disk, then it might
>     get upset (especially if it was running Linux).
>     [I'm not sure why you say this patch is necessary
>      in this case.]

Yeap, I agree with you.  I don't think the behavior introduced by this
patch is necessary in that case (did I say otherwise?) and that's
precisely why the default behavior hasn't been changed.  This is just
for small little machines running SATA and possibly USB disks (dunno
their SAT implement START_STOP tho) which are currently having problems
shutting down its disks on sleep to disk and sometimes poweroff.

> BTW SCSI disks typically have a lower start-stop lifetime
> rating than ATA disks. This reflects that SCSI disks are
> designed to be on 168 hours per week.

Yeap, not as useful as for PC stuff but I think having and enabling this
still would help in single initiator cases.  As you just said, they are
rated for less load-unload lifetime to begin with.

Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux