* What is subpage_sft??
@ 2007-07-03 5:28 Vinit Agnihotri
2007-07-03 5:34 ` Kyungmin Park
2007-07-03 5:44 ` Artem Bityutskiy
0 siblings, 2 replies; 8+ messages in thread
From: Vinit Agnihotri @ 2007-07-03 5:28 UTC (permalink / raw)
To: linux-mtd
I tried searching on net to understand what subpage_sft means, but
aint find any relevant information.
What does subpage_sft means?? Where it is used?? Is it related with
NAND or NOR flash?
Can anybody provide this little information to me. Any relevant
document or link is welcome.
Thanks in Advance,
Vinit.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: What is subpage_sft??
2007-07-03 5:28 What is subpage_sft?? Vinit Agnihotri
@ 2007-07-03 5:34 ` Kyungmin Park
2007-07-03 5:46 ` Artem Bityutskiy
2007-07-03 5:44 ` Artem Bityutskiy
1 sibling, 1 reply; 8+ messages in thread
From: Kyungmin Park @ 2007-07-03 5:34 UTC (permalink / raw)
To: 'Vinit Agnihotri', linux-mtd
Hi,
> I tried searching on net to understand what subpage_sft means, but
> aint find any relevant information.
>
> What does subpage_sft means?? Where it is used?? Is it related with
> NAND or NOR flash?
> Can anybody provide this little information to me. Any relevant
> document or link is welcome.
It is used at UBI. It means it can program sector(s) with (mtd->writesize >> mtd->subpage_sft) instead of page (2KB).
switch (mtd->oobsize) {
case 64:
this->ecclayout = &onenand_oob_64;
mtd->subpage_sft = 2;
break;
case 32:
this->ecclayout = &onenand_oob_32;
mtd->subpage_sft = 1;
break;
default:
printk(KERN_WARNING "No OOB scheme defined for oobsize %d\n",
mtd->oobsize);
mtd->subpage_sft = 0;
/* To prevent kernel oops */
this->ecclayout = &onenand_oob_32;
break;
}
this->subpagesize = mtd->writesize >> mtd->subpage_sft;
E.g., OneNAND (SLC) can program 4 times with 512
Thank you,
Kyungmin Park
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: What is subpage_sft??
2007-07-03 5:28 What is subpage_sft?? Vinit Agnihotri
2007-07-03 5:34 ` Kyungmin Park
@ 2007-07-03 5:44 ` Artem Bityutskiy
1 sibling, 0 replies; 8+ messages in thread
From: Artem Bityutskiy @ 2007-07-03 5:44 UTC (permalink / raw)
To: Vinit Agnihotri; +Cc: linux-mtd
On Tue, 2007-07-03 at 10:58 +0530, Vinit Agnihotri wrote:
> I tried searching on net to understand what subpage_sft means, but
> aint find any relevant information.
>
> What does subpage_sft means?? Where it is used?? Is it related with
> NAND or NOR flash?
> Can anybody provide this little information to me. Any relevant
> document or link is welcome.
Many NANDs are allow to write more then once to the NAND page, and MTD
allows you to write a sub-page rather then whole page. Typically 512
bytes NAND page consists of 2x256 byte sub-pages, or 2KiB NAND page
consists of 4x512 byte sub-pages.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: What is subpage_sft??
2007-07-03 5:34 ` Kyungmin Park
@ 2007-07-03 5:46 ` Artem Bityutskiy
2007-07-03 5:54 ` Vinit Agnihotri
0 siblings, 1 reply; 8+ messages in thread
From: Artem Bityutskiy @ 2007-07-03 5:46 UTC (permalink / raw)
To: kmpark; +Cc: linux-mtd, 'Vinit Agnihotri'
On Tue, 2007-07-03 at 14:34 +0900, Kyungmin Park wrote:
> It is used at UBI.
Yeah, it is very beneficial for UBI because it wastes twice as less NAND
flash space if there is sub-page access.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: What is subpage_sft??
2007-07-03 5:46 ` Artem Bityutskiy
@ 2007-07-03 5:54 ` Vinit Agnihotri
2007-07-03 6:35 ` Vinit Agnihotri
0 siblings, 1 reply; 8+ messages in thread
From: Vinit Agnihotri @ 2007-07-03 5:54 UTC (permalink / raw)
To: linux-mtd
Thanks a lot Artem & Kyungmin, for immediate replies.
I guess it answers all my questions.
Thanks once again.
Regards,
Vinit.
On 7/3/07, Artem Bityutskiy <dedekind@infradead.org> wrote:
> On Tue, 2007-07-03 at 14:34 +0900, Kyungmin Park wrote:
> > It is used at UBI.
>
> Yeah, it is very beneficial for UBI because it wastes twice as less NAND
> flash space if there is sub-page access.
>
> --
> Best regards,
> Artem Bityutskiy (Битюцкий Артём)
>
>
--
I feel free now
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: What is subpage_sft??
2007-07-03 5:54 ` Vinit Agnihotri
@ 2007-07-03 6:35 ` Vinit Agnihotri
2007-07-03 6:55 ` Artem Bityutskiy
0 siblings, 1 reply; 8+ messages in thread
From: Vinit Agnihotri @ 2007-07-03 6:35 UTC (permalink / raw)
To: linux-mtd
I am little bit confused with following UBI code.
My initial understandings are as follows, please correct me if I am wrong.
1. A flash device has "n" no. of eraseblocks.
2. A eraseblock contains "m" no. of pages.
3. A page contains "l" no. of subpages.
4. Subpage support is dependent on underlying NAND, so every NAND cant
have subpage access.
5. Concept of subpages only exists in NAND flash not NOR.
UBI code:
ubi->min_io_size = ubi->mtd->writesize;
ubi->hdrs_min_io_size =ubi->mtd->writesize >> ubi->mtd->subpage_sft;
ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size);
ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size);
6. min_io_size: is minimal i/o that can be performed on flash.
7. writesize: is indeed a page size.
8. If subpages are not supported then hdrs_min_io_size == writesize
9. So if writesize is 2048 bytes & if subpage_sft is 0, then ec & vid
headers will be of 1 NAND page. So here in this case: min_io_size ==
writesize == hdrs_min_io_size.
10. Now if subpages are supported, then min_io_size !=
hdrs_min_io_size. Now if we can write in alignment of hdrs_min_io_size
which is less that min_io_size , then what is significance of
min_io_size.
i.e.
If writesize = 2048
subpage_sft = 2
min_io_size = writesize = 2048
hdrs_min_io_size = writesize >> subpage_sft = 512
hdrs_min_io_size < min_io_size
Now if we can write hdrs_min_io_size of data to flash then what is
notion of min_io_size???
Thanks & Regards
Vinit.
On 7/3/07, Vinit Agnihotri <vinit.agnihotri@gmail.com> wrote:
> Thanks a lot Artem & Kyungmin, for immediate replies.
> I guess it answers all my questions.
>
> Thanks once again.
>
> Regards,
> Vinit.
>
>
> On 7/3/07, Artem Bityutskiy <dedekind@infradead.org> wrote:
> > On Tue, 2007-07-03 at 14:34 +0900, Kyungmin Park wrote:
> > > It is used at UBI.
> >
> > Yeah, it is very beneficial for UBI because it wastes twice as less NAND
> > flash space if there is sub-page access.
> >
> > --
> > Best regards,
> > Artem Bityutskiy (Битюцкий Артём)
> >
> >
>
>
> --
> I feel free now
>
--
I feel free now
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: What is subpage_sft??
2007-07-03 6:35 ` Vinit Agnihotri
@ 2007-07-03 6:55 ` Artem Bityutskiy
2007-07-03 7:03 ` Vinit Agnihotri
0 siblings, 1 reply; 8+ messages in thread
From: Artem Bityutskiy @ 2007-07-03 6:55 UTC (permalink / raw)
To: Vinit Agnihotri; +Cc: linux-mtd
On Tue, 2007-07-03 at 12:05 +0530, Vinit Agnihotri wrote:
> I am little bit confused with following UBI code.
>
> My initial understandings are as follows, please correct me if I am wrong.
> 1. A flash device has "n" no. of eraseblocks.
> 2. A eraseblock contains "m" no. of pages.
> 3. A page contains "l" no. of subpages.
> 4. Subpage support is dependent on underlying NAND, so every NAND cant
> have subpage access.
> 5. Concept of subpages only exists in NAND flash not NOR.
Right.
> UBI code:
> ubi->min_io_size = ubi->mtd->writesize;
NAND page size.
> ubi->hdrs_min_io_size =ubi->mtd->writesize >> ubi->mtd->subpage_sft;
Sub-page size.
> ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size);
EC header size aligned to sub-page size.
> ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size);
VID header size aligned to sub-page size
> 6. min_io_size: is minimal i/o that can be performed on flash.
Yes, NAND page in case of NAND
> 7. writesize: is indeed a page size.
Right.
> 8. If subpages are not supported then hdrs_min_io_size == writesize
Right,
> 9. So if writesize is 2048 bytes & if subpage_sft is 0, then ec & vid
> headers will be of 1 NAND page. So here in this case: min_io_size ==
> writesize == hdrs_min_io_size.
Right.
> 10. Now if subpages are supported, then min_io_size !=
> hdrs_min_io_size. Now if we can write in alignment of hdrs_min_io_size
> which is less that min_io_size , then what is significance of
> min_io_size.
We use sub-page only for EC and VID headers. For UBI users we report
min_io_size, i.e. they do not know about sub-pages. Users have to submit
only min_io_size-aligned writes. Sub-page is used _only_ as an internal
optimization.
> i.e.
> If writesize = 2048
> subpage_sft = 2
> min_io_size = writesize = 2048
> hdrs_min_io_size = writesize >> subpage_sft = 512
> hdrs_min_io_size < min_io_size
>
> Now if we can write hdrs_min_io_size of data to flash then what is
> notion of min_io_size???
See above.
The main reason why we do not make min_io_size = sub-page, but still
expose whole NAND page size as the minimal Input/Output unit is because
sub-page stuff is kinda tricky and hacky.
If you glance to nand_base.c how sub-page write is implemented, you'll
notice that if you wanna write a sub-page, it still writes whole NAND
page, but data in the sub-pages other then the one you are writing to
are set to 0xFF. IOW, sub-page write takes as much time as whole page
write.
If we'd expose sub-page as minimal I/O unit (which we actually used to
do!), JFFS2'd become slower (when it is used on top of UBI). Indeed,
compare 512bytes which is flushed as slow as 2KiB write-buffer - 4x I/O
speed regression.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: What is subpage_sft??
2007-07-03 6:55 ` Artem Bityutskiy
@ 2007-07-03 7:03 ` Vinit Agnihotri
0 siblings, 0 replies; 8+ messages in thread
From: Vinit Agnihotri @ 2007-07-03 7:03 UTC (permalink / raw)
To: linux-mtd
Thanks Artem, That clears almost all confusion about min_io_size,
hdrs_min_io_size & writesize.
Regards,
Vinit.
On 7/3/07, Artem Bityutskiy <dedekind@infradead.org> wrote:
> On Tue, 2007-07-03 at 12:05 +0530, Vinit Agnihotri wrote:
> > I am little bit confused with following UBI code.
> >
> > My initial understandings are as follows, please correct me if I am wrong.
> > 1. A flash device has "n" no. of eraseblocks.
> > 2. A eraseblock contains "m" no. of pages.
> > 3. A page contains "l" no. of subpages.
> > 4. Subpage support is dependent on underlying NAND, so every NAND cant
> > have subpage access.
> > 5. Concept of subpages only exists in NAND flash not NOR.
> Right.
>
> > UBI code:
> > ubi->min_io_size = ubi->mtd->writesize;
> NAND page size.
> > ubi->hdrs_min_io_size =ubi->mtd->writesize >> ubi->mtd->subpage_sft;
> Sub-page size.
> > ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size);
> EC header size aligned to sub-page size.
> > ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size);
> VID header size aligned to sub-page size
>
> > 6. min_io_size: is minimal i/o that can be performed on flash.
> Yes, NAND page in case of NAND
> > 7. writesize: is indeed a page size.
> Right.
> > 8. If subpages are not supported then hdrs_min_io_size == writesize
> Right,
> > 9. So if writesize is 2048 bytes & if subpage_sft is 0, then ec & vid
> > headers will be of 1 NAND page. So here in this case: min_io_size ==
> > writesize == hdrs_min_io_size.
> Right.
> > 10. Now if subpages are supported, then min_io_size !=
> > hdrs_min_io_size. Now if we can write in alignment of hdrs_min_io_size
> > which is less that min_io_size , then what is significance of
> > min_io_size.
> We use sub-page only for EC and VID headers. For UBI users we report
> min_io_size, i.e. they do not know about sub-pages. Users have to submit
> only min_io_size-aligned writes. Sub-page is used _only_ as an internal
> optimization.
>
> > i.e.
> > If writesize = 2048
> > subpage_sft = 2
> > min_io_size = writesize = 2048
> > hdrs_min_io_size = writesize >> subpage_sft = 512
> > hdrs_min_io_size < min_io_size
> >
> > Now if we can write hdrs_min_io_size of data to flash then what is
> > notion of min_io_size???
>
> See above.
>
> The main reason why we do not make min_io_size = sub-page, but still
> expose whole NAND page size as the minimal Input/Output unit is because
> sub-page stuff is kinda tricky and hacky.
>
> If you glance to nand_base.c how sub-page write is implemented, you'll
> notice that if you wanna write a sub-page, it still writes whole NAND
> page, but data in the sub-pages other then the one you are writing to
> are set to 0xFF. IOW, sub-page write takes as much time as whole page
> write.
>
> If we'd expose sub-page as minimal I/O unit (which we actually used to
> do!), JFFS2'd become slower (when it is used on top of UBI). Indeed,
> compare 512bytes which is flushed as slow as 2KiB write-buffer - 4x I/O
> speed regression.
>
> --
> Best regards,
> Artem Bityutskiy (Битюцкий Артём)
>
>
--
I feel free now
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-07-03 7:03 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-03 5:28 What is subpage_sft?? Vinit Agnihotri
2007-07-03 5:34 ` Kyungmin Park
2007-07-03 5:46 ` Artem Bityutskiy
2007-07-03 5:54 ` Vinit Agnihotri
2007-07-03 6:35 ` Vinit Agnihotri
2007-07-03 6:55 ` Artem Bityutskiy
2007-07-03 7:03 ` Vinit Agnihotri
2007-07-03 5:44 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox