* [PATCH] kswapd: assign new_order and new_classzone_idx after wakeup in sleeping
@ 2011-07-29 1:45 Alex Shi
0 siblings, 0 replies; 2+ messages in thread
From: Alex Shi @ 2011-07-29 1:45 UTC (permalink / raw)
To: linux-mm, P
Cc: mgorman, minchan.kim, linux-kernel, andrea, tim.c.chen,
shaohua.li, akpm, riel, luto
There 2 place to read pgdat in kswapd. One is return from a successful
balance, another is waked up from sleeping. But the new_order and
new_classzone_idx are not assigned after kswapd_try_to_sleep(), that
will cause a bug in the following scenario.
After the last time successful balance, kswapd goes to sleep. So the
new_order and new_classzone_idx were assigned to 0 and MAX-1 since there
is no new wakeup during last time balancing. Now, a new wakeup came and
finish balancing successful with order > 0. But since new_order is still
0, this time successful balancing were judged as a failed balance. so,
if there is another new wakeup coming during balancing, kswapd cann't
read this and still want to try to sleep. And if the new wakeup is a
tighter request, kswapd may goes to sleep, not to do balancing. That is
incorrect.
So, to avoid above problem, the new_order and new_classzone_idx need to
be assigned for later successful comparison.
Paidrag Brady, Could like do a retry for your problem on this patch?
Signed-off-by: Alex Shi <alex.shi@intel.com>
Acked-by: Mel Gorman <mgorman@suse.de>
---
mm/vmscan.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 7ef6912..eb7bcce 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2850,6 +2850,8 @@ static int kswapd(void *p)
kswapd_try_to_sleep(pgdat, order, classzone_idx);
order = pgdat->kswapd_max_order;
classzone_idx = pgdat->classzone_idx;
+ new_order = order;
+ new_classzone_idx = classzone_idx;
pgdat->kswapd_max_order = 0;
pgdat->classzone_idx = pgdat->nr_zones - 1;
}
--
1.6.3.3
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
[parent not found: <1311903282-8539-1-git-send-email-alex.shi@intel.com>]
end of thread, other threads:[~2011-07-29 15:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-29 1:45 [PATCH] kswapd: assign new_order and new_classzone_idx after wakeup in sleeping Alex Shi
[not found] <1311903282-8539-1-git-send-email-alex.shi@intel.com>
[not found] ` <20110729085717.GC1843@barrios-desktop>
2011-07-29 15:33 ` Shi, Alex
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).