What does drop_caches do?

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

 



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>

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[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