Although /cvs/src/sys/arch/amd64/include/pctr.h has changed meanwhile, i've tested with your diff and also tried the one from kettenis@.

I still see the same error with both. net/zabbix still shows a high process utilization every 15-30 minutes. And again...as soon as i switch

kern.timecounter.hardware: tsc -> acpihpet0

it works fine.

On 8/25/19 5:33 PM, Paul Irofti wrote:
Hi,

Can you guys test this diff for me and let me know what happens or if it
fixes your issue?

This is supposed to be applied on top of a clean current source tree.


Thank you,
Paul


Index: arch/amd64/amd64/tsc.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/tsc.c,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 tsc.c
--- arch/amd64/amd64/tsc.c      9 Aug 2019 15:20:05 -0000       1.13
+++ arch/amd64/amd64/tsc.c      25 Aug 2019 15:25:40 -0000
@@ -210,7 +210,7 @@ cpu_recalibrate_tsc(struct timecounter *
  uint
  tsc_get_timecount(struct timecounter *tc)
  {
-       return rdtsc() + curcpu()->ci_tsc_skew;
+       return rdtsc();
  }
void
Index: arch/amd64/include/cpufunc.h
===================================================================
RCS file: /cvs/src/sys/arch/amd64/include/cpufunc.h,v
retrieving revision 1.34
diff -u -p -u -p -r1.34 cpufunc.h
--- arch/amd64/include/cpufunc.h        28 Jun 2019 21:54:05 -0000      1.34
+++ arch/amd64/include/cpufunc.h        25 Aug 2019 15:25:40 -0000
@@ -283,13 +283,14 @@ mfence(void)
  }
static __inline u_int64_t
-rdtsc(void)
+rdtsc_(void)
  {
        uint32_t hi, lo;
__asm volatile("rdtsc" : "=d" (hi), "=a" (lo));
        return (((uint64_t)hi << 32) | (uint64_t) lo);
  }
+#define rdtsc() (rdtsc_() + curcpu()->ci_tsc_skew)
static __inline u_int64_t
  rdpmc(u_int pmc)
Index: arch/amd64/include/pctr.h
===================================================================
RCS file: /cvs/src/sys/arch/amd64/include/pctr.h,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 pctr.h
--- arch/amd64/include/pctr.h   25 Mar 2019 18:48:12 -0000      1.6
+++ arch/amd64/include/pctr.h   25 Aug 2019 15:25:40 -0000
@@ -51,7 +51,7 @@ struct pctrst {
#define _PATH_PCTR "/dev/pctr" -#define rdtsc() \
+#define rdtsc1()                                                       \
  ({                                                            \
        u_int32_t hi, lo;                                       \
        __asm volatile("rdtsc" : "=d" (hi), "=a" (lo));           \


--
Mark Patruck ( mark at wrapped.cx )
GPG key 0xF2865E51 / 187F F6D3 EE04 1DCE 1C74  F644 0D3C F66F F286 5E51

https://www.wrapped.cx

Reply via email to