* How to quickly write cleanmarkers to jffs2 partitions?
@ 2006-03-02 16:06 David Jander
2006-03-02 17:07 ` Jaap-Jan Boor
2006-03-03 9:08 ` Mathieu Deschamps
0 siblings, 2 replies; 6+ messages in thread
From: David Jander @ 2006-03-02 16:06 UTC (permalink / raw)
To: linuxppc-embedded@ozlabs.org
Hi,
I was wondering if there is a trick or common technique I am ignoring to make
this more efficient:
This is for a 2.4 kernel based system.
In production we use either u-boot or a NFS mounted linux system to erase
flash and write jffs2 partitions to it. The jffs2 images are small (not
padded to full partition size to save programming time), but the partitions
are rather big (12 Mbyte in one case). Problem is that when booting for the
first time, one has to wait several minutes (during which the system is more
or less useless and busy) to get all cleanmarkers written to flash by the
jffs2 gc thread. This huge delay is rather unacceptable for production, so we
are looking for a work-around.
One option would be to make jffs2 images that are padded to full partition
size, but that also isn't very efficient, considering the image is only about
100k in beginning and the partition is 12 Mbyte in size. That would take a
lot of time programming flash (less time than having the jffs2 driver fix
this nevertheless).
Another option is making a little program that writes cleanmarkers in every
eraseblock starting from the first completely empty one in a partition before
mounting that partition for the very first time after flashing.
Since this seems to me like a common situation, I'd like to know if anybody
knows about a better solution, or if anybody has already dealt with this
before.
Greetings,
--
David Jander
Protonic Holland.
tel.: +31 (0) 229 212928
fax.: +31 (0) 229 210930
Factorij 36 / 1689 AL Zwaag
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to quickly write cleanmarkers to jffs2 partitions?
2006-03-02 16:06 How to quickly write cleanmarkers to jffs2 partitions? David Jander
@ 2006-03-02 17:07 ` Jaap-Jan Boor
2006-03-03 9:08 ` Mathieu Deschamps
1 sibling, 0 replies; 6+ messages in thread
From: Jaap-Jan Boor @ 2006-03-02 17:07 UTC (permalink / raw)
To: David Jander; +Cc: linuxppc-embedded@ozlabs.org
Hi David,
I indeed did write a small program that only writes the cleanmarkers
in all flash blocks used for jffs2. We assume (and check) all flash
sectors
are erased already.
Jaap-Jan
On 2-mrt-2006, at 17:06, David Jander wrote:
>
> Hi,
>
> I was wondering if there is a trick or common technique I am
> ignoring to make
> this more efficient:
>
> This is for a 2.4 kernel based system.
> In production we use either u-boot or a NFS mounted linux system to
> erase
> flash and write jffs2 partitions to it. The jffs2 images are small
> (not
> padded to full partition size to save programming time), but the
> partitions
> are rather big (12 Mbyte in one case). Problem is that when booting
> for the
> first time, one has to wait several minutes (during which the
> system is more
> or less useless and busy) to get all cleanmarkers written to flash
> by the
> jffs2 gc thread. This huge delay is rather unacceptable for
> production, so we
> are looking for a work-around.
>
> One option would be to make jffs2 images that are padded to full
> partition
> size, but that also isn't very efficient, considering the image is
> only about
> 100k in beginning and the partition is 12 Mbyte in size. That would
> take a
> lot of time programming flash (less time than having the jffs2
> driver fix
> this nevertheless).
>
> Another option is making a little program that writes cleanmarkers
> in every
> eraseblock starting from the first completely empty one in a
> partition before
> mounting that partition for the very first time after flashing.
>
> Since this seems to me like a common situation, I'd like to know if
> anybody
> knows about a better solution, or if anybody has already dealt with
> this
> before.
>
> Greetings,
>
> --
> David Jander
> Protonic Holland.
> tel.: +31 (0) 229 212928
> fax.: +31 (0) 229 210930
> Factorij 36 / 1689 AL Zwaag
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
> --
> This message has been scanned for viruses and is believed to be clean
>
____
J.G.J. Boor Anton Philipsweg 1
Software Engineer 1223 KZ Hilversum
AimSys bv tel. +31 35 689 1941
Postbus 2194, 1200 CD Hilversum jjboor at aimsys dot nl
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to quickly write cleanmarkers to jffs2 partitions?
2006-03-02 16:06 How to quickly write cleanmarkers to jffs2 partitions? David Jander
2006-03-02 17:07 ` Jaap-Jan Boor
@ 2006-03-03 9:08 ` Mathieu Deschamps
2006-03-06 12:21 ` Jaap-Jan Boor
1 sibling, 1 reply; 6+ messages in thread
From: Mathieu Deschamps @ 2006-03-03 9:08 UTC (permalink / raw)
To: David Jander; +Cc: linuxppc-embedded
On Thursday 02 March 2006 17:06, David Jander wrote:
> Hi,
>
> I was wondering if there is a trick or common technique I am ignoring to
> make this more efficient:
>
> This is for a 2.4 kernel based system.
> In production we use either u-boot or a NFS mounted linux system to erase
> flash and write jffs2 partitions to it. The jffs2 images are small (not
> padded to full partition size to save programming time), but the partitions
> are rather big (12 Mbyte in one case). Problem is that when booting for the
> first time, one has to wait several minutes (during which the system is
> more or less useless and busy) to get all cleanmarkers written to flash by
> the jffs2 gc thread. This huge delay is rather unacceptable for production,
> so we are looking for a work-around.
>
> One option would be to make jffs2 images that are padded to full partition
> size, but that also isn't very efficient, considering the image is only
> about 100k in beginning and the partition is 12 Mbyte in size. That would
> take a lot of time programming flash (less time than having the jffs2
> driver fix this nevertheless).
>
> Another option is making a little program that writes cleanmarkers in every
> eraseblock starting from the first completely empty one in a partition
> before mounting that partition for the very first time after flashing.
>
> Since this seems to me like a common situation, I'd like to know if anybody
> knows about a better solution, or if anybody has already dealt with this
> before.
>
> Greetings,
Hi,
"When preparing a flash partition for JFFS2, it is recommended to put
cleanmarkers to the erased blocks.
This might be done my means of "-j" option of the "flash_eraseall" MTD
utility. Otherwise, JFFS2 will re-erase the blocks
which contain all 0xFF and have no cleanmarker. This is an unneeded wasting of
time."
Source : http://www.linux-mtd.infradead.org/faq/jffs2.html
does this may be relevant ?
Best Regards,
Mathieu Deschamps.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to quickly write cleanmarkers to jffs2 partitions?
2006-03-03 9:08 ` Mathieu Deschamps
@ 2006-03-06 12:21 ` Jaap-Jan Boor
2006-03-08 8:38 ` David Jander
0 siblings, 1 reply; 6+ messages in thread
From: Jaap-Jan Boor @ 2006-03-06 12:21 UTC (permalink / raw)
To: Mathieu Deschamps; +Cc: David Jander, linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]
On Fri, 2006-03-03 at 10:08 +0100, Mathieu Deschamps wrote:
> Hi,
>
> "When preparing a flash partition for JFFS2, it is recommended to put
> cleanmarkers to the erased blocks.
> This might be done my means of "-j" option of the "flash_eraseall" MTD
> utility. Otherwise, JFFS2 will re-erase the blocks
> which contain all 0xFF and have no cleanmarker. This is an unneeded wasting of
> time."
>
> Source : http://www.linux-mtd.infradead.org/faq/jffs2.html
>
> does this may be relevant ?
This is correct, however flash_eraseall does also (as it's
name suggests, erase all flash blocks, which takes
some time on NOR flash. If you 'know' the flash is erased,
it's not needed.
I used flash_eraseall to write the cleanmarkers, but without
erasing blocks (and called that utility cleanmark)
Jaap-Jan
>
>
>
> Best Regards,
>
>
> Mathieu Deschamps.
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 1513 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to quickly write cleanmarkers to jffs2 partitions?
2006-03-06 12:21 ` Jaap-Jan Boor
@ 2006-03-08 8:38 ` David Jander
2006-03-10 17:10 ` Jaap-Jan Boor
0 siblings, 1 reply; 6+ messages in thread
From: David Jander @ 2006-03-08 8:38 UTC (permalink / raw)
To: linuxppc-embedded
On Monday 06 March 2006 13:21, Jaap-Jan Boor wrote:
> On Fri, 2006-03-03 at 10:08 +0100, Mathieu Deschamps wrote:
> > Hi,
> >
> > "When preparing a flash partition for JFFS2, it is recommended to put
> > cleanmarkers to the erased blocks.
> > This might be done my means of "-j" option of the "flash_eraseall" MTD
> > utility. Otherwise, JFFS2 will re-erase the blocks
> > which contain all 0xFF and have no cleanmarker. This is an unneeded
> > wasting of time."
> >
> > Source : http://www.linux-mtd.infradead.org/faq/jffs2.html
> >
> > does this may be relevant ?
>
> This is correct, however flash_eraseall does also (as it's
> name suggests, erase all flash blocks, which takes
> some time on NOR flash. If you 'know' the flash is erased,
> it's not needed.
> I used flash_eraseall to write the cleanmarkers, but without
> erasing blocks (and called that utility cleanmark)
Thanks to all for the suggestions.
Is "cleanmark" an open-source tool? Would you share it?
Greetings,
--
David Jander
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to quickly write cleanmarkers to jffs2 partitions?
2006-03-08 8:38 ` David Jander
@ 2006-03-10 17:10 ` Jaap-Jan Boor
0 siblings, 0 replies; 6+ messages in thread
From: Jaap-Jan Boor @ 2006-03-10 17:10 UTC (permalink / raw)
To: linuxppc
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]
On Wed, 2006-03-08 at 09:38 +0100, David Jander wrote:
>
> Thanks to all for the suggestions.
> Is "cleanmark" an open-source tool?
well, I think so, as it's a minimal modified flash_eraseall.c from mtd
> Would you share it?
sure, a gzipped version is attached. Put it in the mtd/util directory
and add it to the Makefile there (to TARGETS) and:
cleanmark: crc32.o cleanmark.o
$(CC) $(LDFLAGS) -o $@ $^
best regards,
Jaap-Jan
>
> Greetings,
>
> --
> David Jander
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
[-- Attachment #2: cleanmark.c.gz --]
[-- Type: application/x-gzip, Size: 2567 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-03-10 17:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-02 16:06 How to quickly write cleanmarkers to jffs2 partitions? David Jander
2006-03-02 17:07 ` Jaap-Jan Boor
2006-03-03 9:08 ` Mathieu Deschamps
2006-03-06 12:21 ` Jaap-Jan Boor
2006-03-08 8:38 ` David Jander
2006-03-10 17:10 ` Jaap-Jan Boor
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).