Re: a conceptual confusion -- bio--page --block -- buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Thu, Nov 5, 2009 at 5:24 PM, nidhi mittal hada <nidhimittal19@xxxxxxxxx> wrote:


On Thu, Nov 5, 2009 at 4:13 PM, Vikash Kumar <vikashskumar@xxxxxxxxx> wrote:


On Thu, Nov 5, 2009 at 3:40 PM, nidhi mittal hada <nidhimittal19@xxxxxxxxx> wrote:
Hi all
i have read about page cache
and about bio biovec page relation too

but in all that i have a minor confusion
what i know is -- pl ignore faults in language used -- its raw -- i know that 

1)page consists of many biovecs --
2)each biovec is mentioning continuous data on storage device-- to be transferred
3)many bio vecs coming from different pages -- makes a single bio --

where in a bio contains the request for continuous data (on storage device )
to be transferred ...i understood scatter gather ..i have read things from different place
so
in all that i am missing some links ---

1)  How page is related to block on disk ?--
2)  is block concept totally vanished in all this discussion ?

A page can contain multiple blocks of data and there exist buffer_head structures to maintain the mapping of blocks to page.
-------ok -- then buffer head --- is that related to bio biovec in any sense ??

No.. bio and biovec work with pages only.
 
 
 
3)  if a single bio is transferred at a time -- then is bio equivalent to a block ?
     or no relation of block and bio ?
4)  if bio is equivalent to one block -- then finally we are transferring block only .... then where abt that benefit of shifting from buffer cache to page cache  ....isnt it ??

A single bio can be used to issue IO spanning over multiple "pages" using biovecs. As each biovec can denote one page of data. And as one page can contain multiple blocks so one bio represents multiple blocks of IO at a time. 
--------you said "As each biovec can denote one page of data"-- no -- biovec is NOT total page of data !!!! its part of page ---- as far as i know


Let me rephrase that for you. A biovec can point to maximum one page of data. The amount of IO to be done should decide whether a biovec will point to the whole page or just part of it. I have done IO of whole page using a single bio so I am very sure about this.
 
-------- bio is -- one unit of i/o -- as i know -- bio is contiguous storage on disk ...that must be multiple CONTIGUOUS blocks only ....
 -----


Yes. In memory whatever data is pointed to by the biovec array (which works as a scatter gather list), It will be written on the target device as contiguous data blocks. but what does it have to do with the question at hand?

May be it's not very clear from the question what exactly you want to know. Rephrasing your question to make it more clear should help clear the confusion.
 
5)  page is related to a file -- a single page can contain only one file's data .... is that true ? 
          or      a page can contain some bio_vecs of file1 and some bio_vecs of other file2 ??


I am not very sure about this. But If I take a guess I would say one page will contain only one file's data so that there is clear ownership of page in the system. As Linux is a paging system and one page is the min amount of memory allocated to any process. This assumption sounds logical.

pl help in clarification


Refer to UTLK's chapters related to IO subsystem and page cache for a detailed and better understanding of these data structures.

thanks
nidhi



--
Thanks & Regards
Nidhi Mittal Hada


Regards,
Vikash Kumar
http://VikashKumar.com




--
Thanks & Regards
Nidhi Mittal Hada


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux