Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139667
b: refs/heads/master
c: 3c776e6
h: refs/heads/master
i:
  139665: 006ca28
  139663: 10a3ceb
v: v3
  • Loading branch information
Daisuke Nishimura authored and Linus Torvalds committed Apr 3, 2009
1 parent 70e0bca commit bbdde1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3918b96e03b2b8dd05889320623f6870e81d35ec
refs/heads/master: 3c776e64660028236313f0e54f3a9945764422df
15 changes: 13 additions & 2 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,13 +994,24 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
static struct mem_cgroup *try_get_mem_cgroup_from_swapcache(struct page *page)
{
struct mem_cgroup *mem;
struct page_cgroup *pc;
swp_entry_t ent;

VM_BUG_ON(!PageLocked(page));

if (!PageSwapCache(page))
return NULL;

ent.val = page_private(page);
mem = lookup_swap_cgroup(ent);
pc = lookup_page_cgroup(page);
/*
* Used bit of swapcache is solid under page lock.
*/
if (PageCgroupUsed(pc))
mem = pc->mem_cgroup;
else {
ent.val = page_private(page);
mem = lookup_swap_cgroup(ent);
}
if (!mem)
return NULL;
if (!css_tryget(&mem->css))
Expand Down

0 comments on commit bbdde1f

Please sign in to comment.