mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
cma: fix race condition on a page
cruel, brute-force method for letting cma/migration to finish its job without stealing the lock migration_entry_wait() and creating a live-lock on the faulted page. This patch solves the case of page->_count == 2 migration failure. Change-Id: Ia94542a80e44a213831291af289bbf5ee6880bfd Signed-off-by: Heesub Shin <heesub.shin@samsung.com> Reviewed-on: http://165.213.202.130:8080/39341 Tested-by: System S/W SCM <scm.systemsw@samsung.com> Tested-by: Dongjun Shin <d.j.shin@samsung.com> Reviewed-by: Hyunju Ahn <hyunju.ahn@samsung.com> Signed-off-by: Laura Abbott <lauraa@codeaurora.org> Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This commit is contained in:
parent
23b04db439
commit
d4c6e690a5
1 changed files with 11 additions and 0 deletions
11
mm/memory.c
11
mm/memory.c
|
@ -49,6 +49,7 @@
|
|||
#include <linux/rmap.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/delayacct.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <linux/memcontrol.h>
|
||||
|
@ -2899,6 +2900,16 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
|
|||
entry = pte_to_swp_entry(orig_pte);
|
||||
if (unlikely(non_swap_entry(entry))) {
|
||||
if (is_migration_entry(entry)) {
|
||||
#ifdef CONFIG_DMA_CMA
|
||||
/*
|
||||
* FIXME: mszyprow: cruel, brute-force method for
|
||||
* letting cma/migration to finish it's job without
|
||||
* stealing the lock migration_entry_wait() and creating
|
||||
* a live-lock on the faulted page
|
||||
* (page->_count == 2 migration failure issue)
|
||||
*/
|
||||
mdelay(10);
|
||||
#endif
|
||||
migration_entry_wait(mm, pmd, address);
|
||||
} else if (is_hwpoison_entry(entry)) {
|
||||
ret = VM_FAULT_HWPOISON;
|
||||
|
|
Loading…
Reference in a new issue