Files

1.4 KiB

title, type, source, source_url, author, handle, post_id, date, archived, draft, tags, description, in_reply_to
title type source source_url author handle post_id date archived draft tags description in_reply_to
Working on the Linux thread priority code. archive twitter https://x.com/NOTimothyLottes/status/2071937360288235902 NOTimothyLottes NOTimothyLottes 2071937360288235902 2026-06-30 2026-08-23 true
archive
twitter
NOTimothyLottes
Working on the Linux thread priority code.

Source

Thread

1/

Working on the Linux thread priority code. Linux doesn't allow sched_attr.size to be minimized to just what is required for the scheduling mode (my prior bug). So I statically allocate the structures already filled in and cacheline aligned ...

Media (not lifted): 2071937360288235902_HMD_iq0XcAASnSn_orig.png

2/

Theory says: better for size, worse for perf! Global structure will miss the cache. The alternative is to allow the code to generate the structure on the stack, which is likely in cache, and burn a few more cachelines of code (which gets linear prefetch).

3/

Clearly the default linux won't allow my non-blessed user to get SCHED_FIFO, and it also seems like my nice(-20) SCHED_OTHER backup is also not allowed either. Damn. More stuff to workaround.

Media (not lifted): 2071938677584863448_HMEBJNuW4AE8JUV_orig.png