[Bug 270785] Performance and power efficiency regression due to pthread_cond_timedwait() changes

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 13 Apr 2023 20:15:10 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270785

--- Comment #4 from bllcha013@myuct.ac.za ---
(In reply to Mark Johnston from comment #3)

I cloned releng/13.2 and reverted commit
e21c77f80c3b1cf2bd0a9f874e15e7a8e49f0dba. Reverting this commit fixes the
regression.

I also did the dtrace output as asked - thank you for providing the dtrace
script.


releng/13.2 (standard, same as RELEASE):

syscall                     seconds   calls  errors
__sysctlbyname          0.000650415       6       0
getrusage               0.008321625     116       0
sched_yield             1.287887942   29936       0
_umtx_op               41.138906134   30136   30132
                      ------------- ------- -------
                       42.435766116   60194   30132

dtrace: description 'fbt::do_wait:entry ' matched 1 probe
CPU     ID                    FUNCTION:NAME
  2  18111                    do_wait:entry struct _umtx_time {
    struct timespec _timeout = {
        time_t tv_sec = 0xc2
        long tv_nsec = 0x2ed64521
    }
    __uint32_t _flags = 0x1
    __uint32_t _clockid = 0x4
}
  2  18111                    do_wait:entry struct _umtx_time {
    struct timespec _timeout = {
        time_t tv_sec = 0xc2
        long tv_nsec = 0x2ed7d390
    }
    __uint32_t _flags = 0x1
    __uint32_t _clockid = 0x4
}


releng/13.2 (with commit e21c77f80c3b1cf2bd0a9f874e15e7a8e49f0dba reverted):

syscall                     seconds   calls  errors
getrusage               0.003569531      58       0
sched_yield             0.168773634    3781       0
_umtx_op               16.840977734    3873    3873
                      ------------- ------- -------
                       17.013320899    7712    3873

dtrace: description 'fbt::do_wait:entry ' matched 1 probe
CPU     ID                    FUNCTION:NAME
  4  18111                    do_wait:entry struct _umtx_time {
    struct timespec _timeout = {
        time_t tv_sec = 0x6f
        long tv_nsec = 0xba6df4a
    }
    __uint32_t _flags = 0x1
    __uint32_t _clockid = 0x4
}
  3  18111                    do_wait:entry struct _umtx_time {
    struct timespec _timeout = {
        time_t tv_sec = 0x6f
        long tv_nsec = 0x8bb061f
    }
    __uint32_t _flags = 0x1
    __uint32_t _clockid = 0x4
}


So it seems that reverting the commit fixes the issue. It also helps the UniFi
Controller as well (although that wasn't impacted as drastically as Minecraft).
This might be a kernel bug as you mentioned?

-- 
You are receiving this mail because:
You are the assignee for the bug.