Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can anyone tell me whether prefetching of pages during booting and application initialization is implemented? If not, why has it not been implemented in Linux, especially since it has been done in Windows XP. What about run time prefetching?
Linux prefetching API is defined in the asm/processor.h include file
is most likely implemented in the file systems and virtual memory
you tell us
the source code is right there for you to read.
as to why this or that perhaps because what windows XP does is NOT why either way
there are some patches around for swap prefetching and a compiler switch for compiler based loop array prefetching
and many universities have done lots of expermentation with many different prefetching models.
actually how do you know MS implements this or that kind of prefetching
did you read the source code
must work for MS then.
is it implemented well
describe the way it is implements by MS
and what are the overhead costs for the way they have done it ?
why did you ask this stupid question ?
shark bait i guess and i bit
arrrrrrrrr good shark bait
Last edited by foo_bar_foo; 09-27-2005 at 12:36 AM.
Originally posted by kuldeep_kap Can anyone tell me whether prefetching of pages during booting and application initialization is implemented? If not, why has it not been implemented in Linux, especially since it has been done in Windows XP. What about run time prefetching?
Windows XP? Wouldn't know how it works as I never ran it, same for 2000. I stopped using windows at winme. How do you really know what windows does, everything is hidden from the user.
Most Linux distros parallel boot apps making Linux boot times generally faster than windows. There is an app called "prelink" that links libraries/apps making start up times of most apps quicker. OpenOffice starts in about 5 seconds for me, Firefox almost instantly.
|||||||||||Windows XP? Wouldn't know how it works as I never ran it, same for 2000. I stopped using windows at winme. How do you really know what windows does, everything is hidden from the user.|||||||||||----by craigevil
Yes windows xp takes log of 3 days of that process run of initial 10 secs and then use this stats to prefetch pages for that process at application startup and hence process startup is faster in winxp. stats are stored in windows\prefetch directory with .pf extension.
so, this is the basic thing and works well for winxp. so, i wanted to know is there anything related to this prefetch thing is provided or attempted in linux for better application performance, if not why?
Originally posted by addy86 Why do you think this question is stupid?
it's a "if Linux doesn't do it like i think windows does it then why not" question
the bottom line is yes Linux uses adaptive read ahead prefetching
you say Windows reads what blocks to prefetch from a file ?
how much time does that take ?
It's like saying I will prefetch where i put the car keys by writing it down and rather than getting the car keys next time i will first have to look for, find, and read a piece of paper with the directions to where i put the car keys and that will be faster than just getting the keys in the first place.
Originally posted by foo_bar_foo Linux uses adaptive read ahead prefetching
Linux uses page prefetching.....i didnt knew that.
then tell me more that how does it do it(in brief) and how it improves performance? and is it significantly achieved?
It would be gr8 if you can provide me related links
Originally posted by foo_bar_foo it's a "if Linux doesn't do it like i think windows does it then why not" question
This makes it a valid and justified question. Why shouldn't he ask it? Suppose a certain technique (which is considered performance-improving) is implemented in Windows but not Linux, then there is usually a reason why it hasn't been implemented in Linux yet (either it's useless, not appropriate, or simply not done yet). What is so bad about asking for that reason?
Quote:
you say Windows reads what blocks to prefetch from a file ?
how much time does that take ?
It's like saying I will prefetch where i put the car keys by writing it down and rather than getting the car keys next time i will first have to look for, find, and read a piece of paper with the directions to where i put the car keys and that will be faster than just getting the keys in the first place.
It is implemented in Linux, so there is a reason for it.
Now you claim that it's not reasonable to do this. Judging from your above posts, I don't think that you know much about "prefetching of pages during booting and application initialization" and thus you should be careful what conclusions you draw.
Originally posted by craigevil Most Linux distros parallel boot apps making Linux boot times generally faster than windows. There is an app called "prelink" that links libraries/apps making start up times of most apps quicker. OpenOffice starts in about 5 seconds for me, Firefox almost instantly.
Damn... which desktop environment are you using? I *wish* I had load times like that, even with prelink installed.
Originally posted by addy86 Suppose a certain technique (which is considered performance-improving) is implemented in Windows but not Linux
Suppose -- No one that I know knows how Windows works which is what I and others have said
This is a discussion about Linux not Windows. A more apropriate question would be I have been studying the algorithms used in Linux and i was wondering .........
Quote:
Originally posted by addy86
It is implemented in Linux, so there is a reason for it.
Now you claim that it's not reasonable to do this. Judging from your above posts, I don't think that you know much about "prefetching of pages during booting and application initialization" and thus you should be careful what conclusions you draw.
I certainly never said Linux reads prefetch data from files !
This is becoming an argument that sounds like evangelicles arguing about evolution.
hardware prefetch or adaptive read ahead or compiler based prefetch in or outside the Linux kernel or built directly into the binary executable is a very complex subject and yes my knowledge is limited as is everyone elses here. Certainly this issue is larger than the notion of how one OS should have some .pf files we can see like the "other one" does. If we want to discuss in detail what happens at boot in the function paging_init() or init_bootmem() then we can and should do that.
I personally think reading prefetch information from a file is an odd idea and while it is what WindowsXP CLAIMS to be doing with those .pf files (.pf stands for prefetch -- see how cleaver those guys are ) untill someone can produce the exact algorithms used the idea is meaningless.
If all it's doing is resolving dependency addresses for the platform's dynamic linker I don't think that's prefetching at all. It is in fact prelinking.
Someone else mentioned the program prelink which is most likely closer to what Windows is doing. Prelink used to improve Linux performance during 2.4 days and yes it held linking information in a binary file /etc/prelink.cache as well as in the executables themselves but with the new kernels and the new way it use Rik van Riel's new reverse mapping algorithms prelink no longer offers any performnce improvement at all and might even slow the system down.
By the way as I said earlier I think actual prefetching is implemented as part of the filesystems and related to the block device drivers and the physical block device cache and also something implemented at the compiler level for determinate size loop arrays that fit so nicely in solid chunks in your CPUs MMU. but I'm not sure as addy86 so cleaverly pointed out. But no I will NOT be carefull about what conclusions I draw especially when I simple say we don't actually know the facts enough to have an "intelligent design" discussion about wheather Linux has "evolved" or is just "miraculously created" to be superiour to Windows. Perhaps Pat Robinson can tell us. Or we can get zelda the tarro card reader (now unemployed) from New Orleans to help us determine the mysterious answer.
Last edited by foo_bar_foo; 09-27-2005 at 11:26 PM.
i found there is prefetching is used in buffer cache which is a cache for disk blocks. But, the prefetching algo is so basic i.e. it prefetches adjacent 3 blocks(which is conservatine strategy) and then adapted to aggressive strat at success and there is slow performance cause this method produces more misses and increases prefetching load. More interestingly more work is going on to improve prefetch strategy and replace algo for blocks in buffer cache.
There is one more problem (as pointed out by my senior guides) with buffer cache i.e. it gets full imediatly and its flushing method is not good which again reduces performance.
Can anybody actually care to point out what exaclty the problem is, i am interested to deal with it?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.