Bug 265337 - There were annoying microfreezes lasting 0.1-0.2 sec at any work: scrolling through texts, watching videos, playing audio, even moving the window across the screen gave such delays.
Summary: There were annoying microfreezes lasting 0.1-0.2 sec at any work: scrolling t...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.1-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-20 09:23 UTC by Vladimir Noskov
Modified: 2022-07-21 12:33 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Noskov 2022-07-20 09:23:34 UTC
FreeBSD wcsn 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64
CPU: AMD Ryzen 5 3600 6-Core Processor (3600.10-MHz K8-class CPU)
vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]'
device = 'Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]'

Have last KDE Plasma, amdgpu, mesa, drm.

There were annoying microfreezes lasting 0.1-0.2 sec at any work: scrolling through texts, watching videos, playing audio, even moving the window across the screen gave such delays.

Accidentally came across a mention of the key: kern.sched.steal_thresh.

I write to sysctl.conf:

kern.sched.steal_thresh=1
machdep.idle=mwait

Setting it to 0 or 1 (default is 2) sysctl kern.sched.steal_thresh=0(1)
completely eliminated all microphryses.
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2022-07-20 13:48:12 UTC
If you are willing to test, please try building and running a kernel from the main branch (no need to replace anything else) with default settings.  A few race conditions in the scheduler were fixed, which could result in CPUs going idle with work to do.  In some sense, setting steal_thresh=1 can work around these problems.

> kern.sched.steal_thresh=1
> machdep.idle=mwait

Are both settings needed?
Comment 2 Vladimir Noskov 2022-07-20 15:22:49 UTC
(In reply to Mark Johnston from comment #1)
Нет, для предотвращения microfreeze нужно только kern.sched.steal_thresh=1
Comment 3 Vladimir Noskov 2022-07-20 15:26:56 UTC
(In reply to Mark Johnston from comment #1)
Sorry///

No, to prevent microfreeze, you only need kern.sched.steal_thresh=1
Comment 4 Vladimir Noskov 2022-07-21 12:33:52 UTC
Link to the discussion in the forum:
https://forums.freebsd.org/threads/microfreezes-freebsd-13.85513/