Minimum/optimal sector_size for jffs2
Hi,
since my grep through the source code was not successful:
Is there a minimum possible jffs2_sb_info.sector_size and somewhere a definition?
Is there somewhat like an optimal sector_size?
I have here a device (dataflash), which has a very small erase/write page size (1056 bytes).
Best regards
Peter
Signature · 3 lines
Peter Menzebach Menzebach und Wolff IT-Consulting GbR Phone +49 751 355 387 1
Quoted 3 lines · Peter Menzebach
Hi,
since my grep through the source code was not successful:
Is there a minimum possible jffs2_sb_info.sector_size and somewhere a definition?
There is probably no minimum value, but not because it doesn't matter, just because nobody cared adding a check.
Quoted 1 line
Is there somewhat like an optimal
sector_size?
Not sure about optimal, probably yes. Consider the following aspects:
1. There is an array (c->blocks[]) with one element per eraseblock. The smaller is yur eraseblock - the larger is the array.
2. The eraseblock size cannot be less then PAGE_SIZE + sizeof(struct jffs2_raw_inode). PAGE_SIZE is mostly 4096 bytes.
3. The space at the end of eraseblock is not used if there are less then JFFS2_MIN_DATA_LEN bytes, or if the node beinf written does not fit that space. So, the smaller is the eraseblock, the more space is wasted.
Quoted 2 lines
I have here a device (dataflash), which has a very small erase/write page size (1056 bytes).
Err, AFAIR, I explained why you cannot use 1056 bytes eraseblocks... It is simply too small.
Signature · 3 lines
Best Regards, Artem B. Bityuckiy, St.-Petersburg, Russia.
Quoted 8 lines · Artem B. Bityutskiy
Quoted 3 lines · Peter Menzebach
Hi,
since my grep through the source code was not successful:
Is there a minimum possible jffs2_sb_info.sector_size and somewhere a definition?There is probably no minimum value, but not because it doesn't matter, just because nobody cared adding a check.
Quoted 8 lines
Quoted 1 line
Is there somewhat like an optimal
sector_size?Not sure about optimal, probably yes. Consider the following aspects:
1. There is an array (c->blocks[]) with one element per eraseblock. The smaller is yur eraseblock - the larger is the array.
2. The eraseblock size cannot be less then
PAGE_SIZE+sizeof(struct jffs2_raw_inode).PAGE_SIZEis mostly 4096 bytes.
Sorry,
I was not precise in terms. When I talked about erasesize, I mean mtd_info.erasesize.
As far as I see in the code, for jffs2 the erase vloack size (used by jeb) is jffs2_sb_info.sector_size.
So, in these terms, the jffs2 sector_size has a minimum:
jffs2 sector_size >= PAGE_SIZE + sizeof(struct jffs2_raw_inode)
That's the information, I wanted to confirm.
Quoted 4 lines
Quoted 2 lines
I have here a device (dataflash), which has a very small erase/write page size (1056 bytes).
Err, AFAIR, I explained why you cannot use 1056 bytes eraseblocks... It is simply too small.
See explanation above, sorry for the confusion ;) .
Best regards
Peter
Signature · 3 lines
Peter Menzebach Menzebach und Wolff IT-Consulting GbR Phone +49 751 355 387 1
Quoted 6 lines · Peter Menzebach
I was not precise in terms. When I talked about erasesize, I mean mtd_info.erasesize.
As far as I see in the code, for jffs2 the erase vloack size (used by jeb) is jffs2_sb_info.sector_size.
Hmm. "sector_size" is a confusing name. It reminds people of a disk sector, which is semantically similar to the writesize (or pagesize, if NAND people prefer). But JFFS2 uses sector_size as erasesize.
Oh well, just another one.
Jörn
Signature · 2 lines
Don't patch bad code, rewrite it. -- Kernigham and Pike, according to Rusty
Quoted 4 lines · Jörn Engel
Hmm. "
sector_size" is a confusing name. It reminds people of a disk sector, which is semantically similar to the writesize (or pagesize, if NAND people prefer). But JFFS2 usessector_sizeas erasesize.
I would not mind if one rename that field to erasesize.
Signature · 3 lines
Best Regards, Artem B. Bityuckiy, St.-Petersburg, Russia.
Hi,
I wonder, did you finally heal your JFFS2/Dataflash ? If yes, send your patch, I assume we should commit it before JFFS2 has gone to mainstream
Signature · 3 lines
Best Regards, Artem B. Bityuckiy, St.-Petersburg, Russia.
Quoted 4 lines · Artem B. Bityutskiy
Hi,
I wonder, did you finally heal your JFFS2/Dataflash ? If yes, send your patch, I assume we should commit it before JFFS2 has gone to mainstream
Yes,
dataflash is successfully healed. Thanks for your help. I am on the road this week. I will send it friday this week...
Best regards
Peter
Signature · 3 lines
Peter Menzebach Menzebach und Wolff IT-Consulting GbR Phone +49 751 355 387 1