Re: Software RAID and TRIM

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

 



On 19/07/2011 15:41, Lutz Vieweg wrote:
On 07/19/2011 12:22 PM, David Brown wrote:
Because of those effects on the block-IO-queue, the user-space
work-around we implemented to discard the SSDs our RAID-1s consist of
will not discard "one area on all SSDs at a time", but rather iterate
first through all unused areas on one SSD, then iterate through the
same list of areas on the second SSD.

Do you take the arrays off-line during this process, or at least make
them read-only?

No, we keep them online and writeable.

If not, how do you ensure that the lists are valid?

The discard procedure works by..:

- use SYS_fallocate to allocate the free space on the device (minus
some safety margin for the writes that will happen during the procedure)
for a temporary file (notice that with fallocate on XFS, you can
allocate space for a file without actually ever writing to it)

- use ioctl FIEMAP to get a list of the logical blocks that were
allocated

- use ioctl BLKDISCARD to discard these blocks

- remove the temporary file

Since the blocks to discard are allocated for the temporary
file during the procedure, they will not be used otherwise.

Obviously, we would still prefer using "fstrim", because then
there would be no need for that temporary file, the "safety margin"
and a temporary high fill level of the filesystem.

Regards,

Lutz Vieweg


It certainly sounds like a safe procedure, but I can see why you feel it's not quite as elegant as it could be. You will also be "discarding" blocks that have never been written (at least, not since the last discard...) - is there much overhead in that?


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


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux