LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-09-2012, 09:01 PM   #1
mhtrinh
LQ Newbie
 
Registered: Jan 2006
Location: Avignon, France
Posts: 16

Rep: Reputation: 0
Get files that are in cache


Hi,

Short story :
I would like to get all the files that are currently loaded in the cache/buffer. Anyone know a tool to do it ??

Long story : my filesystem is an ext4 fs, with the kernel 3.4.6
I'm trying to preload files (with simple "cat files > /dev/null") in order to have better disk spin down.
I tried to trace down opened files by my usual program with "strace -ff" and "lsof" but some files are still missing. To test, I run "sync; echo 3 > /proc/sys/vm/drop_caches", preload files, follow read event in /proc/kmsg.
So now I want to drop_caches, wait my system to stabilize, run my program, get all files in cache > those are files to be preload

Thanks in advance.
 
Old 08-10-2012, 06:13 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by mhtrinh View Post
I'm trying to preload files
Maybe have a look at the "readahead" package?

* BTW could you please update your profile? It still lists your distribution as "Fedora 7" and I sure hope you're not running that but the current release.
 
Old 08-11-2012, 08:01 AM   #3
mhtrinh
LQ Newbie
 
Registered: Jan 2006
Location: Avignon, France
Posts: 16

Original Poster
Rep: Reputation: 0
If you are talking about the kernel readahead feature : it's not adapted for what I want. readahead load big file entirely (depend on your threshold) instead of part of it only when there is an open file request. That don't work to pre-load files that you know that is goiing to be open later but are not opened yet.

About files in cache, I found a tool set linux-ftools : http://code.google.com/p/linux-ftools/
It can say if a specific file is cached (and more) or not. So to know all files that are in cache with this tool, you will have to scan through all files in your system :-(

I hope that there is more adapted tool ...
 
Old 08-12-2012, 12:29 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by mhtrinh View Post
readahead load big file entirely (depend on your threshold) instead of part of it only when there is an open file request. That don't work to pre-load files that you know that is goiing to be open later but are not opened yet.
Well, even though the readahead package is specifically meant for the task and even though its README specifically says "The first data block of each file is retrieved from the corresponding inode" you probably know better.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
squid cache big files. Xerop Linux - Server 3 05-03-2013 11:08 AM
[SOLVED] Firefox Cache for flv files salmanal Linux Mint 6 11-30-2010 08:45 PM
Does firefox have a cache of downloaded files? drudge Linux - Newbie 3 07-06-2008 03:00 PM
Cache nfs files locally? BrianK Linux - Networking 0 05-11-2006 06:02 PM
viewing squid cache files!! katana Linux - General 0 08-14-2001 06:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration