On Fri, Feb 23, 2024 at 02:05:38AM +0100, Andrea Bolognani wrote:
Commit c07cf0a68693 tried to ensure that the Linux-compatible
syscalls would not be used on FreeBSD, but something must have
changed between then and now because I can clearly see
sched_{get,set}affinity() being used instead of their cpuset_*
counterparts on FreeBSD 14.


At first I thought this is because back then FreeBSD did not yet have
sched_setaffinity in the linux ABI, but that was added in 7.1, so that's
probably not it.  I did not dig into it more since this change makes
sense regardless.

Ensure that the BSD variants are always preferred.

Before that, fix them so that they accept either a PID or a TID.
The fact that this wasn't the case until now makes me suspect
that scenarios in which thread-level affinity is applied have
not been tested at all on the platform, because doing something
as simple as

 <vcpu placement='static' cpuset='1-2'>1</vcpu>

is enough to prevent the VM from starting, and before FreeBSD
14 the Linux compatibility APIs shouldn't have been part of the
picture at all.

Andrea Bolognani (3):
 util: Accept TIDs for virProcess{Get,Set}Affinity() on BSD
 util: Prefer cpuset_{get,set}affinity() on BSD
 util: Add debug print missing from BSD


Reviewed-by: Martin Kletzander <[email protected]>

src/util/virprocess.c | 112 +++++++++++++++++++++---------------------
1 file changed, 57 insertions(+), 55 deletions(-)

--
2.43.2
_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to