Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > The Linux Kernel > plan to implement prefetch technq

Forgot Password?
 The Linux Kernel   Compiling, theory, programming or other discussion about the linux kernel

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 06-16-2009   #1 (permalink)
Just Joined!
 
Join Date: Jun 2009
Posts: 1
plan to implement prefetch technq

Dear al,

I am planning to implement a prefetch strategy in an experimental file system. We have developed an experimental file system using a reference UXFS CODE.

And also I have developed Network Block Device (NBD) driver which can read and write block over the network.

Using uxfs fs, I can create UXFS file system and read/write to the device. However, I am now planning to implement Prefetching technique. I was wondering what is the best way to go ahead. . .

I am planning to write a multiread function in NBD which can accept list of sectors that need to be read and will export the multiread function, so that I can call it directly from the experimental fs.

Reading the article on the web Linux Kernel 2.4 Internals: Linux Page Cache, I am trying to understand the working of FS:

FOR READING A BLOCK FROM A FILE:
1) First, the generic methods will test whether the page actually exists using below two functions:

hash = page_hash(inode->i_mapping, index); page = __find_page_nolock(inode->i_mapping, index, *hash);

2) When it does not exist, we allocate a new free page, and add it to the page- cache hash.

page = page_cache_alloc(); __add_to_page_cache(page, mapping, index, hash);

3) After the page is hashed we use the ->readpage address_space operation to actually fill the page with data. (file is an open instance of inode).

error = mapping->a_ops->readpage(file, page);

This in turn will call readpage function which is in my experimental file system. Can anyone please suggest me if this is a right point of insertion.

From above, I understand the readpage function will be called, having Page allocated and file pointer. using int block_read_full_page(struct page *page, get_block_t *get_block) which is now used in readpage function, I have to understand which sectors I need to read and where need to be copied in the page (which in itself bit tricky) and then call multiread of NBD.

Further, I would be doing prefetching; therefore may have to allocate more pages and then will add it to page cache using: page = page_cache_alloc(); __add_to_page_cache(page, mapping, index, hash);


Do you guys think: this is the way to go about . . . ? I personally think there must be a better way .....

Look forward for your views.



Thank you Dhawal
dhawalthakker is offline  



Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 02:42 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1