提交 8713e012 编写于 作者: A Andrew Morton 提交者: Linus Torvalds

vmscan: avoid multiplication overflow in shrink_zone()

Local variable `scan' can overflow on zones which are larger than

	(2G * 4k) / 100 = 80GB.

Making it 64-bit on 64-bit will fix that up.

Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 0ae05fb2
...@@ -1471,7 +1471,7 @@ static void shrink_zone(int priority, struct zone *zone, ...@@ -1471,7 +1471,7 @@ static void shrink_zone(int priority, struct zone *zone,
for_each_evictable_lru(l) { for_each_evictable_lru(l) {
int file = is_file_lru(l); int file = is_file_lru(l);
int scan; unsigned long scan;
scan = zone_nr_pages(zone, sc, l); scan = zone_nr_pages(zone, sc, l);
if (priority) { if (priority) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册