From manningc2@actrix.gen.nz Fri Feb 05 04:06:19 2010
Received: from smtp.firstline.co.nz ([203.167.210.162] helo=firstline.co.nz)
	by stoneboat.aleph1.co.uk with smtp (Exim 4.69)
	(envelope-from <manningc2@actrix.gen.nz>) id 1NdFSQ-00038h-92
	for yaffs@lists.aleph1.co.uk; Fri, 05 Feb 2010 04:06:19 +0000
Received: (qmail 30394 invoked by uid 453); 5 Feb 2010 04:06:02 -0000
X-Virus-Checked: Checked by ClamAV on firstline.co.nz
Received: from Unknown (HELO linux-dual-head.local) (10.14.210.25)
	by firstline.co.nz (qpsmtpd/0.40) with ESMTP;
	Fri, 05 Feb 2010 17:06:02 +1300
From: Charles Manning <manningc2@actrix.gen.nz>
To: yaffs@lists.aleph1.co.uk
Date: Fri, 5 Feb 2010 17:05:55 +1300
User-Agent: KMail/1.9.10
References: <F002782D89A542FBBB9005EFF1892825@johanxp>
	<201002031315.15318.manningc2@actrix.gen.nz>
	<1E649C6B5AD2421E8F058091B48989A0@johanxp>
In-Reply-To: <1E649C6B5AD2421E8F058091B48989A0@johanxp>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <201002051705.56126.manningc2@actrix.gen.nz>
X-SA-Exim-Connect-IP: 203.167.210.162
X-SA-Exim-Mail-From: manningc2@actrix.gen.nz
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	stoneboat.aleph1.co.uk
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=4.5 tests=AWL,BAYES_00,SPF_NEUTRAL
	autolearn=no version=3.2.5
X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000)
X-SA-Exim-Scanned: Yes (on stoneboat.aleph1.co.uk)
Subject: Re: [Yaffs] multithreading question
X-BeenThere: yaffs@lists.aleph1.co.uk
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: Discussion of YAFFS NAND flash filesystem <yaffs.lists.aleph1.co.uk>
List-Unsubscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/options/yaffs>,
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=unsubscribe>
List-Archive: <http://lists.aleph1.co.uk/lurker/list/yaffs.html>
List-Post: <mailto:yaffs@lists.aleph1.co.uk>
List-Help: <mailto:yaffs-request@lists.aleph1.co.uk?subject=help>
List-Subscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs>,
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=subscribe>
X-List-Received-Date: Fri, 05 Feb 2010 04:06:20 -0000

On Wednesday 03 February 2010 23:17:42 Johan Kotlinski wrote:
> Hi Charles!
>
> Thanks for your answer. Yes, I was talking about yaffs direct. Page-by-page
> locking is of course all right.
>
> I have another question. Our NAND chip has the ability to prefetch pages. I
> imagine we could benefit from this. Is there a way to get a hint from yaffs
> what it is about to read next? Or do you know some good place to insert
> such an optimization?
>
> Best regards,
> Johan
>
I have just checked in code which breaks up long reads and writes into smaller 
sub read/writes.

This has the advantage of reducing longing times.

Please give this a whirl if it is of interest to you.

-- Charles

 > ----- Original Message -----
> From: "Charles Manning" <manningc2@actrix.gen.nz>
> To: <yaffs@lists.aleph1.co.uk>
> Cc: "Johan Kotlinski" <johan@teenageengineering.com>
> Sent: Wednesday, February 03, 2010 1:15 AM
> Subject: Re: [Yaffs] multithreading question
>
> > On Tuesday 02 February 2010 00:29:17 Johan Kotlinski wrote:
> >> Hi!
> >> It appears that Yaffs2 multithreading protection is on a very high level
> >> (mutex wrapping entire fread/fwrite calls).
> >
> > Are you talking about yaffs direct or the Linux yaffs?
> > The linux yaffs will be locked on a page-by-page basis and I am going to
> > change the way yaffs direct does the reading/writing too to only lock on
> > a page-by-page basis.
> >
> > The underlying NAND is locked on a apge by page basis too (that's a
> > limitation
> > of the hardware), so is this really a big concern?
> >
> >> My worry is that if a low-priority task does a large fwrite call, it
> >> could
> >> block high-priority tasks for a long time. Is this an acknowledged
> >> problem?
> >
> > It depends on the OS. Some, without priority inhere, won't have this
> > problem.
> >
> >> Are there comparable file systems that handle multithreading in a more
> >> granular way?
>
> _______________________________________________
> yaffs mailing list
> yaffs@lists.aleph1.co.uk
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs




