git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vmscan: rename sc.may_swap to may_unmap
[safe/jmp/linux-2.6]
/
mm
/
swap_state.c
diff --git
a/mm/swap_state.c
b/mm/swap_state.c
index
bcb4727
..
3ecea98
100644
(file)
--- a/
mm/swap_state.c
+++ b/
mm/swap_state.c
@@
-17,6
+17,7
@@
#include <linux/backing-dev.h>
#include <linux/pagevec.h>
#include <linux/migrate.h>
#include <linux/backing-dev.h>
#include <linux/pagevec.h>
#include <linux/migrate.h>
+#include <linux/page_cgroup.h>
#include <asm/pgtable.h>
#include <asm/pgtable.h>
@@
-108,6
+109,8
@@
int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask)
*/
void __delete_from_swap_cache(struct page *page)
{
*/
void __delete_from_swap_cache(struct page *page)
{
+ swp_entry_t ent = {.val = page_private(page)};
+
VM_BUG_ON(!PageLocked(page));
VM_BUG_ON(!PageSwapCache(page));
VM_BUG_ON(PageWriteback(page));
VM_BUG_ON(!PageLocked(page));
VM_BUG_ON(!PageSwapCache(page));
VM_BUG_ON(PageWriteback(page));
@@
-118,6
+121,7
@@
void __delete_from_swap_cache(struct page *page)
total_swapcache_pages--;
__dec_zone_page_state(page, NR_FILE_PAGES);
INC_CACHE_INFO(del_total);
total_swapcache_pages--;
__dec_zone_page_state(page, NR_FILE_PAGES);
INC_CACHE_INFO(del_total);
+ mem_cgroup_uncharge_swapcache(page, ent);
}
/**
}
/**
@@
-128,7
+132,7
@@
void __delete_from_swap_cache(struct page *page)
* Allocate swap space for the page and add the page to the
* swap cache. Caller needs to hold the page lock.
*/
* Allocate swap space for the page and add the page to the
* swap cache. Caller needs to hold the page lock.
*/
-int add_to_swap(struct page *
page, gfp_t gfp_mask
)
+int add_to_swap(struct page *
page
)
{
swp_entry_t entry;
int err;
{
swp_entry_t entry;
int err;
@@
-153,7
+157,7
@@
int add_to_swap(struct page * page, gfp_t gfp_mask)
* Add it to the swap cache and mark it dirty
*/
err = add_to_swap_cache(page, entry,
* Add it to the swap cache and mark it dirty
*/
err = add_to_swap_cache(page, entry,
-
gfp_mask
|__GFP_NOMEMALLOC|__GFP_NOWARN);
+
__GFP_HIGH
|__GFP_NOMEMALLOC|__GFP_NOWARN);
switch (err) {
case 0: /* Success */
switch (err) {
case 0: /* Success */