diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-19 13:19:07 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-19 13:19:07 -0700 |
commit | 5584cfbafc1a4c2a465f4423d351bb918c64cad0 (patch) | |
tree | f74dcc1ba5a6790cb3e69629696aff58bdfd827a /mm/memory.c | |
parent | 1653d2f88f43f6780eace1faeeb7b7adde8c10fb (diff) | |
parent | 31d141e3a666269a3b6fcccddb0351caf7454240 (diff) | |
download | blackbird-op-linux-5584cfbafc1a4c2a465f4423d351bb918c64cad0.tar.gz blackbird-op-linux-5584cfbafc1a4c2a465f4423d351bb918c64cad0.zip |
Merge 3.12-rc6 into usb-next.
We want those USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/mm/memory.c b/mm/memory.c index ca0003947115..1311f26497e6 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -837,6 +837,8 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, */ make_migration_entry_read(&entry); pte = swp_entry_to_pte(entry); + if (pte_swp_soft_dirty(*src_pte)) + pte = pte_swp_mksoft_dirty(pte); set_pte_at(src_mm, addr, src_pte, pte); } } @@ -3863,15 +3865,21 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, * space. Kernel faults are handled more gracefully. */ if (flags & FAULT_FLAG_USER) - mem_cgroup_enable_oom(); + mem_cgroup_oom_enable(); ret = __handle_mm_fault(mm, vma, address, flags); - if (flags & FAULT_FLAG_USER) - mem_cgroup_disable_oom(); - - if (WARN_ON(task_in_memcg_oom(current) && !(ret & VM_FAULT_OOM))) - mem_cgroup_oom_synchronize(); + if (flags & FAULT_FLAG_USER) { + mem_cgroup_oom_disable(); + /* + * The task may have entered a memcg OOM situation but + * if the allocation error was handled gracefully (no + * VM_FAULT_OOM), there is no need to kill anything. + * Just clean up the OOM state peacefully. + */ + if (task_in_memcg_oom(current) && !(ret & VM_FAULT_OOM)) + mem_cgroup_oom_synchronize(false); + } return ret; } |