mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
ANDROID: mm: spf: fix task fault accounting
SPF has missed per-process fault account logic. Fix it. Bug: 187072626 Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: Ibd854bf350721917ef0be1af65055691d16b52f0
This commit is contained in:
parent
348fb920cf
commit
458e81ecf7
|
|
@ -576,7 +576,7 @@ static int __kprobes do_page_fault(unsigned long far, unsigned int esr,
|
||||||
* let's try a speculative page fault without grabbing the
|
* let's try a speculative page fault without grabbing the
|
||||||
* mmap_sem.
|
* mmap_sem.
|
||||||
*/
|
*/
|
||||||
fault = handle_speculative_fault(mm, addr, mm_flags, &vma);
|
fault = handle_speculative_fault(mm, addr, mm_flags, &vma, regs);
|
||||||
if (fault != VM_FAULT_RETRY)
|
if (fault != VM_FAULT_RETRY)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1316,7 +1316,7 @@ void do_user_addr_fault(struct pt_regs *regs,
|
||||||
* protection keys since it can't be resolved.
|
* protection keys since it can't be resolved.
|
||||||
*/
|
*/
|
||||||
if (!(hw_error_code & X86_PF_PK)) {
|
if (!(hw_error_code & X86_PF_PK)) {
|
||||||
fault = handle_speculative_fault(mm, address, flags, &vma);
|
fault = handle_speculative_fault(mm, address, flags, &vma, regs);
|
||||||
if (fault != VM_FAULT_RETRY)
|
if (fault != VM_FAULT_RETRY)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1792,11 +1792,13 @@ extern int fixup_user_fault(struct mm_struct *mm,
|
||||||
extern vm_fault_t __handle_speculative_fault(struct mm_struct *mm,
|
extern vm_fault_t __handle_speculative_fault(struct mm_struct *mm,
|
||||||
unsigned long address,
|
unsigned long address,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
struct vm_area_struct **vma);
|
struct vm_area_struct **vma,
|
||||||
|
struct pt_regs *regs);
|
||||||
static inline vm_fault_t handle_speculative_fault(struct mm_struct *mm,
|
static inline vm_fault_t handle_speculative_fault(struct mm_struct *mm,
|
||||||
unsigned long address,
|
unsigned long address,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
struct vm_area_struct **vma)
|
struct vm_area_struct **vma,
|
||||||
|
struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Try speculative page fault for multithreaded user space task only.
|
* Try speculative page fault for multithreaded user space task only.
|
||||||
|
|
@ -1805,7 +1807,7 @@ static inline vm_fault_t handle_speculative_fault(struct mm_struct *mm,
|
||||||
*vma = NULL;
|
*vma = NULL;
|
||||||
return VM_FAULT_RETRY;
|
return VM_FAULT_RETRY;
|
||||||
}
|
}
|
||||||
return __handle_speculative_fault(mm, address, flags, vma);
|
return __handle_speculative_fault(mm, address, flags, vma, regs);
|
||||||
}
|
}
|
||||||
extern bool can_reuse_spf_vma(struct vm_area_struct *vma,
|
extern bool can_reuse_spf_vma(struct vm_area_struct *vma,
|
||||||
unsigned long address);
|
unsigned long address);
|
||||||
|
|
@ -1813,7 +1815,8 @@ extern bool can_reuse_spf_vma(struct vm_area_struct *vma,
|
||||||
static inline vm_fault_t handle_speculative_fault(struct mm_struct *mm,
|
static inline vm_fault_t handle_speculative_fault(struct mm_struct *mm,
|
||||||
unsigned long address,
|
unsigned long address,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
struct vm_area_struct **vma)
|
struct vm_area_struct **vma,
|
||||||
|
struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
return VM_FAULT_RETRY;
|
return VM_FAULT_RETRY;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5063,7 +5063,8 @@ static vm_fault_t ___handle_speculative_fault(struct mm_struct *mm,
|
||||||
|
|
||||||
vm_fault_t __handle_speculative_fault(struct mm_struct *mm,
|
vm_fault_t __handle_speculative_fault(struct mm_struct *mm,
|
||||||
unsigned long address, unsigned int flags,
|
unsigned long address, unsigned int flags,
|
||||||
struct vm_area_struct **vma)
|
struct vm_area_struct **vma,
|
||||||
|
struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
vm_fault_t ret;
|
vm_fault_t ret;
|
||||||
|
|
||||||
|
|
@ -5081,6 +5082,7 @@ vm_fault_t __handle_speculative_fault(struct mm_struct *mm,
|
||||||
if (ret != VM_FAULT_RETRY) {
|
if (ret != VM_FAULT_RETRY) {
|
||||||
put_vma(*vma);
|
put_vma(*vma);
|
||||||
*vma = NULL;
|
*vma = NULL;
|
||||||
|
mm_account_fault(regs, address, flags, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user