On 07/26/2012 04:57 PM, Peng Tao wrote: > On Thu, Jul 26, 2012 at 8:16 PM, Boaz Harrosh <bharrosh@xxxxxxxxxxx> wrote: >> On 07/26/2012 11:25 AM, Peng Tao wrote: >> >>> For these two sectors, I need to allocate two pages... Just look at >>> struct bio_vec. >>> >> >> >> NO! I know all about bio_vecs >> >> You need 1024 bytes, and 2 x one entry BIOs which is a few bytes, where >> did you get the "two pages" from? >> > What do you put int bio_vec->bv_page? Even if you just use 512 bytes > of a page, it is still allocated page. > No!! You just use bio_map_kern or in one go blk_rq_map_kern() with any: kmalloc, stack, or kernel pointer. And that's that. It will take what it will take. Two such BIOs can use the same page different regions, or a small region sharing a page with other kmalloc allocations. I don't see how you got your idea from? And for the bio itself you use bio_kmalloc(GFP_KERNEL/GFP_NOIO, numentries); which will give you one BIO + bio_vects in one allocation. And that is that You should give me more credit Boaz -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html