emulate sched_{get,set}affinity and sysconf(_SC_NPROCESSORS_*)#2602
emulate sched_{get,set}affinity and sysconf(_SC_NPROCESSORS_*)#2602stevenengler merged 8 commits intoshadow:mainfrom
sysconf(_SC_NPROCESSORS_*)#2602Conversation
|
hum, looks like in docker in ubuntu (and probably in ubuntu out of docker), instead of reading |
Codecov ReportBase: 68.06% // Head: 66.87% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2602 +/- ##
==========================================
- Coverage 68.06% 66.87% -1.19%
==========================================
Files 199 200 +1
Lines 29199 29279 +80
Branches 5735 5759 +24
==========================================
- Hits 19873 19581 -292
- Misses 4739 5128 +389
+ Partials 4587 4570 -17
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
stevenengler
left a comment
There was a problem hiding this comment.
I think in general we'd want a slightly different design for this.
- The union in
RegularFilemakes it easier to introduce bugs in the future since we have a single struct trying to emulate two different behaviours at once with different fields. I think we'd want a different struct for files representing kernel data (not aRegularFile). - The type should be more flexible for supporting other shadow data, including data that isn't represented by a string. For example, we'd want a type that can represent things like
/sys/devices/system/cpu/online, but also/proc/uptimeand other dynamically updated kernel files.
But the RegularFile struct is essentially in maintenance mode at the moment and has some other issues, and we'll want to overhaul it when we move it to rust anyways. So I think it's fine to add this as-is. @sporksmith Any thoughts?
stevenengler
left a comment
There was a problem hiding this comment.
Thanks! And for the merge conflict, feel free to rebase or merge main, whichever is easier.
9dcea4c to
88515da
Compare
|
Thanks both for your work on this! I'm looking forward to the reduced warning log noise (and corresponding element of uncertainty about program behavior when these fail) :) |
fix #2101
I've confirmed openjdk no longer warns about
sched_getaffinity, and when disabling the syscall but keeping the overriding of sysfs, it complains and reports 1 online processor.I did my best for the filesystem part, but I'm not very confident in writing C