public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Question regading Cleanmarker.
@ 2006-01-13 14:56 Nikhil
  2006-01-13 16:19 ` Josh Boyer
  0 siblings, 1 reply; 2+ messages in thread
From: Nikhil @ 2006-01-13 14:56 UTC (permalink / raw)
  To: linux-mtd


Hi all,

I am analysing the jffs2 methodology for updating the flash memory. I
understand that the jffs2_sb_info maintains three list i.e free_list,
clean_list and dirty_list.

the garbage collector acts on the blocks on the dirty_list and on erasing
those blocks writes a CLEANMARKER to the first 12 bytes indicating
succesful erase and move the block from dirty_list to free_list.

So all the blocks in the free_list are empty with first twelve bytes
having a CLEANMARKER. Whenever some node has to be written on the flash, a
block from the free_list is picked and written.

whether it will overwrite the CLEANMARKER bytes... if so then it has to
perform erase of the whole block again...

else the block is appended after the CLEANMARKER bytes... if so, then
after some time when this block moves from clean_list to dirty_list (by
some updations on the file data or else) how will the garbage collector
identify the block as clean/unclean as the the CLEANMARKER will be
present. 

whether the garbage collector neglects this CLEANMARKER when is it getting
updated or removed? else after some point of time, all the eraseblocks
will have a CLEANMARKER which will defeat the basic purpose of having a
CLEANMARKER.  
 
there is one more query about delayed write. What is the size of the
buffer which gets written on the flash? is it the page size or the erase
block size or is it a function of time?

Can you help in clearing my doubt?

-- 
Thanks & Regards

Nikhil Shirodkar
Project Engineer
NISG, CDAC

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

* Re: Question regading Cleanmarker.
  2006-01-13 14:56 Question regading Cleanmarker Nikhil
@ 2006-01-13 16:19 ` Josh Boyer
  0 siblings, 0 replies; 2+ messages in thread
From: Josh Boyer @ 2006-01-13 16:19 UTC (permalink / raw)
  To: Nikhil; +Cc: linux-mtd

On 1/13/06, Nikhil <nikhils@cdac.in> wrote:
>
> Hi all,
>
> I am analysing the jffs2 methodology for updating the flash memory. I
> understand that the jffs2_sb_info maintains three list i.e free_list,
> clean_list and dirty_list.

And the bad_list.

>
> the garbage collector acts on the blocks on the dirty_list and on erasing
> those blocks writes a CLEANMARKER to the first 12 bytes indicating
> succesful erase and move the block from dirty_list to free_list.
>

Yep.

> So all the blocks in the free_list are empty with first twelve bytes
> having a CLEANMARKER. Whenever some node has to be written on the flash, a
> block from the free_list is picked and written.

Yep.

>
> whether it will overwrite the CLEANMARKER bytes... if so then it has to
> perform erase of the whole block again...

No, it isn't erased again.

>
> else the block is appended after the CLEANMARKER bytes... if so, then
> after some time when this block moves from clean_list to dirty_list (by
> some updations on the file data or else) how will the garbage collector
> identify the block as clean/unclean as the the CLEANMARKER will be
> present.

The node for the cleanmarker is obsoleted.

>
> whether the garbage collector neglects this CLEANMARKER when is it getting
> updated or removed? else after some point of time, all the eraseblocks
> will have a CLEANMARKER which will defeat the basic purpose of having a
> CLEANMARKER.

It detects that it's obsoleted.  The garbage collector won't GC an
obsoleted node since that would be a waste of time.

> there is one more query about delayed write. What is the size of the
> buffer which gets written on the flash? is it the page size or the erase
> block size or is it a function of time?

The write buffer is used on NAND, DataFlash, and NOR flash with
transparent ECC.  For plain NOR flash (minus the new Sibley flashes)
the wbuf isn't used.  The size of the buffer depends on the chip.  For
NAND, it is the page size.  For NOR+ECC, it is the minimum write size
which is quite small.  I'm not sure about DataFlash or Sibley.

>
> Can you help in clearing my doubt?

Hope that helps.

josh

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

end of thread, other threads:[~2006-01-13 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-13 14:56 Question regading Cleanmarker Nikhil
2006-01-13 16:19 ` Josh Boyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox