From: Prateek Sharma <prateeks@cse.iitb.ac.in>
To: linux-mm@kvack.org, kernelnewbies@kernelnewbies.org
Subject: What does drop_caches do?
Date: Thu, 28 Jul 2011 12:28:18 +0530 (IST) [thread overview]
Message-ID: <alpine.DEB.2.00.1107281215550.14640@nsl-11> (raw)
Hello everyone,
I've been trying to understand the role of the pagecache, starting with
drop_caches and observing what it does.
From my understanding of the code (fs/drop_caches.c) , it walks over all
the open files/inodes, and invalidates all the mapped pages. Pages which are
*not* dropped are either dirty,in-use,anonymous,mapped(to pagetable),or
writeback) . Is my understanding correct?
But, when i run drop_caches, there are still some pages which show up as
cached. Why arent all cache pages getting dropped ?
My confusion runs much deeper. What exactly constitutes the pagecache?
All filebacked pages ? mmaped files ? If i copy a bunch of files, why does my
cache get polluted with those pages?
Thanks for reading. I'd be grateful if someone can enlighten me about some
pagecache internals .
(Please keep me CC'ed)
<begin experiment>
root@tripitz:/etc/apt# free -m
total used free shared buffers cached
Mem: 1995 1854 140 0 79 700
-/+ buffers/cache: 1074 920
Swap: 4767 762 4005
root@tripitz:/etc/apt# echo 3 > /proc/sys/vm/drop_caches
root@tripitz:/etc/apt# free -m
total used free shared buffers cached
Mem: 1995 1373 621 0 0 363
-/+ buffers/cache: 1009 985
Swap: 4767 762 4005
<end experiment>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2011-07-28 6:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 6:58 Prateek Sharma [this message]
2011-08-24 7:18 ` Greg Freemyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.1107281215550.14640@nsl-11 \
--to=prateeks@cse.iitb.ac.in \
--cc=kernelnewbies@kernelnewbies.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox