From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx127.postini.com [74.125.245.127]) by kanga.kvack.org (Postfix) with SMTP id 56B5D6B004F for ; Thu, 12 Jan 2012 14:09:59 -0500 (EST) Received: by qcsd17 with SMTP id d17so1498336qcs.14 for ; Thu, 12 Jan 2012 11:09:58 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20120112125411.GG1042@tiehlicka.suse.cz> References: <1326321668-5422-1-git-send-email-yinghan@google.com> <20120112125411.GG1042@tiehlicka.suse.cz> Date: Thu, 12 Jan 2012 11:09:58 -0800 Message-ID: Subject: Re: memcg: add mlock statistic in memory.stat From: Ying Han Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Balbir Singh , Rik van Riel , Hugh Dickins , Johannes Weiner , Mel Gorman , KAMEZAWA Hiroyuki , Pavel Emelyanov , linux-mm@kvack.org On Thu, Jan 12, 2012 at 4:54 AM, Michal Hocko wrote: > On Wed 11-01-12 14:41:08, Ying Han wrote: >> We have the nr_mlock stat both in meminfo as well as vmstat system wide, this >> patch adds the mlock field into per-memcg memory stat. The stat itself enhances >> the metrics exported by memcg, especially is used together with "uneivctable" >> lru stat. > > Could you describe when the unevictable has such a different meaning than > mlocked that it is unusable? The unevictable lru includes more than mlock()'d pages ( SHM_LOCK'd etc). Like the following: $ memtoy>shmem shm_400m 400m $ memtoy>map shm_400m 0 400m $ memtoy>touch shm_400m memtoy: touched 102400 pages in 0.360 secs $ memtoy>slock shm_400m //meantime add some memory pressure. $ memtoy>file /export/hda3/file_512m $ memtoy>map file_512m 0 512m shared $ memtoy>lock file_512m $ cat /dev/cgroup/memory/B/memory.stat mapped_file 956301312 mlock 536870912 unevictable 956203008 Here, mapped_file - mlock = 400M shm_lock'ed pages are included in unevictable stat. Besides, not all mlock'ed pages get to unevictable lru at the first place, and the same for the other way around. Thanks --Ying > > -- > Michal Hocko > SUSE Labs > SUSE LINUX s.r.o. > Lihovarska 1060/12 > 190 00 Praha 9 > Czech Republic -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org