Re: What does drop_caches do?

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

 



Hi.... :)

On Thu, Jul 28, 2011 at 13:58, Prateek Sharma <prateeks@xxxxxxxxxxxxxx> wrote:
>        From my understanding of the code (fs/drop_caches.c) , it walks over all
> the open files/inodes, and invalidates all the mapped pages.

I doubt that would be open files/inodes..more likely list of pages.

>Pages which are
> *not* dropped are either dirty,in-use,

I quite agree with that....

>anonymous,

uhm..... they are not dropped...they are paged out AFAIK...

>mapped(to pagetable),
mapped, maybe.....if they are file backed...

>or
> writeback) .

you mean is still written out? then maybe yes...

>        But, when i run drop_caches, there are still some pages which show up as
> cached. Why arent all cache pages getting dropped ?

AFAIK there are few reasons: they are locked in RAM, allocated
strictly for kernel usage (loading kernel modules, kernel image
etc)....maybe more...

>        My confusion runs much deeper. What exactly constitutes the pagecache?

it caches the reading from device....to be precise, block
devices,either being read through VFS layer or directly from block
layer (we call it "raw access")

>If i copy a bunch of files, why does my
> cache get polluted with those pages?

because files content are put into page cache once it is read :)


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

_______________________________________________
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