Scheduled ideas: Two threads with one "stone"

Jan Bramkamp crest at rlwinm.de
Thu Jan 24 17:34:34 UTC 2019


On 24.01.19 17:32, Zaphod Beeblebrox wrote:
> W.R.T. hyperthreading, it's come to my attention that FreeBSD has had some
> recommendations for awhile --- namely hyperthreading is bad for secure
> systems.  That-is-to-say this is not about recent vulnerabilities of recent
> Intel flavoured CPUs, but rather some thoughts on a different solution to a
> different problem.
> 
> I was building world on my laptop when I noticed how sucky it had become.
> Now... I well know this is due to the fact that even a "nice -19 make -j32
> buildworld" will slow the normal priority userland down by about 1/2
> because the thread that is "me" on the CPU is competing with one of the
> threads that is saturating the CPU.  My normal priority thread will get
> scheduled, but it competes equally for resources with threads at much lower
> priority.

You can use `idprio 10 ...` to minimize the impact of CPU bound tasks.
If you want to go even further you could apply hierarchical resource
limits on the make process. The idprio chainloader puts make and all its
descendants into the idle scheduling class which allows normal time
sharing threads to preempt them.


More information about the freebsd-hackers mailing list