linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: Encrypted NAND flash over UBI performance bench marking
       [not found] <CABJ+KKvj4VDUvqTnj+dWf8+qzhK5hhvacdx551JbzmUQye4biA@mail.gmail.com>
@ 2016-04-22  8:40 ` Richard Weinberger
       [not found]   ` <CABJ+KKvaVX9HMtFYjOnOwW1xHxw5v9ecZs+SFdJYsCmtLNOKiw@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Weinberger @ 2016-04-22  8:40 UTC (permalink / raw)
  To: Benson Young, linux-mtd, Ezequiel Garcia

Am 22.04.2016 um 10:19 schrieb Benson Young:
> Hello Ezequiel and everyone, 
> 
> I was trying full disk encryption using dm-crypt + LUKS on my embedded linux running on unmanaged SLC NAND flash. 
> I have tried Ezequiel's ubiblock patch 
> http://linux-mtd.infradead.narkive.com/YF0XOFxY/block-device-emulation-on-top-of-ubi-volumes-with-read-write-support
> So the way I went about was
> SLC NAND flash -> MTD -> UBI with ubiblock support -> dm-crypt + LUKS -> EXT4 
> and it appeared to work nicely.

Except that your kernel stack consumption is huge and you wear out the NAND.
Also ext4 does not know NAND and will issue a lot of writes and syncs to UBIFS
which has to write on the NAND.
Sure, it is better than using ext4 directly on top of ubiblock but still...

[...]

> My questions:
> 1. Why such a huge difference in speed performance? (especially write) Shouldn't EXT4 over UBI be faster than EXT4 over loopbacked file in UBIFS?

UBI is not a FTL. ubiblock write support is everything but perfect.
Also be aware of that fact that it will wear out your NAND very soonish.

> 2. some of the figures are weird, especially read speed where the throughput can reach 100+MB/s, SLC NAND flash's maximum theoretical read speed is around 23MB/s so is this the
> work of CPU cache?

Not sure which ubiblock version you are using but AFACT it does caching.
i.e. it will always read the whole LEB and then keep it in memory.
Maybe Ezequiel can tell more.
Same for loopback (page cache). This would explain the read numbers.

> 3. Is iozone the right tool for bench marking MTD based file systems?

Yes and no. We don't have special tools for that.
As with all benchmark tools you need to know what you do. :-)
Often a plain dd works best.

> In another thread, Richard has mentioned a side project for UBIFS encryption
>> Regarding encryption, encryption for UBIFS is in the pipes, Dave and I did already some preliminary
>> work. It will materialize within this year, depending on how much we get distracted by other projects.
>> So far it is a spare time project. The plan is adding file level encryption like ext4 and f2fs have.
> 
> is that based on Artem's ubifs patch?
> http://lists.infradead.org/pipermail/linux-mtd/2012-April/040659.html
> or its something else entirely?

It is something differently. The plan was to do it like f2fs and ext4 do.
I hope it will materialize soon. I got (again *sigh*) interrupted by other projects.

Thanks,
//richard

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fwd: Encrypted NAND flash over UBI performance bench marking
       [not found]     ` <OFC23048C2.C6508474-ON48257F9D.003136DE-48257F9D.00338EFE@sercomm.com>
@ 2016-04-22 12:43       ` Richard Weinberger
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2016-04-22 12:43 UTC (permalink / raw)
  To: benson_young; +Cc: Benson Young, linux-mtd, Ezequiel Garcia

Am 22.04.2016 um 11:23 schrieb benson_young@sercomm.com:
> Hi Richard,
> 
> If my applications within the EXT4 rootfs do not write on a very regular basis, and setting noatimein
> mount option. will I still have NAND thrashing problem? i.e. the file system itself will try to
> update/journal/sync on a very regular basis (something like 30 second buffer flush)? As you can see
> my knowledge with EXT4 and most file systems are very limited.

You mean ext4 on top of a loopback file on UBIFS?
I don't think it will be a big problem. But to be sure do some tests. :-)
UBI exports ec counter stats in sysfs.

Thanks,
//richard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-22 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CABJ+KKvj4VDUvqTnj+dWf8+qzhK5hhvacdx551JbzmUQye4biA@mail.gmail.com>
2016-04-22  8:40 ` Encrypted NAND flash over UBI performance bench marking Richard Weinberger
     [not found]   ` <CABJ+KKvaVX9HMtFYjOnOwW1xHxw5v9ecZs+SFdJYsCmtLNOKiw@mail.gmail.com>
     [not found]     ` <OFC23048C2.C6508474-ON48257F9D.003136DE-48257F9D.00338EFE@sercomm.com>
2016-04-22 12:43       ` Fwd: " Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).