This patch reduces S3 resume time from 10+ seconds to less than a second
on systems with SATA drives. It does this by making ata port and scsi disk
resume non-blocking.

This is v4, sent in response to Tejun Huo's comments and with some small
fixes made after testing.

OVERVIEW

The essential issue behind hard disks' lengthy resume time is the ata port
driver blocking until the ATA port hardware is finished coming online. So
the kernel isn't really doing anything during all those seconds that the
disks are resuming, it's just blocking until the hardware says it's ready
to accept commands. Applying this patch set allows SATA disks to resume
asynchronously without holding up system resume, thus allowing the UI to
come online much more quickly. There may be a short period after resume
where the disks are still spinning up in the background, but it will only
momentarily affect applications using that disk.

The patch set has two parts which apply to ata_port_resume and sd_resume
respectively. Both are required to achieve any real performance benefit,
but they will still function independantly without a performance hit.

PERFORMANCE DATA

[Computer One Test - 10.5X speedup on S3 resume]
Platform: Ubuntu Raring Ringtail (13.04) kernel 3.11.0-rc7
Cpu: Intel(R) Core(TM) i7-3960X CPU @ 3.30GHz
Ahci: Intel C600/X79 series chipset 6-Port SATA AHCI (r5)
Disk config (using all 6 ahci ports): 
240 GB SSD, 3 TB HD, 500 GB HD, DVD-ROM (with cd inserted), 2 TB HD, 1 TB HD
Resume time: [unpatched 11656ms] [patched 1110ms]

[Computer Two Test - 12X speedup on S3 resume]
Platform: Ubuntu Raring Ringtail (13.04) kernel 3.11.0-rc7
Cpu: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Ahci: Intel 7 Series/C210 Series Chipset Family 6-port SATA [AHCI mode] (r4)
Disk config (using 1 ahci port): 320 GB Hard Disk
Resume time: [unpatched 5416 ms] [patched 448 ms]

[Computer Three Test - 7.8X speedup on S3 resume]
Platform: Ubuntu Raring Ringtail (13.04) kernel 3.11.0-rc7
Cpu: Intel(R) Core(TM) i7-4770S CPU @ 3.10GHz
Ahci: Intel Lynx Point 6-port SATA Controller 1 [AHCI mode] (r2)
Disk config (using 2 ahci ports): DVD-ROM (empty), 500 GB Hard Disk
Resume time: [unpatched 5385ms] [patched 688ms]

CHANGELOG

v4: Jan 15, 2014
 [in response to Tejun Huo]
 - completely removed the pm_result member of the ata_port struct
 - result from ata_port_suspend/resume is now returned from the function
   instead of into a pointer location
 - ata_port_request_pm now only returns 0/-EAGAIN for pass/fail
 [fixes]
 - moved the scsi_disk_put call from sd_resume_complete into sd_resume
   since it needs to be called from the same context
v3: Jan 14, 2014
 [in response to Tejun Huo]
 - respun the ata patch to merge the entire code path into async resume
   i.e. resume, restore, and thaw.
 - re-tested the changes in hibernate to verify there are no issues
 - respun the sd patch to apply clean over 3.13 rc8, no other changes
v2: Oct 17, 2013
 [in response to Oliver Neukum]
 - Added scsi cmd error reporting through the scsi_sense_hdr
 [in response to James Bottomley]
 - unified the sd_resume code path by just making sd_resume async. Thus all
   three resume callbacks: resume, restore, and runtime-resume will use it,
   but there is a performance benefit for resume only.
 [in response to Bartlomiej Zolnierkiewicz]
 - unified the __ata_port_resume_common code path to include an async
   parameter. This way there's no need to re-implement ata_port_request_pm.
v1: Sept 6, 2013
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to