[patch 18/19] account mlocked pages

Previous thread: [patch 14/19] SHM_LOCKED pages are nonreclaimable by Rik van Riel on Tuesday, January 8, 2008 - 4:59 pm. (1 message)

Next thread: [RFD] Incremental fsck by Al Boldi on Tuesday, January 8, 2008 - 5:22 pm. (53 messages)
To: <linux-kernel@...>
Cc: <linux-mm@...>, Nick Piggin <npiggin@...>, Lee Schermerhorn <lee.schermerhorn@...>
Date: Tuesday, January 8, 2008 - 4:59 pm

V2 -> V3:
+ rebase to 23-mm1 atop RvR's split lru series
+ fix definitions of NR_MLOCK to fix build errors when not configured.

V1 -> V2:
+ new in V2 -- pulled in & reworked from Nick's previous series

From: Nick Piggin <npiggin@suse.de>
To: Linux Memory Management <linux-mm@kvack.org>
Cc: Nick Piggin <npiggin@suse.de>, Andrew Morton <akpm@osdl.org>
Subject: [patch 4/4] mm: account mlocked pages
Date: Mon, 12 Mar 2007 07:39:14 +0100 (CET)

Add NR_MLOCK zone page state, which provides a (conservative) count of
mlocked pages (actually, the number of mlocked pages moved off the LRU).

Reworked by lts to fit in with the modified mlock page support in the
Reclaim Scalability series. I don't know whether we'll want to keep
these stats in the long run, but during testing of this series, I find
them useful.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Rik van Riel <riel@redhat.com>

Index: linux-2.6.24-rc6-mm1/drivers/base/node.c
===================================================================
--- linux-2.6.24-rc6-mm1.orig/drivers/base/node.c 2008-01-02 17:08:16.000000000 -0500
+++ linux-2.6.24-rc6-mm1/drivers/base/node.c 2008-01-02 17:08:17.000000000 -0500
@@ -55,6 +55,9 @@ static ssize_t node_read_meminfo(struct
"Node %d Inactive(file): %8lu kB\n"
#ifdef CONFIG_NORECLAIM
"Node %d Noreclaim: %8lu kB\n"
+#ifdef CONFIG_NORECLAIM_MLOCK
+ "Node %d Mlocked: %8lu kB\n"
+#endif
#endif
#ifdef CONFIG_HIGHMEM
"Node %d HighTotal: %8lu kB\n"
@@ -82,6 +85,9 @@ static ssize_t node_read_meminfo(struct
nid, node_page_state(nid, NR_INACTIVE_FILE),
#ifdef CONFIG_NORECLAIM
nid, node_page_state(nid, NR_NORECLAIM),
+#ifdef CONFIG_NORECLAIM_MLOCK
+ nid, K(node_page_state(nid, NR_MLOCK)),
+#endif
#endif
#ifdef CONFIG_HIGHMEM
nid, K(i.totalhigh),
Index: lin...

To: Rik van Riel <riel@...>
Cc: <linux-kernel@...>, <linux-mm@...>, Nick Piggin <npiggin@...>, Lee Schermerhorn <lee.schermerhorn@...>
Date: Friday, January 11, 2008 - 8:51 am

* Rik van Riel <riel@redhat.com> [2008-01-08 15:59:57]:

The following patch is required to compile the code with
CONFIG_NORECLAIM enabled and CONFIG_NORECLAIM_MLOCK disabled.

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index c8ccf8f..fb08ee8 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -88,6 +88,8 @@ enum zone_stat_item {
NR_NORECLAIM, /* " " " " " */
#ifdef CONFIG_NORECLAIM_MLOCK
NR_MLOCK, /* mlock()ed pages found and moved off LRU */
+#else
+ NR_MLOCK=NR_ACTIVE_FILE, /* avoid compiler errors... */
#endif
#else
NR_NORECLAIM=NR_ACTIVE_FILE, /* avoid compiler errors in dead code */

--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
--

To: <balbir@...>
Cc: <linux-kernel@...>, <linux-mm@...>, Nick Piggin <npiggin@...>, Lee Schermerhorn <lee.schermerhorn@...>
Date: Sunday, January 13, 2008 - 1:18 am

On Fri, 11 Jan 2008 18:21:09 +0530

I have untangled the #ifdefs to make things compile with
all combinations of config settings. Thanks for pointing
out this problem.

--
All rights reversed.
--

Previous thread: [patch 14/19] SHM_LOCKED pages are nonreclaimable by Rik van Riel on Tuesday, January 8, 2008 - 4:59 pm. (1 message)

Next thread: [RFD] Incremental fsck by Al Boldi on Tuesday, January 8, 2008 - 5:22 pm. (53 messages)