Skip to content

Commit 35e45f3

Browse files
xzpetertorvalds
authored andcommitted
mm/s390: use general page fault accounting
Use the general page fault accounting by passing regs into handle_mm_fault(). It naturally solve the issue of multiple page fault accounting when page fault retry happened. Signed-off-by: Peter Xu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Gerald Schaefer <[email protected]> Acked-by: Gerald Schaefer <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Christian Borntraeger <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 5ac365a commit 35e45f3

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

arch/s390/mm/fault.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access)
476476
* make sure we exit gracefully rather than endlessly redo
477477
* the fault.
478478
*/
479-
fault = handle_mm_fault(vma, address, flags, NULL);
479+
fault = handle_mm_fault(vma, address, flags, regs);
480480
if (fault_signal_pending(fault, regs)) {
481481
fault = VM_FAULT_SIGNAL;
482482
if (flags & FAULT_FLAG_RETRY_NOWAIT)
@@ -486,21 +486,7 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access)
486486
if (unlikely(fault & VM_FAULT_ERROR))
487487
goto out_up;
488488

489-
/*
490-
* Major/minor page fault accounting is only done on the
491-
* initial attempt. If we go through a retry, it is extremely
492-
* likely that the page will be found in page cache at that point.
493-
*/
494489
if (flags & FAULT_FLAG_ALLOW_RETRY) {
495-
if (fault & VM_FAULT_MAJOR) {
496-
tsk->maj_flt++;
497-
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
498-
regs, address);
499-
} else {
500-
tsk->min_flt++;
501-
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,
502-
regs, address);
503-
}
504490
if (fault & VM_FAULT_RETRY) {
505491
if (IS_ENABLED(CONFIG_PGSTE) && gmap &&
506492
(flags & FAULT_FLAG_RETRY_NOWAIT)) {

0 commit comments

Comments
 (0)