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!

Have a nice day...
Markus

PS: Please CC me as I am not subscribed.



2.6.28でGEMが入ってからメモリが足りなくなった-。リークだーと騒ぐ人が増えたね。


# echo 3 > /proc/sys/vm/drop_caches

してもcached 欄が減らないぞーというわけ。

さて、このcached欄であるが、/proc/meminfoの "Cached:"フィールドの数字を表示している。
で、以下の結果をみると


I rebooted in console without the nvidia-module loaded and have the same
results (updated to 2.6.28.7 btw):
# sync ; echo 3 > /proc/sys/vm/drop_caches ; free -m ; cat /proc/meminfo
total used free shared buffers
cached
Mem: 3950 1647 2303 0 0
924
-/+ buffers/cache: 722 3228
Swap: 5890 0 5890
MemTotal: 4045444 kB
MemFree: 2358944 kB
Buffers: 544 kB
Cached: 946624 kB
SwapCached: 0 kB
Active: 1614756 kB
Inactive: 7632 kB
Active(anon): 1602476 kB
Inactive(anon): 0 kB
Active(file): 12280 kB
Inactive(file): 7632 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 6032344 kB
SwapFree: 6032344 kB
Dirty: 72 kB
Writeback: 32 kB
AnonPages: 675224 kB
Mapped: 17756 kB
Slab: 19936 kB
SReclaimable: 9652 kB
SUnreclaim: 10284 kB
PageTables: 8296 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 8055064 kB
Committed_AS: 3648088 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 10616 kB
VmallocChunk: 34359716459 kB
DirectMap4k: 6080 kB
DirectMap2M: 4188160 kB


Cachedと{In}Active(file) が合ってないように見えるが、これはtmpfs用のページが{In}Active(anon)にチャージされる仕様のため。
ようするに Cached:の900MはほとんどがtmpfsファイルでActive(anon)にチャージされていると考えるとつじつまがある。

で、このあと、そんなのマウントしてないとか議論になるのだが、Intelドライバつかっていると、カーネル内部でGEM用にこっそりマウントしてこっそり確保しまくるんだな。これが。

だから、ドライバが900Mも使うな!と抗議するのが正しい




http://bugs.freedesktop.org/show_bug.cgi?id=20404