Page MenuHomeFreeBSD

sched.h: Fix _S macros for better compatibility with glibc.
ClosedPublic

Authored by dchagin on Jan 18 2023, 6:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 21, 10:47 AM
Unknown Object (File)
Oct 7 2024, 2:46 PM
Unknown Object (File)
Oct 7 2024, 2:46 PM
Unknown Object (File)
Oct 7 2024, 2:46 PM
Unknown Object (File)
Oct 7 2024, 2:46 PM
Unknown Object (File)
Oct 7 2024, 2:46 PM
Unknown Object (File)
Oct 7 2024, 2:46 PM
Unknown Object (File)
Oct 7 2024, 2:25 PM
Subscribers

Details

Summary

The macros whose names end with "_S" operate on the dynamically allocated
CPU set(s) whose size is setsize bytes.

Test Plan

glibc affinity tests

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 49241
Build 46131: arc lint + arc unit

Event Timeline

dchagin added reviewers: kib, jhb.
tests/sys/kern/sched_affinity.c
9

This seems unneeded? Plus, you should only include one of <sys/param.h> or <sys/types.h> but not both.

I do not quite understand the change. Isn't it breaking all consumers of the modified macros? At very least, I see a lot of uses for CPU_.*_S in tests/sys/kern/sched_affinity.c

sys/sys/cpuset.h
87–90

Fix tests, i planned to do it after, but not a problem to fix it now.

dchagin marked an inline comment as done.

brackets around _s

In D38110#866210, @kib wrote:

I do not quite understand the change. Isn't it breaking all consumers of the modified macros? At very least, I see a lot of uses for CPU_.*_S in tests/sys/kern/sched_affinity.c

https://cgit.freebsd.org/src/commit/sys/sys/cpuset.h?id=e2650af157bc7489deaf2c9054995f0f88a6e5da added _S macro for compatibility with GLIBC, but it's still incompatible as glibc uses cpusetsize in bytes, not in bits.

sys/sys/cpuset.h
80

WFIW, e.g. _bitset.h uses 8 instead of NBBY. At least, this avoids more user namespace pollution. Also I do not quite understand the #ifndef guards there, and limiting that to non-kernel case.

fixed, thanks. Should I ask for exp-run?

fixed, thanks. Should I ask for exp-run?

What do you expect to catch with the exp-run? It is runtime change, you multiply the input arg by eight.

This revision is now accepted and ready to land.Jan 27 2023, 1:12 PM