Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Gleixner
Date: Monday, March 19, 2007 - 5:42 pm

On Mon, 2007-03-19 at 17:32 -0500, Matt Mackall wrote:

It appears to be, but it is not. You enforce semantics on a device,
which it does not have.


There is a huge difference. Disk block size is 512 byte and FLASH block
size is min 16KiB and up to 256KiB.

Just do the math:

Write sampling data streams in 2KiB chunks to your uber devicemapper on
a 1GiB device with 64KiB erase block size:

Fine grained FLASH aware writes allow 32 chunks in a block without
erasing the block.

Your method erases the block 32 times to write the same amount of data.

Result: You wear out the flash 32 times faster. Cool feature.


We can do it under _any_ circumstances and that _does_ change it.
Implementing a clever block device layer on top of UBI is simple and
would provide FLASH page sized I/O, i.e. 2Kib in the above example.


I'm impressed. How exactly are "some tapes" comparable to FLASH chips ?

Your next proposal is to throw away MTD-utils and use "mt" instead ?


No, it is not. You get the absolute sector address of your second stage
and this is a complete nobrainer. The translation is done in the DISK
device.

You simply ignore the fact, that inside each disk, USB Stick, CF-CARD,
whatever - there is a more or less intellegent controller device, which
does the mapping to the physical storage location. There is _NO_ such
thing on a bare FLASH chip.

It does not matter, whether your embedded device had more NAND space
than my old CP/M machines floppy. It simply matters, that even the old
CP/M floppy device had some rudimentary intellence on board.

Furthermore I want to be able to get the bitflip correction on my second
stage loader / kernel in the same safe way as we do it for everything
else and still be able to bootstrap that from an extremly small
bootloader.


How exactly does device mapper:

A) across device wear levelling ?
B) dynamic partitioning for FLASH aware file systems ?
C) across device wear levelling for FLASH aware file systems ?
D) background bit-flip corrections (copying affected blocks and recylce
the old one) ?
E) allow position independent placement of the second stage bootloader ?


Yes, it is in your picture, but:

1) it excludes FLASH aware file systems and UBI does not.
2) your picture does still not explain how it does achive the above A),
B), C), D) and E)

Your extra path for partitioning(4) and JFFS2 is just a weird hack,
which makes your proposal completely absurd.



Let me draw an UBI picture:

                                   VFS -Layer
                                       |               
                             (Future VFS-crypto)			
                            /                    \
                           |                      |
          ______ device mapper / fs               |
        /                 |                       |
      /                   |                       |
     |          Do whatever you don't             |
     |          want to do with FLASH             |
     |          whether it makes sense            |
     |          or not.                           |
     |                     |                      |
Block layer   UBI block device    Flash aware filesystems
     |                      \    /
   device                    \  /
   driver                      |
     |                         |
_____|_______                  |
|           |                  |
| Device    |                 UBI
| resident  |                  |
| "UBI"     |                  |
|___________|                  |
                               |                     
                            MTD-CORE
                               |      
                       nand base driver
                    /          |         \
             device driver  device driver  device driver
                   |              |
                 NAND            NAND          NAND

No notes: it's simple and self explaining.


Oh well, a seperate bad block remapper. And how is the logical mapping
of wear levelled erase blocks done ?


And how is the wear levelling done on this logical device in
devicemapper ? 

How is ensured, that the wear average is maintained also across the
partitions which are used by JFFS2 or other FLASH aware filesystems ?


LogFS can easily leverage UBI's wear algorithm.


1. On top of a clever block device.

2. UBI can do snapshots by design.

3. Encryption should be done on the VFS layer and not below the
filesystem layer. Doing it inside the block layer or the device mapper
is broken by design.


You still did not explain how devicemapper does:

- across device wear levelling
- dynamic partitioning for FLASH aware file systems
- across device wear levelling for FLASH aware file systems
- simple boot loader support
- fine grained I/O

UBI is not devicemappers little brother. It is the software version of
the silicon in a CF-CARD / USB-Stick, but it does a better job and
allows clever usage of FLASH aside of enforcing eraseblock sized I/O
units. Does your CF-Card / USB-Stick do that ? 

Just think about the 1GiB USB stick, which would present you 64KiB I/O
units instead of 2KiB ones.

Your signature is a nice intellectual signboard, but the ancient simple
rule of three just tells me, that you are off by factor 32.

	tglx


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Wed Mar 14, 8:19 am)
[PATCH 01/22 take 3] UBI: on-flash data structures header, Artem Bityutskiy, (Wed Mar 14, 8:19 am)
[PATCH 02/22 take 3] UBI: user-space API header, Artem Bityutskiy, (Wed Mar 14, 8:19 am)
[PATCH 03/22 take 3] UBI: kernel-space API header, Artem Bityutskiy, (Wed Mar 14, 8:19 am)
[PATCH 04/22 take 3] UBI: internal header, Artem Bityutskiy, (Wed Mar 14, 8:19 am)
[PATCH 05/22 take 3] UBI: startup code, Artem Bityutskiy, (Wed Mar 14, 8:19 am)
[PATCH 06/22 take 3] UBI: scanning unit, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 07/22 take 3] UBI: I/O unit, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 08/22 take 3] UBI: volume table unit, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 09/22 take 3] UBI: wear-leveling unit, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 10/22 take 3] UBI: EBA unit, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 11/22 take 3] UBI: user-interfaces unit, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 12/22 take 3] UBI: update functionality, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 13/22 take 3] UBI: accounting unit, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 14/22 take 3] UBI: volume management functionality, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 15/22 take 3] UBI: sysfs functionality, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 16/22 take 3] UBI: character devices functionality, Artem Bityutskiy, (Wed Mar 14, 8:20 am)
[PATCH 17/22 take 3] UBI: gluebi functionality, Artem Bityutskiy, (Wed Mar 14, 8:21 am)
[PATCH 18/22 take 3] UBI: misc stuff, Artem Bityutskiy, (Wed Mar 14, 8:21 am)
[PATCH 19/22 take 3] UBI: debugging stuff, Artem Bityutskiy, (Wed Mar 14, 8:21 am)
[PATCH 20/22 take 3] UBI: JFFS2 UBI support, Artem Bityutskiy, (Wed Mar 14, 8:21 am)
[PATCH 21/22 take 3] UBI: update MAINTAINERS, Artem Bityutskiy, (Wed Mar 14, 8:21 am)
[PATCH 22/22 take 3] UBI: Linux build integration, Artem Bityutskiy, (Wed Mar 14, 8:21 am)
Re: [PATCH 10/22 take 3] UBI: EBA unit, Andrew Morton, (Thu Mar 15, 12:07 pm)
Re: [PATCH 10/22 take 3] UBI: EBA unit, Randy Dunlap, (Thu Mar 15, 2:24 pm)
Re: [PATCH 10/22 take 3] UBI: EBA unit, Josh Boyer, (Thu Mar 15, 4:29 pm)
Re: [PATCH 10/22 take 3] UBI: EBA unit, Randy Dunlap, (Thu Mar 15, 6:49 pm)
Re: [PATCH 10/22 take 3] UBI: EBA unit, Artem Bityutskiy, (Fri Mar 16, 3:14 am)
Re: [PATCH 10/22 take 3] UBI: EBA unit, Artem Bityutskiy, (Fri Mar 16, 3:21 am)
Re: [PATCH 10/22 take 3] UBI: EBA unit, Artem Bityutskiy, (Fri Mar 16, 3:23 am)
Re: [PATCH 10/22 take 3] UBI: EBA unit, Randy Dunlap, (Fri Mar 16, 7:55 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Matt Mackall, (Sun Mar 18, 9:27 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Sun Mar 18, 9:49 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Matt Mackall, (Sun Mar 18, 12:18 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Josh Boyer, (Sun Mar 18, 1:31 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Matt Mackall, (Mon Mar 19, 10:08 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Josh Boyer, (Mon Mar 19, 11:16 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Thomas Gleixner, (Mon Mar 19, 12:03 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Matt Mackall, (Mon Mar 19, 12:54 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Matt Mackall, (Mon Mar 19, 1:12 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Mon Mar 19, 1:18 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Thomas Gleixner, (Mon Mar 19, 2:04 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Thomas Gleixner, (Mon Mar 19, 2:05 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Mon Mar 19, 2:06 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Matt Mackall, (Mon Mar 19, 2:36 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Matt Mackall, (Mon Mar 19, 3:32 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Thomas Gleixner, (Mon Mar 19, 5:42 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Thomas Gleixner, (Mon Mar 19, 5:43 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Matt Mackall, (Mon Mar 19, 6:05 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Thomas Gleixner, (Mon Mar 19, 11:28 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Josh Boyer, (Tue Mar 20, 5:13 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Tue Mar 20, 5:25 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Theodore Tso, (Tue Mar 20, 6:52 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Tue Mar 20, 8:14 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Josh Boyer, (Tue Mar 20, 8:59 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, David Lang, (Tue Mar 20, 11:58 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Tue Mar 20, 1:05 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, David Woodhouse, (Tue Mar 20, 2:32 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, David Woodhouse, (Tue Mar 20, 2:36 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Theodore Tso, (Tue Mar 20, 3:03 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Wed Mar 21, 1:44 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Wed Mar 21, 1:54 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Thomas Gleixner, (Wed Mar 21, 4:25 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Wed Mar 21, 4:36 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Thomas Gleixner, (Wed Mar 21, 4:57 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Wed Mar 21, 5:39 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Theodore Tso, (Wed Mar 21, 6:50 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Josh Boyer, (Wed Mar 21, 6:59 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Wed Mar 21, 7:02 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Frank Haverkamp, (Wed Mar 21, 8:38 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, David Lang, (Wed Mar 21, 1:26 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, David Lang, (Sun Mar 25, 2:49 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, David Woodhouse, (Sun Mar 25, 4:46 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, David Woodhouse, (Sun Mar 25, 5:21 pm)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, David Woodhouse, (Mon Mar 26, 2:45 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Thomas Gleixner, (Mon Mar 26, 3:02 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, David Woodhouse, (Mon Mar 26, 3:07 am)
Re: [PATCH 00/22 take 3] UBI: Unsorted Block Images, Artem Bityutskiy, (Mon Mar 26, 3:49 am)