From: Takenori Nagano <t-nagano@ah.jp.nec.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Keiichi KII <kii@linux.bs1.fc.nec.co.jp>
Subject: [patch] memory reclaim more efficiently
Date: Mon, 23 Jun 2008 09:55:29 +0900 [thread overview]
Message-ID: <485EF481.30409@ah.jp.nec.com> (raw)
Hi,
Efficiency of memory reclaim is recently one of the hot topics. (LRU splitting,
pageout throttling, etc...) I would like to contribute it and I made this patch.
In shrink_zone(), system can not return to user mode before it finishes to
search LRU list. IMHO, it is very wasteful, since the user processes stay
unnecessarily long time in shrink_zone() loop and application response time
becomes relatively bad. This patch changes shrink_zone() that it finishes memory
reclaim when it reclaims enough memory.
the conditions to end searching:
1. order of request page is 0
2. process is not kswapd.
3. satisfy the condition to return try_to_free_pages()
# nr_reclaim > SWAP_CLUSTER_MAX
Signed-off-by: Takenori Nagano <t-nagano@ah.jp.nec.com>
Signed-off-by: Keiichi Kii <k-keiichi@bx.jp.nec.com>
---
diff -uprN linux-2.6.26-rc6.orig/mm/vmscan.c linux-2.6.26-rc6/mm/vmscan.c
--- linux-2.6.26-rc6.orig/mm/vmscan.c 2008-06-13 06:22:24.000000000 +0900
+++ linux-2.6.26-rc6/mm/vmscan.c 2008-06-20 15:05:03.492700863 +0900
@@ -1224,6 +1224,9 @@ static unsigned long shrink_zone(int pri
nr_reclaimed += shrink_inactive_list(nr_to_scan, zone,
sc);
}
+ if (nr_reclaimed > sc->swap_cluster_max && !sc->order
+ && !current_is_kswapd())
+ break;
}
throttle_vm_writeout(sc->gfp_mask);
next reply other threads:[~2008-06-23 0:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 0:55 Takenori Nagano [this message]
2008-06-23 1:49 ` [patch] memory reclaim more efficiently KOSAKI Motohiro
2008-06-23 4:54 ` Takenori Nagano
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=485EF481.30409@ah.jp.nec.com \
--to=t-nagano@ah.jp.nec.com \
--cc=kii@linux.bs1.fc.nec.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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