From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm <linux-mm@kvack.org>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Rik van Riel <riel@redhat.com>,
David Rientjes <rientjes@google.com>
Cc: kosaki.motohiro@jp.fujitsu.com
Subject: [for -mm][PATCH][2/2] page reclaim throttle take3
Date: Sat, 22 Mar 2008 19:51:05 +0900 [thread overview]
Message-ID: <20080322194827.B314.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <20080322192928.B30B.KOSAKI.MOTOHIRO@jp.fujitsu.com>
This patch adds sysctl that changes the number of max reclaim task.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
include/linux/swap.h | 2 ++
kernel/sysctl.c | 9 +++++++++
mm/vmscan.c | 7 +++++--
3 files changed, 16 insertions(+), 2 deletions(-)
Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c 2008-03-21 22:36:10.000000000 +0900
+++ b/mm/vmscan.c 2008-03-21 22:36:12.000000000 +0900
@@ -127,6 +127,8 @@ long vm_total_pages; /* The total number
static LIST_HEAD(shrinker_list);
static DECLARE_RWSEM(shrinker_rwsem);
+int vm_max_nr_task_per_zone = CONFIG_NR_MAX_RECLAIM_TASKS_PER_ZONE;
+
#ifdef CONFIG_CGROUP_MEM_RES_CTLR
#define scan_global_lru(sc) (!(sc)->mem_cgroup)
#else
@@ -1202,7 +1204,7 @@ static int shrink_zone(int priority, str
wait_event(zone->reclaim_throttle_waitq,
atomic_add_unless(&zone->nr_reclaimers, 1,
- CONFIG_NR_MAX_RECLAIM_TASKS_PER_ZONE));
+ vm_max_nr_task_per_zone));
/* more reclaim until needed? */
if (scan_global_lru(sc) &&
@@ -1430,7 +1432,8 @@ static unsigned long do_try_to_free_page
last_check_time = jiffies;
/* more reclaim until needed? */
- for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) {
+ for_each_zone_zonelist(zone, z, zonelist,
+ high_zoneidx) {
if (zone_watermark_ok(zone, sc->order,
4 * zone->pages_high,
high_zoneidx, 0)) {
Index: b/include/linux/swap.h
===================================================================
--- a/include/linux/swap.h 2008-03-14 21:51:36.000000000 +0900
+++ b/include/linux/swap.h 2008-03-14 22:31:35.000000000 +0900
@@ -206,6 +206,8 @@ static inline int zone_reclaim(struct zo
extern int kswapd_run(int nid);
+extern int vm_max_nr_task_per_zone;
+
#ifdef CONFIG_MMU
/* linux/mm/shmem.c */
extern int shmem_unuse(swp_entry_t entry, struct page *page);
Index: b/kernel/sysctl.c
===================================================================
--- a/kernel/sysctl.c 2008-03-14 22:23:09.000000000 +0900
+++ b/kernel/sysctl.c 2008-03-14 22:32:08.000000000 +0900
@@ -1141,6 +1141,15 @@ static struct ctl_table vm_table[] = {
.extra2 = &one,
},
#endif
+ {
+ .ctl_name = CTL_UNNUMBERED,
+ .procname = "vm_max_nr_task_per_zone",
+ .data = &vm_max_nr_task_per_zone,
+ .maxlen = sizeof(vm_max_nr_task_per_zone),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ .strategy = &sysctl_intvec,
+ },
/*
* NOTE: do not add new entries to this table unless you have read
* Documentation/sysctl/ctl_unnumbered.txt
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-03-22 10:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-22 10:45 [for -mm][PATCH][1/2] " KOSAKI Motohiro
2008-03-22 10:51 ` KOSAKI Motohiro [this message]
2008-03-22 14:55 ` Rik van Riel
2008-03-22 16:01 ` KOSAKI Motohiro
2008-03-22 16:15 ` Rik van Riel
2008-03-22 16:43 ` KOSAKI Motohiro
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=20080322194827.B314.KOSAKI.MOTOHIRO@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
/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