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:
7460db5
)
memcg: fix refcnt handling at swapoff
author
KAMEZAWA Hiroyuki
<
[email protected]
>
Thu, 29 Jan 2009 22:25:13 +0000
(14:25 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 30 Jan 2009 02:04:43 +0000
(18:04 -0800)
Now, at swapoff, even while try_charge() fails, commit is executed. This
is a bug which turns the refcnt of cgroup_subsys_state negative.
Reported-by: Li Zefan <
[email protected]
>
Tested-by: Li Zefan <
[email protected]
>
Tested-by: Daisuke Nishimura <
[email protected]
>
Signed-off-by: KAMEZAWA Hiroyuki <
[email protected]
>
Reviewed-by: Daisuke Nishimura <
[email protected]
>
Cc: Balbir Singh <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/swapfile.c
patch
|
blob
|
history
diff --git
a/mm/swapfile.c
b/mm/swapfile.c
index f48b831e5e5ca5e5b400247e973aeec2a6023f94..7e6304dfafab174884bad5820a0194f449906a32 100644
(file)
--- a/
mm/swapfile.c
+++ b/
mm/swapfile.c
@@
-698,8
+698,10
@@
static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
pte_t *pte;
int ret = 1;
- if (mem_cgroup_try_charge_swapin(vma->vm_mm, page, GFP_KERNEL, &ptr))
+ if (mem_cgroup_try_charge_swapin(vma->vm_mm, page, GFP_KERNEL, &ptr))
{
ret = -ENOMEM;
+ goto out_nolock;
+ }
pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
if (unlikely(!pte_same(*pte, swp_entry_to_pte(entry)))) {
@@
-723,6
+725,7
@@
static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
activate_page(page);
out:
pte_unmap_unlock(pte, ptl);
+out_nolock:
return ret;
}