All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: Theodore Tso <tytso@mit.edu>,
	Arjan van de Ven <arjan@infradead.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	James Bottomley <James.Bottomley@suse.de>,
	Mark Lord <liml@rtr.ca>,
	Chris
Subject: Re: Discard support (was Re: [PATCH] swap: send callback when swap slot is freed)
Date: Sun, 16 Aug 2009 13:28:55 -0400	[thread overview]
Message-ID: <4A8841D7.10506__16178.1601178975$1250443777$gmane$org@rtr.ca> (raw)
In-Reply-To: <20090816154430.GE17958@mit.edu>

Theodore Tso wrote:
..
> Mark Lord has claimed that the currently shipping SSD's take "hundreds
> of milliseconds" for a TRIM, command.
..

Here's some data to support that claim.

First, here are a series of TRIM commands for single-extents
of varying lengths.

The measures include the printk() timestamp, plus I had libata itself
use rdtsc() before/after each TRIM.  This is with a T7400 CPU booted
using maxcpus=1, and locked at 2.16GHz using "performance" CPU policy.

The first set of data, is from individual single-extent TRIMs,
with a "sleep 1 ; sync" between each successive TRIM:

Beginning TRIM operations..
Trimming 1 free extents encompassing 656 sectors (0 MB)
Trimming 1 free extents encompassing 30 sectors (0 MB)
Trimming 1 free extents encompassing 194 sectors (0 MB)
Trimming 1 free extents encompassing 42 sectors (0 MB)
Trimming 1 free extents encompassing 1574 sectors (1 MB)
Trimming 1 free extents encompassing 612 sectors (0 MB)
Trimming 1 free extents encompassing 862 sectors (0 MB)
Trimming 1 free extents encompassing 1344 sectors (1 MB)
Trimming 1 free extents encompassing 822 sectors (0 MB)
Trimming 1 free extents encompassing 672 sectors (0 MB)
Trimming 1 free extents encompassing 226 sectors (0 MB)
Trimming 1 free extents encompassing 860 sectors (0 MB)
Trimming 1 free extents encompassing 638 sectors (0 MB)
Trimming 1 free extents encompassing 1020 sectors (0 MB)
Trimming 1 free extents encompassing 12286 sectors (6 MB)
Trimming 1 free extents encompassing 1964 sectors (1 MB)
Done.
[ 1083.768460] ata_qc_issue: ATA_CMD_DSM starting
[ 1083.768672] trim_completed: ATA_CMD_DSM took 438841 cycles
[ 1084.794304] ata_qc_issue: ATA_CMD_DSM starting
[ 1084.794469] trim_completed: ATA_CMD_DSM took 338065 cycles
[ 1085.823605] ata_qc_issue: ATA_CMD_DSM starting
[ 1085.823791] trim_completed: ATA_CMD_DSM took 382317 cycles
[ 1086.852989] ata_qc_issue: ATA_CMD_DSM starting
[ 1086.853166] trim_completed: ATA_CMD_DSM took 352248 cycles
[ 1087.882825] ata_qc_issue: ATA_CMD_DSM starting
[ 1087.883127] trim_completed: ATA_CMD_DSM took 624546 cycles
[ 1088.915833] ata_qc_issue: ATA_CMD_DSM starting
[ 1088.916056] trim_completed: ATA_CMD_DSM took 455299 cycles
[ 1089.941946] ata_qc_issue: ATA_CMD_DSM starting
[ 1089.942181] trim_completed: ATA_CMD_DSM took 485615 cycles
[ 1090.968793] ata_qc_issue: ATA_CMD_DSM starting
[ 1090.969062] trim_completed: ATA_CMD_DSM took 562042 cycles
[ 1091.994441] ata_qc_issue: ATA_CMD_DSM starting
[ 1091.994672] trim_completed: ATA_CMD_DSM took 479219 cycles
[ 1093.023576] ata_qc_issue: ATA_CMD_DSM starting
[ 1093.023799] trim_completed: ATA_CMD_DSM took 463398 cycles
[ 1094.053545] ata_qc_issue: ATA_CMD_DSM starting
[ 1094.053731] trim_completed: ATA_CMD_DSM took 385229 cycles
[ 1095.083131] ata_qc_issue: ATA_CMD_DSM starting
[ 1095.083356] trim_completed: ATA_CMD_DSM took 458328 cycles
[ 1096.113146] ata_qc_issue: ATA_CMD_DSM starting
[ 1096.113356] trim_completed: ATA_CMD_DSM took 423670 cycles
[ 1097.144211] ata_qc_issue: ATA_CMD_DSM starting
[ 1097.144464] trim_completed: ATA_CMD_DSM took 524706 cycles
[ 1098.174457] ata_qc_issue: ATA_CMD_DSM starting
[ 1098.175619] trim_completed: ATA_CMD_DSM took 2491138 cycles
[ 1099.209218] ata_qc_issue: ATA_CMD_DSM starting
[ 1099.209539] trim_completed: ATA_CMD_DSM took 674752 cycles

Those TRIMs look fine, in the single millisecond range.
But.. the "sleep 1" hides some drive firmware evils..
Here is exactly the same run again, but without the "sleep 1":

Beginning TRIM operations..
Trimming 1 free extents encompassing 656 sectors (0 MB)
Trimming 1 free extents encompassing 30 sectors (0 MB)
Trimming 1 free extents encompassing 194 sectors (0 MB)
Trimming 1 free extents encompassing 42 sectors (0 MB)
Trimming 1 free extents encompassing 1574 sectors (1 MB)
Trimming 1 free extents encompassing 612 sectors (0 MB)
Trimming 1 free extents encompassing 862 sectors (0 MB)
Trimming 1 free extents encompassing 1344 sectors (1 MB)
Trimming 1 free extents encompassing 822 sectors (0 MB)
Trimming 1 free extents encompassing 672 sectors (0 MB)
Trimming 1 free extents encompassing 226 sectors (0 MB)
Trimming 1 free extents encompassing 860 sectors (0 MB)
Trimming 1 free extents encompassing 638 sectors (0 MB)
Trimming 1 free extents encompassing 1020 sectors (0 MB)
Trimming 1 free extents encompassing 12286 sectors (6 MB)
Trimming 1 free extents encompassing 1964 sectors (1 MB)
Done.
[ 1258.206379] ata_qc_issue: ATA_CMD_DSM starting
[ 1258.206587] trim_completed: ATA_CMD_DSM took 426088 cycles
[ 1258.254513] ata_qc_issue: ATA_CMD_DSM starting
[ 1258.366141] trim_completed: ATA_CMD_DSM took 241231523 cycles
[ 1258.411749] ata_qc_issue: ATA_CMD_DSM starting
[ 1258.524047] trim_completed: ATA_CMD_DSM took 242676590 cycles
[ 1258.600184] ata_qc_issue: ATA_CMD_DSM starting
[ 1258.711766] trim_completed: ATA_CMD_DSM took 241136519 cycles
[ 1258.813515] ata_qc_issue: ATA_CMD_DSM starting
[ 1258.910599] trim_completed: ATA_CMD_DSM took 209803152 cycles
[ 1259.027253] ata_qc_issue: ATA_CMD_DSM starting
[ 1259.108916] trim_completed: ATA_CMD_DSM took 176473453 cycles
[ 1259.239549] ata_qc_issue: ATA_CMD_DSM starting
[ 1259.306640] trim_completed: ATA_CMD_DSM took 144968694 cycles
[ 1259.452978] ata_qc_issue: ATA_CMD_DSM starting
[ 1259.505017] trim_completed: ATA_CMD_DSM took 112440172 cycles
[ 1259.552393] ata_qc_issue: ATA_CMD_DSM starting
[ 1259.664739] trim_completed: ATA_CMD_DSM took 242778861 cycles
[ 1259.775724] ata_qc_issue: ATA_CMD_DSM starting
[ 1259.861318] trim_completed: ATA_CMD_DSM took 184955732 cycles
[ 1259.989289] ata_qc_issue: ATA_CMD_DSM starting
[ 1260.059963] trim_completed: ATA_CMD_DSM took 152713730 cycles
[ 1260.211066] ata_qc_issue: ATA_CMD_DSM starting
[ 1260.257474] trim_completed: ATA_CMD_DSM took 100279998 cycles
[ 1260.306277] ata_qc_issue: ATA_CMD_DSM starting
[ 1260.417770] trim_completed: ATA_CMD_DSM took 240932835 cycles
[ 1260.464049] ata_qc_issue: ATA_CMD_DSM starting
[ 1260.575418] trim_completed: ATA_CMD_DSM took 240673134 cycles
[ 1260.650624] ata_qc_issue: ATA_CMD_DSM starting
[ 1260.763510] trim_completed: ATA_CMD_DSM took 243952865 cycles
[ 1260.810454] ata_qc_issue: ATA_CMD_DSM starting
[ 1260.921433] trim_completed: ATA_CMD_DSM took 239832996 cycles

As you can see, we're now into the 100 millisecond range
for successive TRIM-followed-by-TRIM commands.

Those are all for single extents.  I will follow-up with a small
amount of similar data for TRIMs with multiple extents.

  parent reply	other threads:[~2009-08-16 17:28 UTC|newest]

Thread overview: 207+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 14:37 [PATCH] swap: send callback when swap slot is freed Nitin Gupta
2009-08-12 14:37 ` Nitin Gupta
2009-08-12 18:33 ` Peter Zijlstra
2009-08-12 22:13 ` Andrew Morton
2009-08-12 22:48 ` Hugh Dickins
2009-08-12 22:48   ` Hugh Dickins
2009-08-13  2:30   ` Nitin Gupta
2009-08-13  2:30     ` Nitin Gupta
2009-08-13  6:53     ` Peter Zijlstra
2009-08-13  6:53       ` Peter Zijlstra
2009-08-13 14:44       ` Nitin Gupta
2009-08-13 14:44         ` Nitin Gupta
2009-08-13 17:45     ` Hugh Dickins
2009-08-13 17:45       ` Hugh Dickins
2009-08-13  2:41   ` Nitin Gupta
2009-08-13  2:41     ` Nitin Gupta
2009-08-13  5:05     ` compcache as a pre-swap area (was: [PATCH] swap: send callback when swap slot is freed) Al Boldi
2009-08-13  5:05       ` Al Boldi
2009-08-13 17:31       ` Nitin Gupta
2009-08-13 17:31         ` Nitin Gupta
2009-08-14  4:02         ` Al Boldi
2009-08-14  4:02           ` Al Boldi
2009-08-14  4:53           ` compcache as a pre-swap area Nitin Gupta
2009-08-14  4:53             ` Nitin Gupta
2009-08-14 15:49             ` Al Boldi
2009-08-14 15:49               ` Al Boldi
2009-08-15 11:00               ` Al Boldi
2009-08-15 11:00                 ` Al Boldi
2009-08-13 15:13   ` Discard support (was Re: [PATCH] swap: send callback when swap slot is freed) Matthew Wilcox
2009-08-13 15:13     ` Matthew Wilcox
2009-08-13 15:17     ` david
2009-08-13 15:17       ` david
2009-08-13 15:26       ` Matthew Wilcox
2009-08-13 15:26         ` Matthew Wilcox
2009-08-13 15:43     ` James Bottomley
2009-08-13 15:43       ` James Bottomley
2009-08-13 18:22       ` Ric Wheeler
2009-08-13 18:22         ` Ric Wheeler
2009-08-13 16:13     ` Nitin Gupta
2009-08-13 16:13       ` Nitin Gupta
2009-08-13 16:26     ` Markus Trippelsdorf
2009-08-13 16:26       ` Markus Trippelsdorf
2009-08-13 16:33       ` david
2009-08-13 16:33         ` david
2009-08-13 18:15         ` Greg Freemyer
2009-08-13 18:15           ` Greg Freemyer
2009-08-13 18:15           ` Greg Freemyer
2009-08-13 19:18           ` James Bottomley
2009-08-13 19:18             ` James Bottomley
2009-08-13 20:31             ` Richard Sharpe
2009-08-13 20:31               ` Richard Sharpe
2009-08-13 20:31               ` Richard Sharpe
2009-08-14 22:03             ` Mark Lord
2009-08-14 22:03               ` Mark Lord
2009-08-14 22:54               ` Greg Freemyer
2009-08-14 22:54                 ` Greg Freemyer
2009-08-15 13:12                 ` Mark Lord
2009-08-15 13:12                   ` Mark Lord
2009-08-13 20:44           ` david
2009-08-13 20:44             ` david
2009-08-13 20:54             ` Bryan Donlan
2009-08-13 20:54               ` Bryan Donlan
2009-08-14 22:10               ` Mark Lord
2009-08-14 22:10                 ` Mark Lord
2009-08-14 23:21                 ` Chris Worley
2009-08-14 23:21                   ` Chris Worley
2009-08-14 23:45                   ` Matthew Wilcox
2009-08-14 23:45                     ` Matthew Wilcox
2009-08-15  0:19                     ` Chris Worley
2009-08-15  0:19                       ` Chris Worley
2009-08-15  0:30                       ` Greg Freemyer
2009-08-15  0:30                         ` Greg Freemyer
2009-08-15  0:38                         ` Chris Worley
2009-08-15  0:38                           ` Chris Worley
2009-08-15  0:38                           ` Chris Worley
2009-08-15  1:55                           ` Greg Freemyer
2009-08-15  1:55                             ` Greg Freemyer
2009-08-15  1:55                             ` Greg Freemyer
2009-08-15 13:20                           ` Mark Lord
2009-08-15 13:20                             ` Mark Lord
2009-08-16 22:52                             ` Chris Worley
2009-08-16 22:52                               ` Chris Worley
2009-08-17  2:03                               ` Mark Lord
2009-08-17  2:03                                 ` Mark Lord
2009-08-15 12:59                       ` James Bottomley
2009-08-15 12:59                         ` James Bottomley
2009-08-15 13:22                         ` Mark Lord
2009-08-15 13:22                           ` Mark Lord
2009-08-15 13:55                           ` James Bottomley
2009-08-15 13:55                             ` James Bottomley
2009-08-15 17:39                             ` jim owens
2009-08-15 17:39                               ` jim owens
2009-08-16 17:08                               ` Robert Hancock
2009-08-16 17:08                                 ` Robert Hancock
2009-08-16 14:05                             ` Alan Cox
2009-08-16 14:05                               ` Alan Cox
2009-08-16 14:16                               ` Mark Lord
2009-08-16 14:16                                 ` Mark Lord
2009-08-16 15:34                               ` Arjan van de Ven
2009-08-16 15:34                                 ` Arjan van de Ven
2009-08-16 15:44                                 ` Theodore Tso
2009-08-16 15:44                                   ` Theodore Tso
2009-08-16 17:28                                   ` Mark Lord
2009-08-16 17:28                                   ` Mark Lord
2009-08-16 17:28                                     ` Mark Lord
2009-08-16 17:37                                     ` Mark Lord
2009-08-16 17:37                                     ` Mark Lord
2009-08-16 17:37                                       ` Mark Lord
2009-08-16 17:37                                       ` Mark Lord
2009-08-17 16:30                                       ` Bill Davidsen
2009-08-17 16:30                                         ` Bill Davidsen
2009-08-17 16:56                                         ` jim owens
2009-08-17 16:56                                           ` jim owens
2009-08-17 17:14                                           ` Bill Davidsen
2009-08-17 17:14                                             ` Bill Davidsen
2009-08-17 17:37                                             ` jim owens
2009-08-17 17:37                                               ` jim owens
2009-08-16 17:37                                     ` Mark Lord
2009-08-16 17:37                                     ` Mark Lord
2009-08-16 17:28                                   ` Mark Lord
2009-08-16 17:28                                   ` Mark Lord [this message]
2009-08-16 15:52                                 ` James Bottomley
2009-08-16 15:52                                   ` James Bottomley
2009-08-16 16:32                                   ` Mark Lord
2009-08-16 16:32                                     ` Mark Lord
2009-08-16 16:32                                     ` Mark Lord
2009-08-16 18:07                                     ` James Bottomley
2009-08-16 18:07                                       ` James Bottomley
2009-08-16 18:19                                       ` Mark Lord
2009-08-16 18:19                                         ` Mark Lord
2009-08-16 18:19                                         ` Mark Lord
2009-08-16 18:24                                         ` James Bottomley
2009-08-16 18:24                                           ` James Bottomley
2009-08-17 16:37                                           ` Bill Davidsen
2009-08-17 16:37                                             ` Bill Davidsen
2009-08-17 16:37                                             ` Bill Davidsen
2009-08-17 17:08                                             ` Greg Freemyer
2009-08-17 17:08                                               ` Greg Freemyer
2009-08-17 17:19                                               ` James Bottomley
2009-08-17 17:19                                                 ` James Bottomley
2009-08-17 18:16                                                 ` Ric Wheeler
2009-08-17 18:16                                                   ` Ric Wheeler
2009-08-17 18:21                                                 ` Greg Freemyer
2009-08-17 18:21                                                   ` Greg Freemyer
2009-08-17 18:21                                                   ` Greg Freemyer
2009-08-17 19:18                                                   ` James Bottomley
2009-08-17 19:18                                                     ` James Bottomley
2009-08-17 20:19                                                     ` Mark Lord
2009-08-17 20:19                                                       ` Mark Lord
2009-08-17 20:28                                                       ` James Bottomley
2009-08-17 20:28                                                         ` James Bottomley
2009-08-17 20:28                                               ` Mark Lord
2009-08-17 20:28                                                 ` Mark Lord
2009-08-16 16:59                                   ` Christoph Hellwig
2009-08-16 16:59                                     ` Christoph Hellwig
2009-08-17  4:24                                     ` Douglas Gilbert
2009-08-17  4:24                                       ` Douglas Gilbert
2009-08-17 13:56                                     ` James Bottomley
2009-08-17 13:56                                       ` James Bottomley
2009-08-17 14:10                                       ` Matthew Wilcox
2009-08-17 14:10                                         ` Matthew Wilcox
2009-08-17 19:12                                         ` Christoph Hellwig
2009-08-17 19:12                                           ` Christoph Hellwig
2009-08-17 19:24                                           ` James Bottomley
2009-08-17 19:24                                             ` James Bottomley
2009-08-16 21:50                                   ` Discard support Roland Dreier
2009-08-16 21:50                                     ` Roland Dreier
2009-08-16 22:06                                     ` Jeff Garzik
2009-08-16 22:06                                       ` Jeff Garzik
2009-08-16 22:06                                       ` Jeff Garzik
2009-08-16 22:13                                     ` Theodore Tso
2009-08-16 22:13                                       ` Theodore Tso
2009-08-16 22:51                                       ` Mark Lord
2009-08-16 22:51                                         ` Mark Lord
2009-08-16 22:51                                       ` Mark Lord
2009-08-16 22:51                                       ` Mark Lord
2009-08-16 22:51                                       ` Mark Lord
2009-08-16 19:29                                 ` Discard support (was Re: [PATCH] swap: send callback when swap slot is freed) Alan Cox
2009-08-16 19:29                                   ` Alan Cox
2009-08-16 23:05                                   ` John Robinson
2009-08-16 23:05                                     ` John Robinson
2009-08-17  2:05                                     ` Mark Lord
2009-08-17  2:05                                       ` Mark Lord
2009-08-13 21:28             ` Greg Freemyer
2009-08-13 21:28               ` Greg Freemyer
2009-08-13 22:20               ` Richard Sharpe
2009-08-13 22:20                 ` Richard Sharpe
2009-08-13 22:20                 ` Richard Sharpe
2009-08-14  0:19                 ` Greg Freemyer
2009-08-14  0:19                   ` Greg Freemyer
     [not found]                   ` <46b8a8850908131758s781b07f6v2729483c0e50ae7a@mail.gmail.com>
2009-08-14 21:33                     ` Greg Freemyer
2009-08-14 21:33                       ` Greg Freemyer
2009-08-14 21:56                       ` Discard support Roland Dreier
2009-08-14 21:56                         ` Roland Dreier
2009-08-14 22:10                         ` Greg Freemyer
2009-08-14 22:10                           ` Greg Freemyer
2009-08-14 21:33                     ` Discard support (was Re: [PATCH] swap: send callback when swap slot is freed) Greg Freemyer
2009-08-14 21:33                     ` Greg Freemyer
2009-08-14 21:33                     ` Greg Freemyer
2009-08-13 17:19     ` Hugh Dickins
2009-08-13 17:19       ` Hugh Dickins
2009-08-13 18:08     ` Douglas Gilbert
2009-08-13 18:08       ` Douglas Gilbert
2009-08-17  2:55 ` [PATCH] swap: send callback when swap slot is freed KAMEZAWA Hiroyuki
2009-08-17  5:08   ` Nitin Gupta
2009-08-17  5:11     ` KAMEZAWA Hiroyuki
2009-08-22  7:34   ` Nai Xia

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='4A8841D7.10506__16178.1601178975$1250443777$gmane$org@rtr.ca' \
    --to=liml@rtr.ca \
    --cc=James.Bottomley@suse.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.