jffs2_scan_make_ino_cache() in scan.c very slow
Joakim Tjernlund
joakim.tjernlund at lumentis.se
Thu Feb 21 10:34:55 EST 2002
> >
> >
> >
> > joakim.tjernlund at lumentis.se said:
> > > I have made some crude measures in jffs2_scan_medium() and friends to
> > > see where most of the time is spent. It turns out that
> > > jffs2_scan_make_ino_cache() is takes about 50 % of the total mount
> > > time!
> >
> > How did you do your profiling?
> I accumulated the difference of jiffies from the entry of jffs2_scan_make_ino_cache()
> to it returned.
>
> Are you sure it's not spending the time in
> > jffs2_get_ino_cache() and jffs2_add_ino_cache()? I suspect it is.
>
> That is so, allmost all time is in jffs2_get_ino_cache().
>
> >
> > > What can be done to decrease this time?
> >
> > Try increasing INOCACHE_HASHSIZE - that'll make the hash table more
> > efficient - well, it'll make the hash table into a hash table instead of a
> > linked list :)
> >
> > You'll probably find that it's looking up the same inode over and over
> > again too - in which case caching the last used inode in
> > jffs2_scan_make_ino_cache() would probably be useful.
>
> OK, will try an see what happens.
Setting INOCACHE_HASHSIZE to 14(higher values makes it PANIC at mount, don't know
why) and changed the beginning of jffs2_scan_make_ino_cache() to
{
static struct jffs2_inode_cache *ic = NULL;
if(ic && ic->ino == ino)
return ic;
...
is it OK to make *ic an static variable?
Now my mount time is just half of what it used to be!!(well almost :-)
More information about the linux-mtd
mailing list