diff options
author | avg <avg@FreeBSD.org> | 2017-02-27 17:20:44 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2017-02-27 17:20:44 +0000 |
commit | b521a9020c9600e82b6791dd6024bfff721d72a8 (patch) | |
tree | 8088b34dd42fc6cb0e716beebaed1c47885d7b5e | |
parent | 1dc77a085c43cbefecfb63a858041224e8f737b1 (diff) | |
download | FreeBSD-src-b521a9020c9600e82b6791dd6024bfff721d72a8.zip FreeBSD-src-b521a9020c9600e82b6791dd6024bfff721d72a8.tar.gz |
MFC r313752,r314035: mca: use time_uptime instead of ticks for CMCI throttling
-rw-r--r-- | sys/x86/x86/mca.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/x86/x86/mca.c b/sys/x86/x86/mca.c index a917cc4..cf695ef 100644 --- a/sys/x86/x86/mca.c +++ b/sys/x86/x86/mca.c @@ -73,7 +73,7 @@ enum scan_mode { */ struct cmc_state { int max_threshold; - int last_intr; + time_t last_intr; }; #endif @@ -533,7 +533,7 @@ cmci_update(enum scan_mode mode, int bank, int valid, struct mca_record *rec) cc = &cmc_state[PCPU_GET(cpuid)][bank]; ctl = rdmsr(MSR_MC_CTL2(bank)); count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; - delta = (u_int)(ticks - cc->last_intr); + delta = (u_int)(time_uptime - cc->last_intr); /* * If an interrupt was received less than cmc_throttle seconds @@ -550,7 +550,7 @@ cmci_update(enum scan_mode mode, int bank, int valid, struct mca_record *rec) ctl |= limit; wrmsr(MSR_MC_CTL2(bank), limit); } - cc->last_intr = ticks; + cc->last_intr = time_uptime; return; } @@ -857,7 +857,7 @@ cmci_resume(int i) return; cc = &cmc_state[PCPU_GET(cpuid)][i]; - cc->last_intr = -ticks; + cc->last_intr = 0; ctl = rdmsr(MSR_MC_CTL2(i)); ctl &= ~MC_CTL2_THRESHOLD; ctl |= MC_CTL2_CMCI_EN | 1; |