-
Notifications
You must be signed in to change notification settings - Fork 362
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
Run binary package generation and file classification in parallel threads #695
Run binary package generation and file classification in parallel threads #695
Commits on May 14, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 0bbac87 - Browse repository at this point
Copy the full SHA 0bbac87View commit details -
Refactor filename generation and dir check out of packageBinary()
These are clearly separate operations that deserve functions of their own, and this makes memory management nicer. In addition, in case the directory creation fails we now actually error out instead of trying to continue, and take care not to fail in case somebody created it behind our back. No other functional changes though.
Configuration menu - View commit details
-
Copy full SHA for 261fe54 - Browse repository at this point
Copy the full SHA 261fe54View commit details -
Remember the filename of built packages in the package struct
No functional changes and doesn't make much difference here, but we'll need this later.
Configuration menu - View commit details
-
Copy full SHA for 179690f - Browse repository at this point
Copy the full SHA 179690fView commit details -
Refactor package set checking out of packageBinaries()
Now that we can, split the "lets run something on generated packages" check out of packageBinaries(), it doesn't belong there at all. No functional changes other fix attempt to check non-built packages which return with no filename but RPMRC_OK from packageBinary().
Configuration menu - View commit details
-
Copy full SHA for 22e1805 - Browse repository at this point
Copy the full SHA 22e1805View commit details -
Remember package creation result in packages themselves
No functional change, but we'll need this later.
Configuration menu - View commit details
-
Copy full SHA for ec1a0e0 - Browse repository at this point
Copy the full SHA ec1a0e0View commit details -
Copy changelogs from src.rpm, not first binary package
The comment has been wrong for more than twenty years... No functional changes here, but this will make a difference in the next commits.
Configuration menu - View commit details
-
Copy full SHA for e3b2ca0 - Browse repository at this point
Copy the full SHA e3b2ca0View commit details -
Add infrastructure for OpenMP support in librpmbuild
Enable OpenMP use in librpmbuild and set the number of OMP threads from rpm config after spec parsing. The place matters as we want to allow individual specs to control and disable parallel builds.
Configuration menu - View commit details
-
Copy full SHA for a9462af - Browse repository at this point
Copy the full SHA a9462afView commit details -
Run binary package generation in parallel threads
It's worth noting that this really is walking on thin ice as only few parts of rpm are thread-protected. The spec is entirely unprotected so must be accessed only for read-only purposes from parallel jobs (and we should work towards enforcing that via const-correctness and other protection as needed), and similarly the package struct and headers are unprotected so they can only be manipulated within a single thread. Based on initial work by Alexander Kanavin in PR rpm-software-management#226
Configuration menu - View commit details
-
Copy full SHA for fabfb6b - Browse repository at this point
Copy the full SHA fabfb6bView commit details -
Run file classification in parallel threads
Our file classification is not exactly in large quantities. Fedora's kernel-debuginfo-common has circa 25000 files, and classifying them serially takes about a minute on my rusty old T520. With parallelization this goes down to ~24s. It's all remarkably simple, except for the fact that libmagic is not thread-safe so we need separate magic handles for each of our threads. This will leak those libmagic handles on error situations, I don't see any obvious, nice way to handle that.
Configuration menu - View commit details
-
Copy full SHA for 94e5708 - Browse repository at this point
Copy the full SHA 94e5708View commit details