All of lore.kernel.org
 help / color / mirror / Atom feed
* The problem that trim is malfunction at the present of DM-layer
@ 2014-07-22 13:05 Chia-Hung Chang
  0 siblings, 0 replies; only message in thread
From: Chia-Hung Chang @ 2014-07-22 13:05 UTC (permalink / raw)
  To: linux-raid

List, good morning,
   A Trim command allows an operating system to inform a solid-state
drive (SSD) which blocks of data are no longer considered in use and
can be wiped internally.  In linux, we can use fstrim to discard all
unused blocks in the filesystem. The requests issued from fstrim are
called discard requests. The amount of blocks that are no longer in
use in a discard request is called 'size of the discard request' in
the following context.

  After tracing the code, I found Raid 5/6 only process the discard
requests where size > Chunk_size * disk_num. In my environment, I use
4 disk to build raid 5. So, the discard requests can only been
processed if its size is larger than 512k*3=1.5MB. In my environment,
I have a DM-layer, thin-provisioning, in between Ext4 and raid5. The
data block of thin-provisioning is set to 1MB. So, the discard
requests will be break into several small requests with size <=1MB in
the DM-layer. Consequently, all discard requests will not be processed
in raid5. In this kind of architecture, there won't be any discard
request arrived disks.

  I have an idea to solve the problem. For requests with size <
Chunk_size * disk_num, we don't ignore it. On the contrary, the raid5
driver find corresponding stripes of the requests and process it just
like write requests. For write requests, if a stripe doesn't have
R5_OVERWRITE flag in all data disks, it waits in delayed_list for a
while. For discard requests, if a stripe doesn't have R5_OVERWRITE
flag in all data disks, it waits in another list, said
discard_delayed_list, for a while too. If other discard requests come,
the stripe may have chance to be covered by several requests and be
submitted to the disks. If time-out, the stripe will be throw away. My
question is how to decide 'time-out'. Does anyone have any suggestion?

Sincerely,
Fred

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-22 13:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22 13:05 The problem that trim is malfunction at the present of DM-layer Chia-Hung Chang

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.