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
25#include <linux/interrupt.h>25#include <linux/interrupt.h>
26#include <linux/extable.h>26#include <linux/extable.h>
27#include <linux/uaccess.h>27#include <linux/uaccess.h>
28#include <linux/perf_event.h>
28 29
29extern void die_if_kernel(char *,struct pt_regs *,long, unsigned long *);30extern void die_if_kernel(char *,struct pt_regs *,long, unsigned long *);
30 31
@@ -116,6 +117,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr, · 85 unmodified lines
116#endif117#endif
117 if (user_mode(regs))118 if (user_mode(regs))
118 flags |= FAULT_FLAG_USER;119 flags |= FAULT_FLAG_USER;
120 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
119retry:121retry:
120 mmap_read_lock(mm);122 mmap_read_lock(mm);
121 vma = find_vma(mm, address);123 vma = find_vma(mm, address);
@@ -148,7 +150,7 @@ retry: · 26 unmodified lines
148 /* If for any reason at all we couldn't handle the fault,150 /* If for any reason at all we couldn't handle the fault,
149 make sure we exit gracefully rather than endlessly redo151 make sure we exit gracefully rather than endlessly redo
150 the fault. */152 the fault. */
151 fault = handle_mm_fault(vma, address, flags, NULL);153 fault = handle_mm_fault(vma, address, flags, regs);
152 154
153 if (fault_signal_pending(fault, regs))155 if (fault_signal_pending(fault, regs))
154 return;156 return;
@@ -164,10 +166,6 @@ retry: · 9 unmodified lines
164 }166 }
165 167
166 if (flags & FAULT_FLAG_ALLOW_RETRY) {168 if (flags & FAULT_FLAG_ALLOW_RETRY) {
167 if (fault & VM_FAULT_MAJOR)
168 current->maj_flt++;
169 else
170 current->min_flt++;
171 if (fault & VM_FAULT_RETRY) {169 if (fault & VM_FAULT_RETRY) {
172 flags |= FAULT_FLAG_TRIED;170 flags |= FAULT_FLAG_TRIED;
173 171

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