public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: Nick Garnett <nickg@ecoscentric.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "ecos-devel@ecos.sourceware.org" <ecos-devel@ecos.sourceware.org>
Subject: Re: NAND review
Date: Mon, 29 Jun 2009 11:09:00 -0000	[thread overview]
Message-ID: <m3ljnb5ma5.fsf@xl5.calivar.com> (raw)
In-Reply-To: <20090619074659.GA1188@lunn.ch>

Andrew Lunn <andrew@lunn.ch> writes:

> We don't need to follow the disk driver approach to partitioning. As
> Ross said, he used the name "partition" because he could not think of
> a better name. However the name does not imply we need to follow the
> normal ways for partitions. All we need is a suitable API which is
> efficient when used with partitions and without partitions.

I wasn't suggesting we follow the disk driver approach. In fact I was
using it as an example of an approach that we should not use.

> 
> > I believe that an API that is partition-aware from the start is
> > preferable.
> 
> and i prefer an API which works well with and without partitions. 

Unless I have misunderstood, you appear to be criticizing the
eCosCentric design because it makes partitioning an explicit part of
the API. My point was that any API that attempts to conceal the
presence of partitions will quickly tie iteslf in knots when the need
for such things arises. I don't believe that a partition-aware API is
particularly high overhead, a handful of extra instructions per API
routine and a few extra words per data structure. With a little
judicious ifdeffery, it can be almost totally eliminated for the
single partition case.

To paraphrase Einstein: We should make an API as simple a possible,
but not simpler than it needs to be.

> Looking at the existing use cases we know about, the systems which
> don't need partitions are the ones with the most resource
> constrains. Simon does not need partitions, he plans to use a very
> lean and mean FS, and only has a small amount of ROM and RAM. With
> Ross's API there is the partitions data structure in the HAL, the code
> to get this out of the HAL and into the flash library, the extra
> function call needed to get a partition handle, and then the checks
> used to validate addresses are inside the partition. I've no idea how
> much this adds up to in terms of code and data, so i've no idea how
> big the overhead is.

My contention is that this overhead would be minimal if the NAND
system could be configured into a single partition mode. Then, a lot
of these checks get collapsed to nothing in the source, or get
optimized away by the compiler.

> If you have a dedicates partition, sized about right for the kernel,
> level wearing brings you nothing. There are no hot blocks in the
> kernel image, you replace it all every time. And how often do you
> replace the kernel? During development work, maybe quite often, but
> once the system is deployed, rarely. What is the typical life of a
> block? 10000 erases? A developer may conceivably replace the kernel
> 10,000 times, but in a deployed product i doubt this will happen. So i
> say forget about wear leveling for this case.

Exact figures for NAND reliability are hard to find. The 100,000 erase
cycle guarantee often only applies to the first block. My
understanding of NAND is that the design of the cells makes them less
reliable that NOR cells. Any cell may go bad, or read back invalid, at
any time, not just after some predefined number of erase cycles,
albeit with lower probability early in the device's lifetime. So
software must keep CRCs and handle bad blocks. The manufacturers
exploit this existing requirement to raise yield by allowing parts
with factory bad blocks to be sold to customers.

So, while most of the time you can get away with a simple approach,
every so often you will encounter a device that has cells that go bad
very quickly. Unless you have a way of working around this, you may
end up with an unusable board.

> 
> For me, dynamic partitions make sense. I'm not saying that release 1.0
> needs to have them, we just need to make sure that the design of
> release 1.0 is sufficiently flexible that adding dynamic partitions is
> just a release 1.1 feature and not a rip the guts out and start again
> for release 2.0.

I'm less convinced that dynamic partitions are necessary or useful. I
don't believe YAFFS, or any other NAND filesystem, can handle its
partition being resized or relocated and having the positions of bad
blocks change under it feet. The same would apply to any other piece
of software that was NAND aware.

Without an existing common mechanism for defining partitions in Linux,
we have to fall into line with what happens there. The majority of
drivers seem to define fixed static blocks. While we could come up
with a definition of a partitioning scheme and promote it in the Linux
world, experience suggests that this would be something of an uphill
struggle. I know people who have spent years trying to get stuff
accepted.

Your final point is exactly the one I have been trying to make. We
should not be jumping in and specifying partitioning mechanisms right
now. I think we need to gather more experience with NAND before we do
that.  Ross's design permits any sort of partioning mechanism to be
defined; at present only one, a CDL-based static partitioning, is
implemented. I also believe that by making partioning explicit in the
API, we keep the design flexible for the future.

-- 
Nick Garnett                                       eCos Kernel Architect
eCosCentric Limited    http://www.eCosCentric.com       The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales:                         Reg No: 4422071

  parent reply	other threads:[~2009-06-29 11:09 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19  8:27 Simon Kallweit
2009-05-19 13:47 ` Ross Younger
2009-05-19 14:17   ` Andrew Lunn
2009-05-20 13:24     ` Bart Veer
2009-05-20 13:34       ` Rutger Hofman
2009-05-20 13:53         ` Andrew Lunn
2009-05-20 13:56           ` Gary Thomas
2009-05-20 14:22             ` Andrew Lunn
2009-05-20 15:22               ` Andrew Lunn
2009-05-20 15:34               ` Bart Veer
2009-05-20 13:58           ` Rutger Hofman
2009-05-20 14:16     ` Ross Younger
2009-05-20 14:21       ` Gary Thomas
2009-05-20 15:25         ` Ross Younger
2009-05-20 15:37           ` Gary Thomas
2009-05-19 16:29 ` Andrew Lunn
2009-06-03  8:51   ` Andrew Lunn
2009-06-03 10:21     ` Ross Younger
2009-06-03 10:48       ` Andrew Lunn
2009-06-03 11:52         ` Simon Kallweit
2009-06-03 12:26         ` Rutger Hofman
2009-06-03 13:33     ` Jürgen Lambrecht
2009-06-10 17:39     ` Nick Garnett
2009-06-11 11:25       ` Rutger Hofman
2009-06-13 16:31       ` Andrew Lunn
2009-06-18 14:10         ` Nick Garnett
2009-06-19  7:47           ` Andrew Lunn
2009-06-19 14:14             ` Ross Younger
2009-06-19 15:02               ` Andrew Lunn
2009-06-19 16:54               ` Jürgen Lambrecht
2009-06-29 11:09             ` Nick Garnett [this message]
2009-06-19  8:07           ` Andrew Lunn
2009-06-19 11:37             ` Daniel Morris
2009-06-19 12:06               ` Andrew Lunn
2009-05-20  1:02 ` Jonathan Larmour
2009-05-20  7:11   ` Simon Kallweit
2009-05-20 11:12     ` Rutger Hofman
2009-05-20 11:29       ` Simon Kallweit
2009-05-20 13:37         ` Rutger Hofman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ljnb5ma5.fsf@xl5.calivar.com \
    --to=nickg@ecoscentric.com \
    --cc=andrew@lunn.ch \
    --cc=ecos-devel@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).