public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@nokia.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] mmc: add an ioctl for erasing
Date: Mon, 31 May 2010 11:45:37 +0300	[thread overview]
Message-ID: <4C037731.5030301@nokia.com> (raw)
In-Reply-To: <20100521140714.GB15070@infradead.org>

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@nokia.com>
>> 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?

  reply	other threads:[~2010-05-31  8:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21 13:47 [RFC][PATCH] mmc: add an ioctl for erasing Adrian Hunter
2010-05-21 14:07 ` Christoph Hellwig
2010-05-31  8:45   ` Adrian Hunter [this message]
2010-05-31  8:47     ` Christoph Hellwig
2010-05-31  9:14       ` Adrian Hunter
2010-05-31 11:14         ` Adrian Hunter
2010-05-26  1:01 ` George G. Davis

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=4C037731.5030301@nokia.com \
    --to=adrian.hunter@nokia.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox