From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx124.postini.com [74.125.245.124]) by kanga.kvack.org (Postfix) with SMTP id 2E68C6B0005 for ; Fri, 5 Apr 2013 03:46:06 -0400 (EDT) Received: by mail-da0-f45.google.com with SMTP id v40so1480712dad.32 for ; Fri, 05 Apr 2013 00:46:05 -0700 (PDT) Message-ID: <515E8137.8050709@gmail.com> Date: Fri, 05 Apr 2013 15:45:59 +0800 From: Simon Jeons MIME-Version: 1.0 Subject: mm, thp: fix mapped pages avoiding unevictable list on mlock Content-Type: multipart/alternative; boundary="------------000500090300060005060807" Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: Linux Memory Management List This is a multi-part message in MIME format. --------------000500090300060005060807 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, http://marc.info/?l=linux-mm&m=134810397323814&w=2 #define MAP_SIZE (4 << 30) /* 4GB */ void *ptr = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); mlock(ptr, MAP_SIZE); $ grep -E "Unevictable|Inactive\(anon" /proc/meminfo Inactive(anon): 6304 kB Unevictable: 4213924 kB These pages are allocated in mlock path(gup), correct? If the answer is yes,follow_page also will not set these pages unevictable, is it? Then how you get these pages unevictable? munlock(ptr, MAP_SIZE); Inactive(anon): 4186252 kB Unevictable: 19652 kB mlock(ptr, MAP_SIZE); Inactive(anon): 4198556 kB Unevictable: 21684 kB --------------000500090300060005060807 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi David,

http://marc.info/?l=linux-mm&m=134810397323814&w=2

	#define MAP_SIZE	(4 << 30)	/* 4GB */

	void *ptr = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE,
			 MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
	mlock(ptr, MAP_SIZE);

		$ grep -E "Unevictable|Inactive\(anon" /proc/meminfo
		Inactive(anon):     6304 kB
		Unevictable:     4213924 kB                          

These pages are allocated in mlock path(gup), correct? If the answer is yes, follow_page also will not set these pages unevictable, is it? Then how you get these pages unevictable?


	munlock(ptr, MAP_SIZE);

		Inactive(anon):  4186252 kB
		Unevictable:       19652 kB

	mlock(ptr, MAP_SIZE);

		Inactive(anon):  4198556 kB
		Unevictable:       21684 kB

--------------000500090300060005060807-- -- 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/ . Don't email: email@kvack.org