public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Markus <M4rkusXXL@web.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: drop_caches ...
Date: Wed, 4 Mar 2009 19:05:58 +0800	[thread overview]
Message-ID: <20090304110558.GA17014@localhost> (raw)
In-Reply-To: <200903041132.04451.M4rkusXXL@web.de>

On Wed, Mar 04, 2009 at 12:32:02PM +0200, Markus wrote:
> Hello Fengguang!
> 
> > Hi Markus,
> > 
> > On Wed, Mar 04, 2009 at 10:57:33AM +0100, Markus wrote:
> > > Hello!
> > > 
> > > I have a small problem. Maybe its just a misunderstanding but I cant 
> > > solve it.
> > > 
> > > I think that writing "3" to drop_caches should drop all buffers and 
> > > caches which are already written. So its recommended to put a "sync" 
> > > infront of it.
> > > So I did "free -m ; sync ; echo 3 > /proc/sys/vm/drop_caches ; 
> free -m"
> > > And it gave me:
> > >              total       used       free     shared    buffers     
> > > cached
> > > Mem:          3950       3922         28          0          1        
> > > 879
> > > -/+ buffers/cache:       3041        909
> > > Swap:         5342        205       5136
> > >              total       used       free     shared    buffers     
> > > cached
> > > Mem:          3950       3907         43          0          0        
> > > 864
> > > -/+ buffers/cache:       3041        908
> > > Swap:         5341        206       5135
> > > 
> > > So the buffer was 1 and is 0 afterthat. But cached is at 879 MB 
> before 
> > > and is still 864 MB (!!!) after that!
> > > 
> > > I am at swappiness=0 and when I remove and readd one swap-partition 
> > > after another (so there is always swap). It will keep the cached and 
> > > put the swapped memory on other swaps?!
> > > 
> > > I _think_ thats not the way it should go?
> > > 
> > > It would be really kind if someone could explain that issue and 
> > > what "cached" is at all!
> > 
> > The memory mapped pages won't be dropped in this way.
> > "cat /proc/meminfo" will show you the number of mapped pages.
> 
> # sync ; echo 3 > /proc/sys/vm/drop_caches ; free -m ; cat /proc/meminfo
>              total       used       free     shared    buffers     
> cached
> Mem:          3950       3262        688          0          0        
> 359
> -/+ buffers/cache:       2902       1047
> Swap:         5890       1509       4381
> MemTotal:        4045500 kB
> MemFree:          705180 kB
> Buffers:             508 kB
> Cached:           367748 kB
> SwapCached:       880744 kB
> Active:          1555032 kB
> Inactive:        1634868 kB
> Active(anon):    1527100 kB
> Inactive(anon):  1607328 kB
> Active(file):      27932 kB
> Inactive(file):    27540 kB
> Unevictable:         816 kB
> Mlocked:               0 kB
> SwapTotal:       6032344 kB
> SwapFree:        4486496 kB
> Dirty:                 0 kB
> Writeback:             0 kB
> AnonPages:       2378112 kB
> Mapped:            52196 kB
> Slab:              65640 kB
> SReclaimable:      46192 kB
> SUnreclaim:        19448 kB
> PageTables:        28200 kB
> NFS_Unstable:          0 kB
> Bounce:                0 kB
> WritebackTmp:          0 kB
> CommitLimit:     8055092 kB
> Committed_AS:    4915636 kB
> VmallocTotal:   34359738367 kB
> VmallocUsed:       44580 kB
> VmallocChunk:   34359677239 kB
> DirectMap4k:     3182528 kB
> DirectMap2M:     1011712 kB
> 
> The cached reduced to 359 MB (after the dropping).
> I dont know where to read the "number of mapped pages".
> "Mapped" is about 51 MB.

Does your tmpfs store lots of files?

Thanks,
Fengguang


  reply	other threads:[~2009-03-04 11:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04  9:57 drop_caches Markus
2009-03-04 10:04 ` drop_caches Wu Fengguang
2009-03-04 10:32   ` drop_caches Markus
2009-03-04 11:05     ` Wu Fengguang [this message]
2009-03-04 11:29       ` drop_caches Markus
2009-03-04 11:57         ` drop_caches Wu Fengguang
2009-03-04 12:32           ` drop_caches Zdenek Kabelac
2009-03-04 13:47             ` drop_caches Markus
2009-03-04 14:09               ` drop_caches Zdenek Kabelac
2009-03-04 18:47                 ` drop_caches Markus
2009-03-05  0:48                   ` drop_caches Wu Fengguang
2009-03-05  9:06                     ` drop_caches Lukas Hejtmanek
2009-03-05  9:14                       ` drop_caches KOSAKI Motohiro
2009-03-05 11:11                         ` drop_caches Wu Fengguang
2009-03-05 11:55                     ` drop_caches Markus
2009-03-05 13:29                       ` drop_caches Wu Fengguang
2009-03-05 14:05                         ` drop_caches Markus
2009-03-05 14:22                           ` drop_caches Wu Fengguang
2009-03-05 14:43                             ` drop_caches Markus
2009-03-05 14:52                               ` drop_caches Wu Fengguang
2009-03-05 13:36                       ` drop_caches Wu Fengguang
2009-03-05 13:45                         ` drop_caches Lukas Hejtmanek
2009-03-05 13:48                           ` drop_caches Wu Fengguang
2009-03-05 13:50                         ` drop_caches Markus
2009-03-05 14:01                         ` drop_caches Lukas Hejtmanek
2009-03-05 14:07                           ` drop_caches Wu Fengguang
  -- strict thread matches above, loose matches on Subject: below --
2009-03-04 12:38 drop_caches Lukas Hejtmanek
2009-03-04 12:54 ` drop_caches Wu Fengguang

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=20090304110558.GA17014@localhost \
    --to=fengguang.wu@intel.com \
    --cc=M4rkusXXL@web.de \
    --cc=linux-kernel@vger.kernel.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