History

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().

Peter Xu committed 6 years ago

Commit c0f6eda1 parent bce617e1 file · +3 −5Browse files

Unified · Split

arch/alpha/mm/fault.c+3−5
@@ -25,6 +25,7 @@ · 24 unmodified lines
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, · 85 unmodified lines
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 @@ retry: · 26 unmodified lines
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 @@ retry: · 9 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t