Skip to content

Commit b444eed

Browse files
xzpetertorvalds
authored andcommitted
mm/ia64: 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. 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: "Luck, Tony" <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent e08157c commit b444eed

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

arch/ia64/mm/fault.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/kdebug.h>
1515
#include <linux/prefetch.h>
1616
#include <linux/uaccess.h>
17+
#include <linux/perf_event.h>
1718

1819
#include <asm/processor.h>
1920
#include <asm/exception.h>
@@ -105,6 +106,8 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
105106
flags |= FAULT_FLAG_USER;
106107
if (mask & VM_WRITE)
107108
flags |= FAULT_FLAG_WRITE;
109+
110+
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
108111
retry:
109112
mmap_read_lock(mm);
110113

@@ -143,7 +146,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
143146
* sure we exit gracefully rather than endlessly redo the
144147
* fault.
145148
*/
146-
fault = handle_mm_fault(vma, address, flags, NULL);
149+
fault = handle_mm_fault(vma, address, flags, regs);
147150

148151
if (fault_signal_pending(fault, regs))
149152
return;
@@ -166,10 +169,6 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
166169
}
167170

168171
if (flags & FAULT_FLAG_ALLOW_RETRY) {
169-
if (fault & VM_FAULT_MAJOR)
170-
current->maj_flt++;
171-
else
172-
current->min_flt++;
173172
if (fault & VM_FAULT_RETRY) {
174173
flags |= FAULT_FLAG_TRIED;
175174

0 commit comments

Comments
 (0)