* A question about UBIFS
@ 2008-06-11 4:16 Zhao Forrest
2008-06-11 6:34 ` Adrian Hunter
2008-06-16 6:42 ` Artem Bityutskiy
0 siblings, 2 replies; 7+ messages in thread
From: Zhao Forrest @ 2008-06-11 4:16 UTC (permalink / raw)
To: Artem.Bityutskiy; +Cc: linux-mtd
Hi Artem,
I have a basic question about NAND flash page update in UBIFS/UBI,
take the following as an example:
1 a NAND flash with page size of 4KB, erase block size of 256KB, so
there're 64 pages within an erase block
2 page 0 - page 10 has invalid data content, page 11 - page 63 has
valid data content from FS's point of view
3 UBIFS attempts to update(or rewrite) page 11
My question is how page 11 is updated by UBIFS/UBI?
I only read the design docs of UBI and guess that for this particular
case a new physical eraseblock is got by UBI, then new content of page
11 is written to page 11 of new physical eraseblock, page 12 - page 63
in original physical eraseblock are copied to new physical eraseblock,
lastly the mapping between logical eraseblock and physical eraseblock
is updated. Am I right?
I know I omit many details in UBIFS/UBI for this updating operation.
I'd like to know the cost of rewrite in UBIFS/UBI.
Thanks,
Forrest
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: A question about UBIFS
2008-06-11 4:16 A question about UBIFS Zhao Forrest
@ 2008-06-11 6:34 ` Adrian Hunter
2008-06-11 7:56 ` Zhao Forrest
2008-06-16 6:42 ` Artem Bityutskiy
1 sibling, 1 reply; 7+ messages in thread
From: Adrian Hunter @ 2008-06-11 6:34 UTC (permalink / raw)
To: Zhao Forrest; +Cc: Artem.Bityutskiy, linux-mtd
Zhao Forrest wrote:
> Hi Artem,
Artem is on holiday til next week.
> I have a basic question about NAND flash page update in UBIFS/UBI,
> take the following as an example:
> 1 a NAND flash with page size of 4KB, erase block size of 256KB, so
> there're 64 pages within an erase block
> 2 page 0 - page 10 has invalid data content, page 11 - page 63 has
> valid data content from FS's point of view
> 3 UBIFS attempts to update(or rewrite) page 11
UBIFS does out-of-place updates. It never tries to update or rewrite
page 11. (Well, except in very rare circumstances that are not worth
going into)
> My question is how page 11 is updated by UBIFS/UBI?
As far as UBIFS goes, you need to learn about wandering trees and
garbage collection.
> I only read the design docs of UBI and guess that for this particular
> case a new physical eraseblock is got by UBI, then new content of page
> 11 is written to page 11 of new physical eraseblock, page 12 - page 63
> in original physical eraseblock are copied to new physical eraseblock,
> lastly the mapping between logical eraseblock and physical eraseblock
> is updated. Am I right?
Not for UBIFS.
> I know I omit many details in UBIFS/UBI for this updating operation.
> I'd like to know the cost of rewrite in UBIFS/UBI.
UBIFS rewrite is typically better than even JFFS2 - see
http://osl.sed.hu/wiki/ubifs/index.php/IOzone
Of course that assumes you are sync.ing the data. UBIFS has writeback
which means rewrites will be much faster if you do not need to have
the data sync'ed.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: A question about UBIFS
2008-06-11 6:34 ` Adrian Hunter
@ 2008-06-11 7:56 ` Zhao Forrest
2008-06-11 8:19 ` Nancy
0 siblings, 1 reply; 7+ messages in thread
From: Zhao Forrest @ 2008-06-11 7:56 UTC (permalink / raw)
To: Adrian Hunter; +Cc: Artem.Bityutskiy, linux-mtd
>
>> My question is how page 11 is updated by UBIFS/UBI?
>
> As far as UBIFS goes, you need to learn about wandering trees and
> garbage collection.
This question is just out of my curiosity and not related to this topic.
Do you know if there is any FTL implemented by firmware doing the
out-of-place updating? Maybe this is too complexed to be implemented
by firmware?
Thanks,
Forrest
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: A question about UBIFS
2008-06-11 7:56 ` Zhao Forrest
@ 2008-06-11 8:19 ` Nancy
0 siblings, 0 replies; 7+ messages in thread
From: Nancy @ 2008-06-11 8:19 UTC (permalink / raw)
To: Zhao Forrest; +Cc: Artem.Bityutskiy, linux-mtd, Adrian Hunter
On 6/11/08, Zhao Forrest <forrest.zhao@gmail.com> wrote:
> >
> >> My question is how page 11 is updated by UBIFS/UBI?
> >
> > As far as UBIFS goes, you need to learn about wandering trees and
> > garbage collection.
>
> This question is just out of my curiosity and not related to this topic.
> Do you know if there is any FTL implemented by firmware doing the
> out-of-place updating? Maybe this is too complexed to be implemented
> by firmware?
JFFS2, UBIFS can do that "out-of-place" updating, cause they are
file-system, they know what is validate data what is trash (should be
managed by garbage collection).
In FTL layer, you have no way to know, no way to differ validate and
trash. even no way to differ what is filesystem meta data what is file
content data. In FTL layer, there's no way to interperet the data. But
if you do some special FTL, eg. FTL only for FAT filesystem, and you
are good at How FAT implemet in Linux, maybe you can do that. That's
really hard :-)
--
Best wishes,
Nancy
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: A question about UBIFS
2008-06-11 4:16 A question about UBIFS Zhao Forrest
2008-06-11 6:34 ` Adrian Hunter
@ 2008-06-16 6:42 ` Artem Bityutskiy
2008-06-16 7:16 ` Zhao Forrest
1 sibling, 1 reply; 7+ messages in thread
From: Artem Bityutskiy @ 2008-06-16 6:42 UTC (permalink / raw)
To: Zhao Forrest; +Cc: linux-mtd
Hi,
Zhao Forrest wrote:
> Hi Artem,
> I have a basic question about NAND flash page update in UBIFS/UBI,
> take the following as an example:
> 1 a NAND flash with page size of 4KB, erase block size of 256KB, so
> there're 64 pages within an erase block
> 2 page 0 - page 10 has invalid data content, page 11 - page 63 has
> valid data content from FS's point of view
> 3 UBIFS attempts to update(or rewrite) page 11
> My question is how page 11 is updated by UBIFS/UBI?
> I only read the design docs of UBI and guess that for this particular
> case a new physical eraseblock is got by UBI, then new content of page
> 11 is written to page 11 of new physical eraseblock, page 12 - page 63
> in original physical eraseblock are copied to new physical eraseblock,
> lastly the mapping between logical eraseblock and physical eraseblock
> is updated. Am I right?
Right. All updates are out-of-place.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: A question about UBIFS
2008-06-16 6:42 ` Artem Bityutskiy
@ 2008-06-16 7:16 ` Zhao Forrest
2008-06-16 9:21 ` Artem Bityutskiy
0 siblings, 1 reply; 7+ messages in thread
From: Zhao Forrest @ 2008-06-16 7:16 UTC (permalink / raw)
To: Artem.Bityutskiy; +Cc: linux-mtd
On Mon, Jun 16, 2008 at 2:42 PM, Artem Bityutskiy
<Artem.Bityutskiy@nokia.com> wrote:
> Hi,
>
> Zhao Forrest wrote:
>>
>> Hi Artem,
>> I have a basic question about NAND flash page update in UBIFS/UBI,
>> take the following as an example:
>> 1 a NAND flash with page size of 4KB, erase block size of 256KB, so
>> there're 64 pages within an erase block
>> 2 page 0 - page 10 has invalid data content, page 11 - page 63 has
>> valid data content from FS's point of view
>> 3 UBIFS attempts to update(or rewrite) page 11
>> My question is how page 11 is updated by UBIFS/UBI?
>> I only read the design docs of UBI and guess that for this particular
>> case a new physical eraseblock is got by UBI, then new content of page
>> 11 is written to page 11 of new physical eraseblock, page 12 - page 63
>> in original physical eraseblock are copied to new physical eraseblock,
>> lastly the mapping between logical eraseblock and physical eraseblock
>> is updated. Am I right?
>
> Right. All updates are out-of-place.
>
So when only page 11 is rewritten, are pages 12-63 rewritten at the same time?
Or page 11 is updated by wandering tree mechanism, and pages 12-63 are
untouched?
Thanks,
Forrest
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: A question about UBIFS
2008-06-16 7:16 ` Zhao Forrest
@ 2008-06-16 9:21 ` Artem Bityutskiy
0 siblings, 0 replies; 7+ messages in thread
From: Artem Bityutskiy @ 2008-06-16 9:21 UTC (permalink / raw)
To: Zhao Forrest; +Cc: linux-mtd
Zhao Forrest wrote:
>> Zhao Forrest wrote:
>>> Hi Artem,
>>> I have a basic question about NAND flash page update in UBIFS/UBI,
>>> take the following as an example:
>>> 1 a NAND flash with page size of 4KB, erase block size of 256KB, so
>>> there're 64 pages within an erase block
>>> 2 page 0 - page 10 has invalid data content, page 11 - page 63 has
>>> valid data content from FS's point of view
>>> 3 UBIFS attempts to update(or rewrite) page 11
>>> My question is how page 11 is updated by UBIFS/UBI?
>>> I only read the design docs of UBI and guess that for this particular
>>> case a new physical eraseblock is got by UBI, then new content of page
>>> 11 is written to page 11 of new physical eraseblock, page 12 - page 63
>>> in original physical eraseblock are copied to new physical eraseblock,
>>> lastly the mapping between logical eraseblock and physical eraseblock
>>> is updated. Am I right?
>> Right. All updates are out-of-place.
>>
> So when only page 11 is rewritten, are pages 12-63 rewritten at the same time?
> Or page 11 is updated by wandering tree mechanism, and pages 12-63 are
> untouched?
The latter (12-63 are untouched).
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-06-16 9:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-11 4:16 A question about UBIFS Zhao Forrest
2008-06-11 6:34 ` Adrian Hunter
2008-06-11 7:56 ` Zhao Forrest
2008-06-11 8:19 ` Nancy
2008-06-16 6:42 ` Artem Bityutskiy
2008-06-16 7:16 ` Zhao Forrest
2008-06-16 9:21 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox