Re: [Yaffs] yaffs2 /proc nPageReads

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] yaffs2 /proc nPageReads
On Monday 27 August 2007 20:23:20 Siddharth Choudhuri wrote:
> > > I was looking at the nPageReads counter. It gets incremented inside of
> > > yaffs_ReadChunkFromNAND() function. Following the function call chain
> > > this could be in the following case (assuming page not in cache).
> > > yaffs_readpage() -> ... -> yaffs_ReadChunksWithTagsFromNAND(). Inside
> > > yaffs_ReadChunkFromNAND function there is the following if statement:
> > >
> > > if (dev->readChunkWithTagsFromNAND)
> > >     result = dev->readChunkWithTagsFromNAND();
> > > else
> > >     result = yaffs_TagsCompatabilityReadChunkWithTagsFromNAND();

> > >
> > > Now my question is why is nPageRead incremented in the else case [i.e.,
> > > else condition eventually calls yaffs_ReadChunkFromNAND() which
> > > increments nPageReads] and not in the if case. Looking at the source
> > > code, the if condition also leads to a function -
> > > nandmtd2_ReadChunkWithTagsFromNAND() which does a low level
> > > mtd->read().
> > >
> > > Am I missing something here ? Basically, I wanted a count of how many
> > > NAND read pages come from the file system and how many are due to flash
> > > management.
> >
> > No I don't think you are missing something. This is a low-flying bug.
> >
> > The history is that the read/write/erase counting were added a long while
> > ago for a once-off profiling exercise and was not kept current. Probably
> > should be fixed :-).
>
> Thanks for the info. I could investigate some more and may be update the
> profiling info. For nPageReads, does incrementing the counter for the else
> part [above] fix the bug ? These were the only two places where I found an
> entry point into lower level mtd page writes.


I think it is best to pull the counting out of the lower levels and just put
it in yaffs_nand.c:yaffs_ReadChunkWithTagsFromNAND(). That way there is no
duplication.

-- Charles