Re: [RFC][PATCH] mmc: add an ioctl for erasing

From: Adrian Hunter
Date: Mon May 31 2010 - 04:46:27 EST


Christoph Hellwig wrote:
On Fri, May 21, 2010 at 04:47:40PM +0300, Adrian Hunter wrote:
From f3baf566eb33a22bf12a48e4cdc7c99611bde934 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Date: Wed, 5 May 2010 14:07:55 +0300
Subject: [PATCH] mmc: add an ioctl for erasing

As SD and MMC cards have a NAND core, they can support an erase
operation that is typically 10x to 100x faster than writing.

In addition, eMMCv4.4 also offers:
o Secure Erase
o Trim
o Secure Trim

The "secure" variants also ensure that any copies of the data
(for example remnants of garbage collection) are also erased.

"Trim" is the same as "erase" except that individual sectors
can be erased instead of whole Erase Groups.

The Erase Operation and its variants are not supported by
default and drivers must set MMC_CAP_ERASE. This is because
the operation can take a long time and drivers that rely on
polling the status may perform very badly. Also drivers
may need changes to support the very long erase timeouts.

Please don't add new device specific ioctls. Just implement the
block layer discard operation to make the discard ioctl work on MMC
device. We can talk about adding a secure erase variant of it then.

Sorry for the slow reply, I have been away.

Connecting erase to discard was rejected for performance reasons in 2008.
Refer:

http://thread.gmane.org/gmane.linux.file-systems/25378/focus=25606


We may want to connect MMC trim to discard, but I suspect it might have the
same performance problems.

My requirement is to expose erase and secure erase to userspace. The discard
operation is not appropriate and the discard ioctl is too limited.

I could shift the ioctls to the block layer?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/