* ubifs wear leveling across entire device
@ 2009-12-03 17:31 twebb
2009-12-04 11:31 ` Adrian Hunter
0 siblings, 1 reply; 6+ messages in thread
From: twebb @ 2009-12-03 17:31 UTC (permalink / raw)
To: linux-mtd
I'm confused about how wear leveling occurs across the entire device
in the following example. Could someone help me understand what I'm
missing?
4 GiB flash device (nand MLC):
4 MTD partitions defined:
0 - "p1" - 0x00000000 - 0x00800000
1 - "p2" - 0x00800000 - 0x10000000
2 - "p3" - 0x10000000 - 0x80000000
3 - "p4" - 0x80000000 - 0x100000000
kernel args specify 3 ubi volumes:
ubi.mtd=p1 ubi.mtd=p2 ubi.mtd=p3
(p4 is reserved and no volumes or filesystems sit on top of it)
The "vol_size" for each of the ubi volumes (as specified in the
ubinize cfg file) is slightly less than the corresponding mtd
partition size. The volumes are specified as dynamic because they
need to be RW.
Thanks,
twebb
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ubifs wear leveling across entire device
2009-12-03 17:31 ubifs wear leveling across entire device twebb
@ 2009-12-04 11:31 ` Adrian Hunter
2009-12-07 15:41 ` twebb
0 siblings, 1 reply; 6+ messages in thread
From: Adrian Hunter @ 2009-12-04 11:31 UTC (permalink / raw)
To: twebb; +Cc: linux-mtd@lists.infradead.org
twebb wrote:
> I'm confused about how wear leveling occurs across the entire device
> in the following example. Could someone help me understand what I'm
> missing?
>
> 4 GiB flash device (nand MLC):
> 4 MTD partitions defined:
> 0 - "p1" - 0x00000000 - 0x00800000
> 1 - "p2" - 0x00800000 - 0x10000000
> 2 - "p3" - 0x10000000 - 0x80000000
> 3 - "p4" - 0x80000000 - 0x100000000
>
> kernel args specify 3 ubi volumes:
> ubi.mtd=p1 ubi.mtd=p2 ubi.mtd=p3
> (p4 is reserved and no volumes or filesystems sit on top of it)
That is 3 UBI devices not 3 UBI volumes
>
> The "vol_size" for each of the ubi volumes (as specified in the
> ubinize cfg file) is slightly less than the corresponding mtd
> partition size. The volumes are specified as dynamic because they
> need to be RW.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ubifs wear leveling across entire device
2009-12-04 11:31 ` Adrian Hunter
@ 2009-12-07 15:41 ` twebb
2009-12-07 20:05 ` Adrian Hunter
0 siblings, 1 reply; 6+ messages in thread
From: twebb @ 2009-12-07 15:41 UTC (permalink / raw)
To: Adrian Hunter; +Cc: linux-mtd@lists.infradead.org
>>
>> I'm confused about how wear leveling occurs across the entire device
>> in the following example. Could someone help me understand what I'm
>> missing?
>>
>> 4 GiB flash device (nand MLC):
>> 4 MTD partitions defined:
>> 0 - "p1" - 0x00000000 - 0x00800000
>> 1 - "p2" - 0x00800000 - 0x10000000
>> 2 - "p3" - 0x10000000 - 0x80000000
>> 3 - "p4" - 0x80000000 - 0x100000000
>>
>> kernel args specify 3 ubi volumes:
>> ubi.mtd=p1 ubi.mtd=p2 ubi.mtd=p3
>> (p4 is reserved and no volumes or filesystems sit on top of it)
>
> That is 3 UBI devices not 3 UBI volumes
>
Excuse me. I'm new to using UBI and UBIFS and am not completely
familiar with the terminology. I think what I described in the
example is 3 UBI devices, with a single volume associated with each
device. I had neglected to show that each UBI device had a single
volume.
Maybe there's a better way to word my question. Does UBI wear
leveling occur independently across each MTD device (p1, p2, and p3
only in example above) or does it somehow occur over the entire
physical device (p1-p4 inclusive)?
I'm trying to understand this so I can determine how to partition the
physical device to provide the best wear leveling, while still
allowing a portion of the physical device (p4) to exist outside of any
UBI device or volume.
Thanks,
twebb
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ubifs wear leveling across entire device
2009-12-07 15:41 ` twebb
@ 2009-12-07 20:05 ` Adrian Hunter
2009-12-07 22:44 ` twebb
0 siblings, 1 reply; 6+ messages in thread
From: Adrian Hunter @ 2009-12-07 20:05 UTC (permalink / raw)
To: twebb; +Cc: linux-mtd@lists.infradead.org
twebb wrote:
>>> I'm confused about how wear leveling occurs across the entire device
>>> in the following example. Could someone help me understand what I'm
>>> missing?
>>>
>>> 4 GiB flash device (nand MLC):
>>> 4 MTD partitions defined:
>>> 0 - "p1" - 0x00000000 - 0x00800000
>>> 1 - "p2" - 0x00800000 - 0x10000000
>>> 2 - "p3" - 0x10000000 - 0x80000000
>>> 3 - "p4" - 0x80000000 - 0x100000000
>>>
>>> kernel args specify 3 ubi volumes:
>>> ubi.mtd=p1 ubi.mtd=p2 ubi.mtd=p3
>>> (p4 is reserved and no volumes or filesystems sit on top of it)
>> That is 3 UBI devices not 3 UBI volumes
>>
>
> Excuse me. I'm new to using UBI and UBIFS and am not completely
> familiar with the terminology. I think what I described in the
> example is 3 UBI devices, with a single volume associated with each
> device. I had neglected to show that each UBI device had a single
> volume.
>
> Maybe there's a better way to word my question. Does UBI wear
> leveling occur independently across each MTD device (p1, p2, and p3
> only in example above) or does it somehow occur over the entire
> physical device (p1-p4 inclusive)?
>
> I'm trying to understand this so I can determine how to partition the
> physical device to provide the best wear leveling, while still
> allowing a portion of the physical device (p4) to exist outside of any
> UBI device or volume.
Wear-levelling occurs within a single UBI device which is generally
a single MTD partition.
You need 1 MTD partition and 1 UBI device with 3 volumes. Make the
3 volumes total less than the whole UBI device and you can add a 4th
volume later.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ubifs wear leveling across entire device
2009-12-07 20:05 ` Adrian Hunter
@ 2009-12-07 22:44 ` twebb
2009-12-08 6:36 ` Artem Bityutskiy
0 siblings, 1 reply; 6+ messages in thread
From: twebb @ 2009-12-07 22:44 UTC (permalink / raw)
To: Adrian Hunter; +Cc: linux-mtd@lists.infradead.org
>
> Wear-levelling occurs within a single UBI device which is generally
> a single MTD partition.
>
> You need 1 MTD partition and 1 UBI device with 3 volumes. Make the
> 3 volumes total less than the whole UBI device and you can add a 4th
> volume later.
>
If I make 1 MTD partition and 1 corresponding UBI device, should (can)
it include areas that will never be accessed via UBI-aware tools? For
example, is it safe to have on a 4GB physical device a single 4GB MTD
partition with a single corresponding UBI device, but only 3GB of the
4GB device contain N UBI volumes only accessed via appropriate UBI
user-space (or u-boot) tools while the remaining 1GB of the 4GB is
accessed with mtd-utils?
There are two reasons for this approach:
1 - to (hopefully) get the benefits of wear leveling across the entire
physical device (though I think this may not work in the scenario I've
described)
2 - to allow access to a portion of the flash by non-UBI aware code
I assume the alternative (w/o the benefit of wear leveling across the
entire device) is to define 2 MTD partitions: 1 for "non-UBI" access
and 1 for a single UBI device with multiple UBI volumes?
Thanks,
twebb
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: ubifs wear leveling across entire device
2009-12-07 22:44 ` twebb
@ 2009-12-08 6:36 ` Artem Bityutskiy
0 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2009-12-08 6:36 UTC (permalink / raw)
To: twebb; +Cc: linux-mtd@lists.infradead.org, Adrian Hunter
On Mon, 2009-12-07 at 17:44 -0500, twebb wrote:
> >
> > Wear-levelling occurs within a single UBI device which is generally
> > a single MTD partition.
> >
> > You need 1 MTD partition and 1 UBI device with 3 volumes. Make the
> > 3 volumes total less than the whole UBI device and you can add a 4th
> > volume later.
> >
>
> If I make 1 MTD partition and 1 corresponding UBI device, should (can)
> it include areas that will never be accessed via UBI-aware tools? For
> example, is it safe to have on a 4GB physical device a single 4GB MTD
> partition with a single corresponding UBI device, but only 3GB of the
> 4GB device contain N UBI volumes only accessed via appropriate UBI
> user-space (or u-boot) tools while the remaining 1GB of the 4GB is
> accessed with mtd-utils?
This contradicts to what you originally asked for. "Give me
wear-levelling across whole device, but do not touch this 1GiB".
> There are two reasons for this approach:
> 1 - to (hopefully) get the benefits of wear leveling across the entire
> physical device (though I think this may not work in the scenario I've
> described)
If you want untouched 1 GiB, make 3GiB + 1GiB partitions, give 3GiB to
UBI.
> 2 - to allow access to a portion of the flash by non-UBI aware code
>
> I assume the alternative (w/o the benefit of wear leveling across the
> entire device) is to define 2 MTD partitions: 1 for "non-UBI" access
> and 1 for a single UBI device with multiple UBI volumes?
Yes.
Also, you can emulate MTD devices on top of UBI volumes, so you can use
many of the MTD tools in linux.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-12-08 6:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03 17:31 ubifs wear leveling across entire device twebb
2009-12-04 11:31 ` Adrian Hunter
2009-12-07 15:41 ` twebb
2009-12-07 20:05 ` Adrian Hunter
2009-12-07 22:44 ` twebb
2009-12-08 6:36 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox