projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
33b07db
)
vmscan: protect zone rotation stats by lru lock
author
Johannes Weiner
<
[email protected]
>
Mon, 1 Dec 2008 02:00:35 +0000
(
03:00
+0100)
committer
Linus Torvalds
<
[email protected]
>
Mon, 1 Dec 2008 15:58:06 +0000
(07:58 -0800)
The zone's rotation statistics must not be accessed without the
corresponding LRU lock held. Fix an unprotected write in
shrink_active_list().
Acked-by: Rik van Riel <
[email protected]
>
Reviewed-by: KOSAKI Motohiro <
[email protected]
>
Signed-off-by: Johannes Weiner <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/vmscan.c
patch
|
blob
|
history
diff --git
a/mm/vmscan.c
b/mm/vmscan.c
index 7ea1440b53db23350112cb1a46c592542807e4ac..62e7f62fb559c7a09b5b15b4d7a0b3a7b5b4c5e5 100644
(file)
--- a/
mm/vmscan.c
+++ b/
mm/vmscan.c
@@
-1248,6
+1248,7
@@
static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
list_add(&page->lru, &l_inactive);
}
+ spin_lock_irq(&zone->lru_lock);
/*
* Count referenced pages from currently used mappings as
* rotated, even though they are moved to the inactive list.
@@
-1263,7
+1264,6
@@
static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
pgmoved = 0;
lru = LRU_BASE + file * LRU_FILE;
- spin_lock_irq(&zone->lru_lock);
while (!list_empty(&l_inactive)) {
page = lru_to_page(&l_inactive);
prefetchw_prev_lru_page(page, &l_inactive, flags);