All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v4] UBI: Fastmap support (aka checkpointing)
@ 2012-05-15 17:11 ` Richard Weinberger
  0 siblings, 0 replies; 68+ messages in thread
From: Richard Weinberger @ 2012-05-15 17:11 UTC (permalink / raw)
  To: linux-mtd; +Cc: tglx, dedekind1, linux-kernel, Heinz.Egger, tim.bird

v1: https://lwn.net/Articles/481612/
v2: https://lwn.net/Articles/496586/
v3: Didn't release it to linux-mtd

Changes since v1:
        - renamed it to UBIVIS (at least in Kconfig)
        - UBIVIS parameters are now configurable via Kconfig
        - several bugs have been fixed (design and implementation bugs)
        - added lots of comments to make the review process easier
        - made checkpatch.pl happy

Changes since v2:
        - minor bugs have been fixed
        - renamed it to UBI fastmap (as Artem requested)

Changes since v3:
        - changed the on-flash layout (added padding fields, turned the
          EBA storage into an array)
        - fixed some corner cases (the protection queue needed some extra work)
	- removed the data type hint logic
	- rebased to Artems mtd tree

[PATCH 1/7] [RFC] UBI: Export next_sqnum()
[PATCH 2/7] [RFC] UBI: Export compare_lebs()
[PATCH 3/7] [RFC] UBI: Add fastmap on-flash layout
[PATCH 4/7] [RFC] UBI: Add fastmap structs to ubi_device
[PATCH 5/7] [RFC] UBI: Make wl subsystem fastmap aware
[PATCH 6/7] [RFC] UBI: Implement fastmapping support
[PATCH 7/7] [RFC] UBI: Wire up fastmap support

git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubi2.git ubi2/v4

Some benchmark numbers:

4GiB NAND
Erase block size: 1MiB
Page size: 4096
Total PEBs: 4081*

Attach method   Time**          #scanned PEBs
---------------------------------------------
scanning        0m4.568s        4081
fastmap         0m0.486s        3


2GiB NAND
Erase block size: 1MiB
Page size: 4096
Total PEBs: 2062*

Attach method   Time            #scanned PEBs
---------------------------------------------
scanning        0m2.440s        2062
fastmap         0m0.439s        3


1GiB NAND
Erase block size: 1MiB
Page size: 4096
Total PEBs: 1038*

Attach method   Time            #scanned PEBs
---------------------------------------------
scanning        0m1.351s        1038
fastmap         0m0.422s        4


We observe that attaching by scanning depends on the total size N of the UBI
device.It has a complexity of O(N).
Whereas attaching by fastmap has a nearly constant attaching time.
In the best case fastmap has to scan only one PEB.
This case can happen if the complete fastmap fits into one PEB, the fastmap
super block is the first PEB on the MTD partition and the fastmap pool is empty.
On the other side, in the worst case fastmap has to scan UBI_FM_MAX_START +
UBI_FM_MAX_BLOCKS + UBI_FM_MAX_POOL_SIZE PEBs.
With the current default settings this would be 192 PEBs.
So, attaching via fastmap has a complexity of O(1).
I think we can reduce UBI_FM_MAX_BLOCKS and UBI_FM_MAX_POOL_SIZE to a much
smaller value. On most real NAND chips the whole fastmap fits into one PEB.

TODO:
        - Artem is fully happy with the current on-flash layout,
          maybe I can merge the erase counters into the EBA table
        - Get a full review :)

Thanks,
//richard

*) Didn't use the full NAND for UBI because Kernel, U-Boot, DT needed also
some space.

**) Time was taken by: "time ubiattach -m 5"

^ permalink raw reply	[flat|nested] 68+ messages in thread
* [RFC v5] UBI: Fastmap support (aka checkpointing)
@ 2012-05-16 20:51 Richard Weinberger
  2012-05-16 20:52   ` Richard Weinberger
  0 siblings, 1 reply; 68+ messages in thread
From: Richard Weinberger @ 2012-05-16 20:51 UTC (permalink / raw)
  To: linux-mtd; +Cc: tglx, dedekind1, linux-kernel, Heinz.Egger, tim.bird

This is a bug-fix release. v4 handled static volumes wrong.
v6 will address everything that Artem pointed out.

v1: https://lwn.net/Articles/481612/
v2: https://lwn.net/Articles/496586/
v3: Didn't release it to linux-mtd
v4: http://article.gmane.org/gmane.linux.kernel/1297626

Changes since v1:
       - renamed it to UBIVIS (at least in Kconfig)
       - UBIVIS parameters are now configurable via Kconfig
       - several bugs have been fixed (design and implementation bugs)
       - added lots of comments to make the review process easier
       - made checkpatch.pl happy

Changes since v2:
       - minor bugs have been fixed
       - renamed it to UBI fastmap (as Artem requested)

Changes since v3:
       - changed the on-flash layout (added padding fields, turned the
         EBA storage into an array)
       - fixed some corner cases (the protection queue needed some extra work)
       - removed the data type hint logic
       - rebased to Artems mtd tree

Changes since v4:
       - fixed static volume handling (used_ebs and last_data_bytes contained
         bad values in some cases)
	
git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubi2.git ubi2/v5

[PATCH 1/7] [RFC] UBI: Export next_sqnum()
[PATCH 2/7] [RFC] UBI: Export compare_lebs()
[PATCH 3/7] [RFC] UBI: Add fastmap on-flash layout
[PATCH 4/7] [RFC] UBI: Add fastmap structs to ubi_device
[PATCH 5/7] [RFC] UBI: Make wl subsystem fastmap aware
[PATCH 6/7] [RFC] UBI: Implement fastmapping support
[PATCH 7/7] [RFC] UBI: Wire up fastmap support

Thanks,
//richard

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

end of thread, other threads:[~2012-05-22 10:55 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 17:11 [RFC v4] UBI: Fastmap support (aka checkpointing) Richard Weinberger
2012-05-15 17:11 ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 1/7] [RFC] UBI: Export next_sqnum() Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-16 13:01   ` Artem Bityutskiy
2012-05-16 13:01     ` Artem Bityutskiy
2012-05-21 13:34     ` Richard Weinberger
2012-05-21 13:34       ` Richard Weinberger
2012-05-21 14:00       ` Artem Bityutskiy
2012-05-21 14:00         ` Artem Bityutskiy
2012-05-21 14:16         ` Richard Weinberger
2012-05-21 14:16           ` Richard Weinberger
2012-05-22  8:23           ` Artem Bityutskiy
2012-05-22  8:23             ` Artem Bityutskiy
2012-05-22 10:58       ` Artem Bityutskiy
2012-05-22 10:58         ` Artem Bityutskiy
2012-05-16 14:03   ` Shmulik Ladkani
2012-05-16 14:03     ` Shmulik Ladkani
2012-05-16 14:27     ` Artem Bityutskiy
2012-05-16 14:27       ` Artem Bityutskiy
2012-05-17  9:45       ` Shmulik Ladkani
2012-05-17  9:45         ` Shmulik Ladkani
2012-05-17 11:44         ` Artem Bityutskiy
2012-05-17 11:44           ` Artem Bityutskiy
2012-05-17 11:47           ` Richard Weinberger
2012-05-17 11:47             ` Richard Weinberger
2012-05-17 12:34             ` Artem Bityutskiy
2012-05-17 12:34               ` Artem Bityutskiy
2012-05-15 17:11 ` [PATCH 2/7] [RFC] UBI: Export compare_lebs() Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-16 14:09   ` Shmulik Ladkani
2012-05-16 14:09     ` Shmulik Ladkani
2012-05-15 17:11 ` [PATCH 3/7] [RFC] UBI: Add fastmap on-flash layout Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 4/7] [RFC] UBI: Add fastmap structs to ubi_device Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 5/7] [RFC] UBI: Make wl subsystem fastmap aware Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 6/7] [RFC] UBI: Implement fastmapping support Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:11 ` [PATCH 7/7] [RFC] UBI: Wire up fastmap support Richard Weinberger
2012-05-15 17:11   ` Richard Weinberger
2012-05-15 17:48 ` [RFC v4] UBI: Fastmap support (aka checkpointing) Subodh Nijsure
2012-05-15 17:48   ` Subodh Nijsure
2012-05-15 18:10   ` Richard Weinberger
2012-05-15 18:10     ` Richard Weinberger
2012-05-15 18:02 ` Richard Weinberger
2012-05-15 18:02   ` Richard Weinberger
2012-05-15 19:46 ` Shmulik Ladkani
2012-05-15 19:46   ` Shmulik Ladkani
2012-05-16  6:54   ` Fastmap - please, review and test Artem Bityutskiy
2012-05-16  6:54     ` Artem Bityutskiy
2012-05-16 11:51     ` Richard Weinberger
2012-05-16 11:51       ` Richard Weinberger
2012-05-16  9:38 ` [RFC v4] UBI: Fastmap support (aka checkpointing) Artem Bityutskiy
2012-05-16  9:38   ` Artem Bityutskiy
2012-05-16  9:42   ` Artem Bityutskiy
2012-05-16  9:42     ` Artem Bityutskiy
2012-05-16 10:50   ` Richard Weinberger
2012-05-16 10:50     ` Richard Weinberger
2012-05-16 11:09     ` Artem Bityutskiy
2012-05-16 11:09       ` Artem Bityutskiy
2012-05-16 11:18       ` Artem Bityutskiy
2012-05-16 11:18         ` Artem Bityutskiy
2012-05-16 11:29         ` Richard Weinberger
2012-05-16 11:29           ` Richard Weinberger
2012-05-16 20:51 [RFC v5] " Richard Weinberger
2012-05-16 20:52 ` [PATCH 5/7] [RFC] UBI: Make wl subsystem fastmap aware Richard Weinberger
2012-05-16 20:52   ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.