[Yaffs-archive] Re: newbie to yaffs -->locking

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: Steve Tsai, 'Charles Manning'
CC: yaffs
Old-Topics: [Yaffs-archive] RE: newbie to yaffs
Subject: [Yaffs-archive] Re: newbie to yaffs -->locking
Right now yaffs uses gross locking on the file system. Only one thread can be
in yaffs at a time. For most cases this is not a significant problem since
the underlying NAND is locked per operation anyway.

There are two cases where yaffs can lock "for a long time" if the generic
read/write interface is used:
* Delete file: YAFFS locks while the whole file deletes (approx 0.5 secs for
a 1MB file).
* Resize a file: Resizing from say 1MB to 0 will take approx 0.5 secs.

I have code in development to do background file deletion. This spreads the
deletion load over the next n write operations.

I am reluctant to add finer grain locking yet since this complicates the
code. I don't think the payback is warranted yet (ie. more important things
to do).

-- CHarles



On Fri, 13 Sep 2002 17:22, Steve Tsai wrote:
> I rollback yaffs_fs.c to revision 1.12, and it have not the problem 1
> and 2. Right now yaffs will lock the fs when program write data to it
> and other program will be blocked to read data from yaffs. How can I
> improve it?
>
> Steve Tsai
>
> > -----Original Message-----
> > From: Charles Manning [mailto:Charles.Manning@trimble.co.nz]
> > Sent: Thursday, September 12, 2002 5:20 AM
> > To: 'Steve Tsai '; ' '
> > Subject: RE: newbie to yaffs
> >
> >
> > Steve
> >
> > Great to see someone exploring yaffs from a new angle (ie. uCLinux).
> >
> > I'm using a poxy webmail client right now, so please forgive
> > the format of my response.
> >
> >
> > Steve wrote:
> > I am using uClinux 2.4.17 on my ARM board and I used JFFS2 before. I
> > tried to put YAFFS to the kernal tree and use it on my system. After
> > compiling, I can mount YAFFS and access the file system, but
> > I have few
> > problems about yaffs.
> >
> > 1. When I mount yaffs, the mount function will return
> > none-zero value,
> > but it mounts successfully. I try to hack sys_mount, but it
> > return zero. [Charles] Thanx I will investigate.
> >
> > 2. I do the following steps and got some errors.
> >           mount -t yaffs /dev/mtdblock1 /mnt
> >           cd /mnt
> >           mkdir test
> >            cd test
> >             -- kernel BUG at dcache.h:247       //dget()
> >             -- kernel BUG at dcache.c:129       //dput()

> >
> >     How can I trace the problem.
> > [Charles] There are some remaining issues in the vfs
> > interface that I'm working on at present. I suggest that you
> > try roll back to version 1.12 of yaffs_fs.c this might work better.

> >
> > 3. I found the nBlocks have to be set as the value that is
> > power of 2.
> > Why? I have to set the MTD partition to 16Mbytes to fit the
> > value and I
> > set the partition to 31Mbytes before. I think it constrains
> > the size of
> > the MTD partition.
> > [Charles] This is a problem that I am aware of need to
> > address. For now it is important to set dev->nBlocks to the
> > next power of 2 greater than
> > dev->endBlock.
> >
> > Good like, feel free to ask and give comments.
> >
> > -- Charles
>
> ---------------------------------------------------------------------------
>------------ This mailing list is hosted by Toby Churchill open software
> (www.toby-churchill.org). If mailing list membership is no longer wanted
> you can remove yourself from the list by sending an email to
> with the text "unsubscribe" (without the
> quotes) as the subject.



---------------------------------------------------------------------------------------
This mailing list is hosted by Toby Churchill open software (www.toby-churchill.org).
If mailing list membership is no longer wanted you can remove yourself from the list by
sending an email to with the text "unsubscribe"
(without the quotes) as the subject.