Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179836
b: refs/heads/master
c: a084b66
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jan 21, 2010
1 parent 97a2519 commit 14bbcd0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7bef6b04ca2e8e4cf667c43d7e2ab3034a869d5
refs/heads/master: a084b6678a89a106a350c12e4845f42ccc9811f0
12 changes: 10 additions & 2 deletions trunk/arch/sparc/mm/fault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/signal.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/perf_event.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/kdebug.h>
Expand Down Expand Up @@ -203,6 +204,8 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
if (in_atomic() || !mm)
goto no_context;

perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);

down_read(&mm->mmap_sem);

/*
Expand Down Expand Up @@ -249,10 +252,15 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
goto do_sigbus;
BUG();
}
if (fault & VM_FAULT_MAJOR)
if (fault & VM_FAULT_MAJOR) {
current->maj_flt++;
else
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
regs, address);
} else {
current->min_flt++;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
regs, address);
}
up_read(&mm->mmap_sem);
return;

Expand Down
13 changes: 10 additions & 3 deletions trunk/arch/sparc/mm/fault_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/perf_event.h>
#include <linux/interrupt.h>
#include <linux/kprobes.h>
#include <linux/kdebug.h>
Expand Down Expand Up @@ -296,6 +297,8 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
if (in_atomic() || !mm)
goto intr_or_no_mm;

perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);

if (!down_read_trylock(&mm->mmap_sem)) {
if ((regs->tstate & TSTATE_PRIV) &&
!search_exception_tables(regs->tpc)) {
Expand Down Expand Up @@ -400,11 +403,15 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
goto do_sigbus;
BUG();
}
if (fault & VM_FAULT_MAJOR)
if (fault & VM_FAULT_MAJOR) {
current->maj_flt++;
else
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
regs, address);
} else {
current->min_flt++;

perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
regs, address);
}
up_read(&mm->mmap_sem);

mm_rss = get_mm_rss(mm);
Expand Down

0 comments on commit 14bbcd0

Please sign in to comment.