Skip to content

Commit c0f6eda

Browse files
xzpetertorvalds
authored andcommitted
mm/alpha: use general page fault accounting
Use the general page fault accounting by passing regs into handle_mm_fault(). Add the missing PERF_COUNT_SW_PAGE_FAULTS perf events too. Note, the other two perf events (PERF_COUNT_SW_PAGE_FAULTS_[MAJ|MIN]) were done in handle_mm_fault(). Signed-off-by: Peter Xu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent bce617e commit c0f6eda

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

arch/alpha/mm/fault.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/interrupt.h>
2626
#include <linux/extable.h>
2727
#include <linux/uaccess.h>
28+
#include <linux/perf_event.h>
2829

2930
extern void die_if_kernel(char *,struct pt_regs *,long, unsigned long *);
3031

@@ -116,6 +117,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
116117
#endif
117118
if (user_mode(regs))
118119
flags |= FAULT_FLAG_USER;
120+
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
119121
retry:
120122
mmap_read_lock(mm);
121123
vma = find_vma(mm, address);
@@ -148,7 +150,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
148150
/* If for any reason at all we couldn't handle the fault,
149151
make sure we exit gracefully rather than endlessly redo
150152
the fault. */
151-
fault = handle_mm_fault(vma, address, flags, NULL);
153+
fault = handle_mm_fault(vma, address, flags, regs);
152154

153155
if (fault_signal_pending(fault, regs))
154156
return;
@@ -164,10 +166,6 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
164166
}
165167

166168
if (flags & FAULT_FLAG_ALLOW_RETRY) {
167-
if (fault & VM_FAULT_MAJOR)
168-
current->maj_flt++;
169-
else
170-
current->min_flt++;
171169
if (fault & VM_FAULT_RETRY) {
172170
flags |= FAULT_FLAG_TRIED;
173171

0 commit comments

Comments
 (0)