* UBIFS: How to reserve space to be used right before power cut
@ 2013-06-13 11:42 Helmut Raiger
2013-06-13 11:50 ` Matthieu CASTET
0 siblings, 1 reply; 6+ messages in thread
From: Helmut Raiger @ 2013-06-13 11:42 UTC (permalink / raw)
To: linux-mtd
Hi,
we try the following:
1) setup some data in an 8kByte block in RAM
2) frequently modify this data during normal operation
3) on a power fail signal write the block to a file on an UBIFS partition
4) recover from the written data after the power cut
The time between power failure notification and the uP-reset is
guaranteed by hardware
and is about 20ms.
We first thought about using fallocate() to allocate a corresponding
block on the partition
but soon found that UBIFS does not implement a native fallocate() and
thus the generic
one simply wrote the file to 8k of zeros. This of course will not help.
Simply fsync()ing the file in case of a power cut does not seem
reliable, for
- the file system might be full
- write back cache operation may interfere with the synch-ing of our file
- the garbage collector might run to free dirty LEBs and erase the
corresponding PEBs
The latter 2 overstretching our timing requirements.
This is on an embedded system (i.mx31, arm1136@532MHz) running Linux
3.something
(we are quite flexible in adapting new kernel versions), currently
testing on 3.0.45.
Could someone hint the course to follow for this szenario?
Any pointers appreciated,
Helmut
--
Scanned by MailScanner.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: How to reserve space to be used right before power cut
2013-06-13 11:42 UBIFS: How to reserve space to be used right before power cut Helmut Raiger
@ 2013-06-13 11:50 ` Matthieu CASTET
2013-06-13 13:29 ` Raiger Helmut
0 siblings, 1 reply; 6+ messages in thread
From: Matthieu CASTET @ 2013-06-13 11:50 UTC (permalink / raw)
To: Helmut Raiger; +Cc: linux-mtd@lists.infradead.org
Hi,
Why do you do this in ubifs ?
If you do it in ubi/mtd this will be a lot's of easier.
Matthieu
Le Thu, 13 Jun 2013 12:42:18 +0100,
Helmut Raiger <helmut.raiger@hale.at> a écrit :
> Hi,
>
> we try the following:
>
> 1) setup some data in an 8kByte block in RAM
> 2) frequently modify this data during normal operation
> 3) on a power fail signal write the block to a file on an UBIFS
> partition 4) recover from the written data after the power cut
>
> The time between power failure notification and the uP-reset is
> guaranteed by hardware
> and is about 20ms.
>
> We first thought about using fallocate() to allocate a corresponding
> block on the partition
> but soon found that UBIFS does not implement a native fallocate() and
> thus the generic
> one simply wrote the file to 8k of zeros. This of course will not
> help.
>
> Simply fsync()ing the file in case of a power cut does not seem
> reliable, for
> - the file system might be full
> - write back cache operation may interfere with the synch-ing of
> our file
> - the garbage collector might run to free dirty LEBs and erase the
> corresponding PEBs
> The latter 2 overstretching our timing requirements.
>
> This is on an embedded system (i.mx31, arm1136@532MHz) running Linux
> 3.something
> (we are quite flexible in adapting new kernel versions), currently
> testing on 3.0.45.
>
> Could someone hint the course to follow for this szenario?
>
> Any pointers appreciated,
> Helmut
>
>
> --
> Scanned by MailScanner.
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: How to reserve space to be used right before power cut
2013-06-13 11:50 ` Matthieu CASTET
@ 2013-06-13 13:29 ` Raiger Helmut
2013-06-13 14:20 ` Matthieu CASTET
0 siblings, 1 reply; 6+ messages in thread
From: Raiger Helmut @ 2013-06-13 13:29 UTC (permalink / raw)
To: linux-mtd
> ----- Original Message -----
> From: "Matthieu CASTET" <matthieu.castet@parrot.com>
> To: "Helmut Raiger" <helmut.raiger@hale.at>
> Cc: linux-mtd@lists.infradead.org
> Sent: Thursday, June 13, 2013 1:50:31 PM
> Subject: Re: UBIFS: How to reserve space to be used right before power cut
>
> Hi,
>
> Why do you do this in ubifs ?
>
> If you do it in ubi/mtd this will be a lot's of easier.
>
> Matthieu
I wasn't aware of an userspace interface for ubi/mtd, but just found out
about gluebi. Is this the path you suggest?
Could you please elaborate a bit more on this, I'm still unsure if
this will meet our timing constraints (background operation of ubi?)
Helmut
--
Scanned by MailScanner.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: How to reserve space to be used right before power cut
2013-06-13 13:29 ` Raiger Helmut
@ 2013-06-13 14:20 ` Matthieu CASTET
2013-06-17 9:02 ` Helmut Raiger
0 siblings, 1 reply; 6+ messages in thread
From: Matthieu CASTET @ 2013-06-13 14:20 UTC (permalink / raw)
To: Raiger Helmut; +Cc: linux-mtd@lists.infradead.org
Le Thu, 13 Jun 2013 14:29:24 +0100,
Raiger Helmut <helmut.raiger@hale.at> a écrit :
>
>
> > ----- Original Message -----
> > From: "Matthieu CASTET" <matthieu.castet@parrot.com>
> > To: "Helmut Raiger" <helmut.raiger@hale.at>
> > Cc: linux-mtd@lists.infradead.org
> > Sent: Thursday, June 13, 2013 1:50:31 PM
> > Subject: Re: UBIFS: How to reserve space to be used right before
> > power cut
> >
> > Hi,
> >
> > Why do you do this in ubifs ?
> >
> > If you do it in ubi/mtd this will be a lot's of easier.
> >
> > Matthieu
>
> I wasn't aware of an userspace interface for ubi/mtd, but just found
> out about gluebi. Is this the path you suggest?
>
> Could you please elaborate a bit more on this, I'm still unsure if
> this will meet our timing constraints (background operation of ubi?)
>
Not gluebi
you have a userspace inferface to ubi : /usr/include/mtd/ubi-user.h
You could create a small ubi volume (dynamic or static) of 1 LEB next to
ubifs (on the same ubi device).
When you start you make sure the LEB have enough space and that the LEB
is mapped.
on a power fail signal you write the LEB with your data. Because the
LEB is already mapped, the write should be imediate.
If the ubi volume is on the same ubi device than ubifs, the wear
leveling will be shared with ubifs.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: How to reserve space to be used right before power cut
2013-06-13 14:20 ` Matthieu CASTET
@ 2013-06-17 9:02 ` Helmut Raiger
2013-06-26 8:03 ` Helmut Raiger
0 siblings, 1 reply; 6+ messages in thread
From: Helmut Raiger @ 2013-06-17 9:02 UTC (permalink / raw)
To: linux-mtd@lists.infradead.org
On 06/13/2013 04:20 PM, Matthieu CASTET wrote:
> Not gluebi
>
> you have a userspace inferface to ubi : /usr/include/mtd/ubi-user.h
>
>
> You could create a small ubi volume (dynamic or static) of 1 LEB next to
> ubifs (on the same ubi device).
> When you start you make sure the LEB have enough space and that the LEB
> is mapped.
>
> on a power fail signal you write the LEB with your data. Because the
> LEB is already mapped, the write should be imediate.
>
>
> If the ubi volume is on the same ubi device than ubifs, the wear
> leveling will be shared with ubifs.
>
I digged the UBI sources and still have the feeling this won't work:
1) There seems to be no way to (long term) protect a PEB from being
moved by the wear leveling sub-system (even scrubbing on bit-flips,
which may be induced by read-disturbances (reads on nearby pages)).
2) Temporary protection of a PEB is not really time specific, but depends
on global PEB erase action (i.e. anything UBIFS does on the same device),
which is something I can't control.
My impression is, that UBI simply does not support this sort of
application well. Unmoveable blocks will have a low erase count
(below average), which is exactly what the WL should avoid.
However I've never timed such a move operation:
a) move content to a new unused PEB
b) schedule original PEB for erasure
It might fit into my timing requirements, but will probably be heavily
influenced by system load and priorities.
Helmut
--
Scanned by MailScanner.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: UBIFS: How to reserve space to be used right before power cut
2013-06-17 9:02 ` Helmut Raiger
@ 2013-06-26 8:03 ` Helmut Raiger
0 siblings, 0 replies; 6+ messages in thread
From: Helmut Raiger @ 2013-06-26 8:03 UTC (permalink / raw)
To: linux-mtd
On 06/17/2013 11:02 AM, Helmut Raiger wrote:
> I digged the UBI sources and still have the feeling this won't work:
>
> 1) There seems to be no way to (long term) protect a PEB from being
> moved by the wear leveling sub-system (even scrubbing on bit-flips,
> which may be induced by read-disturbances (reads on nearby pages)).
>
> 2) Temporary protection of a PEB is not really time specific, but depends
> on global PEB erase action (i.e. anything UBIFS does on the same device),
> which is something I can't control.
>
> My impression is, that UBI simply does not support this sort of
> application well. Unmoveable blocks will have a low erase count
> (below average), which is exactly what the WL should avoid.
>
> However I've never timed such a move operation:
> a) move content to a new unused PEB
> b) schedule original PEB for erasure
> It might fit into my timing requirements, but will probably be heavily
> influenced by system load and priorities.
>
> Helmut
Just an update to 'enlight the world'. We are moving to YAFFS2, it has a
deterministic garbage collector which makes it a lot easier to implement
the requested behaviour.
It seems we can even take it off the shelf, currently we are perfomance
testing the write timing.
Helmut
--
Scanned by MailScanner.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-06-26 8:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13 11:42 UBIFS: How to reserve space to be used right before power cut Helmut Raiger
2013-06-13 11:50 ` Matthieu CASTET
2013-06-13 13:29 ` Raiger Helmut
2013-06-13 14:20 ` Matthieu CASTET
2013-06-17 9:02 ` Helmut Raiger
2013-06-26 8:03 ` Helmut Raiger
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 NNTP newsgroup(s).