logoalt Hacker News

csmpltnyesterday at 8:31 PM3 repliesview on HN

> "there's no way to set cpu affinity at least from userland"

How is that even possible. What's the excuse?

On Windows, setting process affinity has been around since the Windows NT days.


Replies

thesuitonymyesterday at 8:55 PM

The gp already answered you, "this sort of work is not a priority for OpenBSD."

OpenBSD is a small, niche operating system, and it really only gets support for something if it solves a problem for someone who writes OpenBSD code. In a way, this is nice, because you never get half-assed features that kinda-sorta work sometimes, maybe. Everything either works exactly as you'd expect, or it's just not there.

I love OpenBSD, but there are some tasks it's just not suited for, and that's fine, too.

toast0yesterday at 8:53 PM

I was pretty sure I had seen a mailing list post from Theo about it, but I can't find it now. The only relevant thread I can find is this one [1], which pretty much just says "we don't do it for userland"; but does say it is available inside the kernel, and I have seen some mentions in recent release notes for OpenBSD of binding PF things by toeplitz hash, which indicates the right progression for that ... but it's still hard to get max performance from a simple network daemon without binding the userland threads to same core that the kernel processes the flow with. Once your daemon starts doing substantial work, binding cpus isn't as important, but if it's something like an authoritative DNS server or HAProxy with plain sockets, the performance benefit from eliminating cross-core communication can be tremendous.

[1] https://marc.info/?l=openbsd-misc&m=152507006602422&w=2

doubled112yesterday at 8:50 PM

It's the OS's job to manage resources.

show 1 reply