If system have no swap device, scan_control's may_swap field have to
be set to zero.
This patch will remove redundant calc_reclaim_mapped call which called
in shrink_active_list by sc->may_swap.
This patch is made from 2.6.24-rc6-mm1.
Signed-off-by: minchan kim <[email protected]>
---
mm/vmscan.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 45cee1c..7284d79 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1427,7 +1427,11 @@ unsigned long try_to_free_pages(struct zone
**zones, int order, gfp_t gfp_mask)
.gfp_mask = gfp_mask,
.may_writepage = !laptop_mode,
.swap_cluster_max = SWAP_CLUSTER_MAX,
+#ifdef CONFIG_SWAP
.may_swap = 1,
+#else
+ .may_swap = 0,
+#endif
.swappiness = vm_swappiness,
.order = order,
.mem_cgroup = NULL,
@@ -1445,7 +1449,11 @@ unsigned long
try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont,
struct scan_control sc = {
.gfp_mask = gfp_mask,
.may_writepage = !laptop_mode,
+#ifdef CONFIG_SWAP
.may_swap = 1,
+#else
+ .may_swap = 0,
+#endif
.swap_cluster_max = SWAP_CLUSTER_MAX,
.swappiness = vm_swappiness,
.order = 0,
@@ -1493,7 +1501,11 @@ static unsigned long balance_pgdat(pg_data_t
*pgdat, int order)
struct reclaim_state *reclaim_state = current->reclaim_state;
struct scan_control sc = {
.gfp_mask = GFP_KERNEL,
+#ifdef CONFIG_SWAP
.may_swap = 1,
+#else
+ .may_swap = 0,
+#endif
.swap_cluster_max = SWAP_CLUSTER_MAX,
.swappiness = vm_swappiness,
.order = order,
@@ -2003,7 +2015,11 @@ static int __zone_reclaim(struct zone *zone,
gfp_t gfp_mask, unsigned int order)
unsigned long nr_reclaimed = 0;
struct scan_control sc = {
.may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
+#ifdef CONFIG_SWAP
.may_swap = !!(zone_reclaim_mode & RECLAIM_SWAP),
+#else
+ .may_swap = 0,
+#endif
.swap_cluster_max = max_t(unsigned long, nr_pages,
SWAP_CLUSTER_MAX),
.gfp_mask = gfp_mask,
--
1.5.2.5
--
Kinds regards,
minchan kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]