linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: cgroup: real meaning of memory.usage_in_bytes
Date: Fri, 18 Mar 2011 16:29:36 +0100	[thread overview]
Message-ID: <20110318152936.GC18450@tiehlicka.suse.cz> (raw)
In-Reply-To: <20110318152532.GB18450@tiehlicka.suse.cz>

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

On Fri 18-03-11 16:25:32, Michal Hocko wrote:
> because since then we are charging in bulks so we can end up with
> rss+cache <= usage_in_bytes. Simple (attached) program will

And I forgot to attach the test case

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

[-- Attachment #2: charge_test.c --]
[-- Type: text/x-csrc, Size: 607 bytes --]

#include <stdio.h>
#include <sys/mman.h>

#define PAGE_SIZE 4096U
int main()
{
	int ch;
	void *addr, *start;
	size_t size = 1*PAGE_SIZE;

	printf("I am %d\n", getpid());
	printf("Add me to the cgroup tasks if you want me to be per cgroup\n");
	read(0, &ch, 1);

	if ((addr = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0)) == MAP_FAILED) {
		perror("mmap");
		return 1;
	}

	printf("Paging in %u pages\n", size/PAGE_SIZE);
	for (start = addr ; addr < start + size; addr += PAGE_SIZE) {
		*(unsigned char*)addr = 1;
	}

	printf("Press enter to finish\n");
	read(0, &ch, 1);
	return 0;
}

  reply	other threads:[~2011-03-18 15:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 15:25 cgroup: real meaning of memory.usage_in_bytes Michal Hocko
2011-03-18 15:29 ` Michal Hocko [this message]
2011-03-21  9:34 ` Michal Hocko
2011-03-21 10:24   ` [PATCH] memcg: consider per-cpu stock reserves when returning RES_USAGE for _MEM Michal Hocko
2011-03-22  0:10     ` KAMEZAWA Hiroyuki
2011-03-22  1:47       ` Daisuke Nishimura
2011-03-22  7:31         ` Michal Hocko
2011-03-23  0:27           ` Daisuke Nishimura
2011-03-23  4:35             ` KAMEZAWA Hiroyuki
2011-03-27 23:55               ` Daisuke Nishimura
2011-03-28  4:25                 ` [PATCH] memcg: update documentation to describe usage_in_bytes Daisuke Nishimura
2011-03-28  7:43                   ` Michal Hocko
2011-03-28  9:11                     ` KAMEZAWA Hiroyuki
2011-03-28  9:48                       ` Michal Hocko
2011-03-28 10:31                         ` KAMEZAWA Hiroyuki
2011-03-29  1:15                           ` [PATCH v2] " Daisuke Nishimura
2011-03-29  1:24                             ` KAMEZAWA Hiroyuki
2011-03-29  7:21                             ` Michal Hocko
2011-04-19 12:14                               ` Michal Hocko
2011-04-19 23:24                                 ` Daisuke Nishimura
2011-03-21 17:22   ` cgroup: real meaning of memory.usage_in_bytes Ying Han
2011-03-22  7:35     ` Michal Hocko
2011-03-22 17:06       ` Ying Han
2011-03-23 14:26         ` 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=20110318152936.GC18450@tiehlicka.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    /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).