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:
240c879
)
thp: ksm: free swap when swapcache page is replaced
author
Hugh Dickins
<
[email protected]
>
Thu, 13 Jan 2011 23:46:28 +0000
(15:46 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 14 Jan 2011 01:32:38 +0000
(17:32 -0800)
When a swapcache page is replaced by a ksm page, it's best to free that
swap immediately.
Reported-by: Andrea Arcangeli <
[email protected]
>
Signed-off-by: Hugh Dickins <
[email protected]
>
Signed-off-by: Andrea Arcangeli <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/ksm.c
patch
|
blob
|
history
diff --git
a/mm/ksm.c
b/mm/ksm.c
index 43bc893470b40512e26bdd129fb2194708bfbbdc..b5b907cb0f900c3b5e24dceef352ca48155d1a4a 100644
(file)
--- a/
mm/ksm.c
+++ b/
mm/ksm.c
@@
-800,6
+800,8
@@
static int replace_page(struct vm_area_struct *vma, struct page *page,
set_pte_at_notify(mm, addr, ptep, mk_pte(kpage, vma->vm_page_prot));
page_remove_rmap(page);
+ if (!page_mapped(page))
+ try_to_free_swap(page);
put_page(page);
pte_unmap_unlock(ptep, ptl);