* NAND pages cache?
@ 2004-11-15 8:49 Artem Bityuckiy
2004-11-15 8:49 ` David Woodhouse
0 siblings, 1 reply; 6+ messages in thread
From: Artem Bityuckiy @ 2004-11-15 8:49 UTC (permalink / raw)
To: linux-mtd
Hello,
It is known that MTD always reads/writes in fractions of the whole NAND
pages. An this is right I believe.
But while working with JFFS2, I have mentioned that very often it reads
the same page several times consequently. This happens for example, when
JFFS2 performs Garbage Collection, and there are several small nodes in
the NAND page. Thus, when JFFS2 reads these nodes, it re-reads the same
NAND page several times. This is bad.
So, the obvious idea how to avoid this is to introduce something like
NAND pages cache. The cache will keep several NAND pages which were last
accessed.
Obviously, this will require at least one more page buffer copy
operation and, for example, will only decrease the sequential read speed.
So, It is possible to introduce calls like:
nand_read_buffered
nand_read_unbuffered
I don not know is it good to do this only in JFFS2 or on the MTD NAND layer?
Comments?
Thanks.
--
Best regards, Artem B. Bityuckiy
Oktet Labs (St. Petersburg), Software Engineer.
+78124286709 (office) +79112449030 (mobile)
E-mail: dedekind@oktetlabs.ru, web: http://www.oktetlabs.ru
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: NAND pages cache?
2004-11-15 8:49 NAND pages cache? Artem Bityuckiy
@ 2004-11-15 8:49 ` David Woodhouse
2004-11-15 9:22 ` Thomas Gleixner
0 siblings, 1 reply; 6+ messages in thread
From: David Woodhouse @ 2004-11-15 8:49 UTC (permalink / raw)
To: dedekind; +Cc: linux-mtd
On Mon, 2004-11-15 at 11:49 +0300, Artem Bityuckiy wrote:
> So, the obvious idea how to avoid this is to introduce something like
> NAND pages cache. The cache will keep several NAND pages which were last
> accessed.
>
> I don not know is it good to do this only in JFFS2 or on the MTD NAND layer?
I thought we already did this in the MTD NAND layer, since we had to
read whole pages there to do ECC anyway. Thomas?
--
dwmw2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: NAND pages cache?
2004-11-15 8:49 ` David Woodhouse
@ 2004-11-15 9:22 ` Thomas Gleixner
2004-11-15 9:43 ` Artem Bityuckiy
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2004-11-15 9:22 UTC (permalink / raw)
To: David Woodhouse; +Cc: dedekind, linux-mtd
On Mon, 2004-11-15 at 08:49 +0000, David Woodhouse wrote:
> On Mon, 2004-11-15 at 11:49 +0300, Artem Bityuckiy wrote:
> > So, the obvious idea how to avoid this is to introduce something like
> > NAND pages cache. The cache will keep several NAND pages which were last
> > accessed.
> >
> > I don not know is it good to do this only in JFFS2 or on the MTD NAND layer?
>
> I thought we already did this in the MTD NAND layer, since we had to
> read whole pages there to do ECC anyway. Thomas?
We do caching only if a page is read partially. If we read a full page
we read directly into the fs buffer.
The partial reads happen when we read nodes. The full page reads happen
when we read data. That's sufficient and captures most of the double
reads on the same page.
tglx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: NAND pages cache?
2004-11-15 9:22 ` Thomas Gleixner
@ 2004-11-15 9:43 ` Artem Bityuckiy
2004-11-15 9:57 ` Thomas Gleixner
0 siblings, 1 reply; 6+ messages in thread
From: Artem Bityuckiy @ 2004-11-15 9:43 UTC (permalink / raw)
To: tglx; +Cc: linux-mtd, David Woodhouse
Thomas Gleixner wrote:
> On Mon, 2004-11-15 at 08:49 +0000, David Woodhouse wrote:
>
>>On Mon, 2004-11-15 at 11:49 +0300, Artem Bityuckiy wrote:
>>
>>>So, the obvious idea how to avoid this is to introduce something like
>>>NAND pages cache. The cache will keep several NAND pages which were last
>>>accessed.
>>>
>>>I don not know is it good to do this only in JFFS2 or on the MTD NAND layer?
>>
>>I thought we already did this in the MTD NAND layer, since we had to
>>read whole pages there to do ECC anyway. Thomas?
>
>
> We do caching only if a page is read partially. If we read a full page
> we read directly into the fs buffer.
>
> The partial reads happen when we read nodes. The full page reads happen
> when we read data. That's sufficient and captures most of the double
> reads on the same page.
>
> tglx
Hmm, It seems I do not know something about MTD. I thought it *always*
reads whole
pages in orger to always check ECC... I'll see this more close.
Ok, thanks for comment.
--
Best regards, Artem B. Bityuckiy
Oktet Labs (St. Petersburg), Software Engineer.
+78124286709 (office) +79112449030 (mobile)
E-mail: dedekind@oktetlabs.ru, web: http://www.oktetlabs.ru
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: NAND pages cache?
2004-11-15 9:43 ` Artem Bityuckiy
@ 2004-11-15 9:57 ` Thomas Gleixner
2004-11-15 10:07 ` Artem Bityuckiy
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2004-11-15 9:57 UTC (permalink / raw)
To: dedekind; +Cc: David Woodhouse, linux-mtd
On Mon, 2004-11-15 at 12:43 +0300, Artem Bityuckiy wrote:
> Thomas Gleixner wrote:
> > On Mon, 2004-11-15 at 08:49 +0000, David Woodhouse wrote:
> >
> >>On Mon, 2004-11-15 at 11:49 +0300, Artem Bityuckiy wrote:
> >>
> >>>So, the obvious idea how to avoid this is to introduce something like
> >>>NAND pages cache. The cache will keep several NAND pages which were last
> >>>accessed.
> >>>
> >>>I don not know is it good to do this only in JFFS2 or on the MTD NAND layer?
> >>
> >>I thought we already did this in the MTD NAND layer, since we had to
> >>read whole pages there to do ECC anyway. Thomas?
> >
> >
> > We do caching only if a page is read partially. If we read a full page
> > we read directly into the fs buffer.
> >
> > The partial reads happen when we read nodes. The full page reads happen
> > when we read data. That's sufficient and captures most of the double
> > reads on the same page.
> >
> > tglx
> Hmm, It seems I do not know something about MTD. I thought it *always*
> reads whole
> pages in orger to always check ECC... I'll see this more close.
The nand driver always reads whole pages due to ECC. But if the fs
driver requests only a part of the page then the page is read into the
cache buffer of the nand driver, ECC is checked and the part which was
requested by the fs driver is copied into the fs buffer. If the next
read requests another part of this page then we read out of the cache
buffer instead of reading the FLASH again.
tglx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: NAND pages cache?
2004-11-15 9:57 ` Thomas Gleixner
@ 2004-11-15 10:07 ` Artem Bityuckiy
0 siblings, 0 replies; 6+ messages in thread
From: Artem Bityuckiy @ 2004-11-15 10:07 UTC (permalink / raw)
To: tglx; +Cc: David Woodhouse, linux-mtd
Thomas Gleixner wrote:
> The nand driver always reads whole pages due to ECC. But if the fs
> driver requests only a part of the page then the page is read into the
> cache buffer of the nand driver, ECC is checked and the part which was
> requested by the fs driver is copied into the fs buffer. If the next
> read requests another part of this page then we read out of the cache
> buffer instead of reading the FLASH again.
>
> tglx
O, thank you for the hint!
--
Best regards, Artem B. Bityuckiy
Oktet Labs (St. Petersburg), Software Engineer.
+78124286709 (office) +79112449030 (mobile)
E-mail: dedekind@oktetlabs.ru, web: http://www.oktetlabs.ru
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-11-15 10:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-15 8:49 NAND pages cache? Artem Bityuckiy
2004-11-15 8:49 ` David Woodhouse
2004-11-15 9:22 ` Thomas Gleixner
2004-11-15 9:43 ` Artem Bityuckiy
2004-11-15 9:57 ` Thomas Gleixner
2004-11-15 10:07 ` Artem Bityuckiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox