-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only support set_cpu_affinity with glibc for musl compat #1517
Conversation
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentaadl Accu adoc alignedallocator asciidoctor autodetect autonumbering awt bavail bbd bc bithacks BLSP bootup capout chown cinttypes Classloader classpath compat componentaction compositestructures concat configurator creatingdocsetswithdoxygen deserializer Dinstall dll doall Donatas donsim ecore eps errstr esac fprim FPRIMEPROTOCOL getenv gethostbyname getmtime getppid gettempdir gmail Gnd GNDIF groupadd groupmod hdp HOMEPAGE hostent ifchange IFXML IJET includefile inorder INSTALLDIR instanceof interoperability Inttype isfgen isfpluginexec isfxmlwriter itcl javabuilder javac javanature javax jdt jf JFile jmi JOption junit kevensen magicdraw mcternan mdbasiccomponents mdinternalstructures mdkernel mdports mdprofiles mdxml mdzip memoization memoize mngr mpmcs mscgen nasafprime netdb Netscape's NGAT nh nio nomagic nondetached nroff OMG's OS'es ovrTrace peeker placeholders PLUGINDIR ppid Prepends println propvals PROTOCOLINTERFACE PYPI refman RHEL RPISCHEDCONTEXTS saikiranra seander Simkunas SOCKETIPDRIVERTYPES SQL's sramanan startword strcat strcpy submenu tcl templating textui tkgui tmpd tmpdir toclevels toolbar ubuntu uk ul uml urllib useradd usermod ve virtualenv vmsize vn watney workaround workspaces Xmx Xss XvfbSome files were were automatically ignoredThese sample patterns would exclude them:
You should consider adding them to:
File matching is via Perl regular expressions. To check these files, more of their words need to be in the dictionary than not. You can use To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the git@github.com:aditsachde/fprime.git repository
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great - this has heritage in how we handle MacOS, where we also don't support thread affinity.
It would be great to support thread affinity on musl, but agree with your judgement call that being deterministic by setting affinity prior to thread creation is more important than portability.
Hopefully musl gains some ability to set thread affinity prior to creation at some point.
Including |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. @Joshua-Anderson one more once-over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Os/Task
Change Description
Only support set_cpu_affinity when using glibc. Detects glibc in a way that will not break due to glibc updates.
Rationale
This PR is meant as a discussion and not necessarily merged in as is. We are aiming to deploy fprime on the Onion Omega2, whose toolchain uses musl instead of glibc. This is one of the two changes (#1508) required to support building fprime with musl.
As mentioned in this discussion (#1507), it would be preferred to be able to set cpu affinity when musl. However, musl only supports setting cpu affinity after starting the thread using the
pthread_setaffinity_np
function, and not before, usingpthread_attr_setaffinity_np
.It is possible to change the ordering, so that fprime sets CPU affinity after starting the thread. This then raises the question of what to do if starting the thread succeeds, but setting CPU affinity fails. If there is a way to acceptably handle this case, then it would make sense to switch this ordering and use
pthread_setaffinity_np
instead.I would appreciate any thoughts on the best way this, and on musl compatibility in general.
Testing/Review Recommendations
This PR was opened to as a discussion, as mentioned in rational. For testing, CI should validate the change.
Future Work
Add a CI pipeline to run build and integration tests on a musl based system.