cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peng Haitao <penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
To: mhocko-AlSwsSmVLrQ@public.gmane.org
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org
Subject: how to make memory.memsw.failcnt is nonzero
Date: Wed, 28 Dec 2011 17:23:04 +0800	[thread overview]
Message-ID: <4EFADFF8.5020703@cn.fujitsu.com> (raw)


memory.memsw.failcnt shows the number of memory+Swap hits limits.
So I think when memory+swap usage is equal to limit, memsw.failcnt should be nonzero.

I test as follows:

# uname -a
Linux K-test 3.2.0-rc7-17-g371de6e #2 SMP Wed Dec 28 12:02:52 CST 2011 x86_64 x86_64 x86_64 GNU/Linux
# mkdir /cgroup/memory/group
# cd /cgroup/memory/group/
# echo 10M > memory.limit_in_bytes
# echo 10M > memory.memsw.limit_in_bytes
# echo $$ > tasks
# dd if=/dev/zero of=/tmp/temp_file count=20 bs=1M
Killed
# cat memory.memsw.failcnt
0
# grep "failcnt" /var/log/messages | tail -2
Dec 28 17:05:52 K-test kernel: memory: usage 10240kB, limit 10240kB, failcnt 21
Dec 28 17:05:52 K-test kernel: memory+swap: usage 10240kB, limit 10240kB, failcnt 0

memory+swap usage is equal to limit, but memsw.failcnt is zero.

I change memory.memsw.limit_in_bytes to 15M.

# echo 15M > memory.memsw.limit_in_bytes
# dd if=/dev/zero of=/tmp/temp_file count=20 bs=1M
Killed
# grep "failcnt" /var/log/messages | tail -2
Dec 28 17:08:45 K-test kernel: memory: usage 10240kB, limit 10240kB, failcnt 86
Dec 28 17:08:45 K-test kernel: memory+swap: usage 10240kB, limit 15360kB, failcnt 0
# cat memory.memsw.failcnt
0

The limit is 15M, but memory+swap usage also is 10M.
I think memory+swap usage should be 15M and memsw.failcnt should be nonzero.

This is a kernel bug or I misunderstand memory+swap?

I am looking forward to your feedback soon!
Thanks

-- 
Best Regards,
Peng

             reply	other threads:[~2011-12-28  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-28  9:23 Peng Haitao [this message]
     [not found] ` <4EFADFF8.5020703-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-01-03 16:04   ` how to make memory.memsw.failcnt is nonzero Michal Hocko
     [not found]     ` <20120103160411.GD3891-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2012-01-06  9:47       ` Peng Haitao
2012-01-06 10:12         ` Michal Hocko
     [not found]           ` <20120106101219.GB10292-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2012-01-30  2:47             ` Peng Haitao
     [not found]               ` <4F2604C5.7050900-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-01-30  7:24                 ` KAMEZAWA Hiroyuki
2012-01-30  2:34       ` Peng Haitao
2012-01-30  8:46         ` Michal Hocko

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=4EFADFF8.5020703@cn.fujitsu.com \
    --to=penght-bthxqxjhjhxqfuhtdcdx3a@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
    --cc=mhocko-AlSwsSmVLrQ@public.gmane.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;
as well as URLs for NNTP newsgroup(s).