Originally posted by ahrs
View Post
Idea Raised For Reducing The Size Of The AMDGPU Driver With Its Massive Header Files
Collapse
X
-
-
-
Originally posted by Vorpal View PostSure, you can use GCC/Clang attributes to change compilation flags (including optimisation level) per function. This would be quite a manual process and a massive amount of work. What would be more viable is using PGO (Profile Guided Optimisation) to record representative workloads, and use that to determine what parts are hot or not. I don't know off the top of my head exactly how that ties into optimisations levels (if at all) or if it is only about things like improving inlining/outlining. But that seems like a feasible thing to add in compilers if it isn't already supported.
The next question would then be how to distribute pre-made PGO profiles for a given source release, and that may be where this idea breaks down. Perhaps you could pull data back from PGO and use that to automatically annotate functions as hot or cold in the source though?
Originally posted by Vorpal View PostStill I doubt this would make such a big difference that it would be relevant here.
Leave a comment:
-
-
Like many others here, I wondered what the code size has to do with the boot problem, and it seems that it's not directly related. From the Plymouth issue discussion:
I believe the most time is actually spend on dynamically linking the ko after it has been decompressed / loaded into mem. That approx. 16MB of code is likely calling kernel functions like dev_dbg() / dev_info(), etc. in a lot of places and all those call sites need to be dynamically patched with the function address of those symbols. At least that is what I think is causing the biggest slowdown.Last edited by ET3D; 17 September 2024, 10:05 AM.
Leave a comment:
-
-
There are at least 2 separate classes issues they need to address to fix the issue of the driver being big and slow to load.
1. Janitorial work so that it's easier to work on it (this is an example)
2. Performance fixes, so that the driver can load faster
You need to do both types of cleanup. That's just how maintenance programming works.
Leave a comment:
-
-
Originally posted by Blisterexe View Post
Plymouth's fancy splash screens contribute considerably to linux feeling polished or good to the average person, as silly as that might seem
Leave a comment:
-
-
Why not fix plymouth instead of screwing with critical infrastructure? I personally have never seen plymouth work on any machine that had it, it breaks because of -everything-, especially if you use nvidia.
(bites tongue to avoid epic rant about how nonsensical the decision making process is in the linux community now)
Leave a comment:
-
-
Originally posted by rhbvkleef View PostI have to say, I'm not a big fan of moving the AMDGPU headers into a separate repository. Pruning the the headers and eliminating the unused bits seems to me as a much more sane solution to this problem.
Of course an even better solution would be to not store generated code in the kernel tree at all, and store the program that generates that source in stead, though that might prove difficult in the case of AMDGPU. I am not sure if that program/those programs are publicly available.
Leave a comment:
-
-
Originally posted by NeoMorpheus View PostAre we absolutely sure that the AMD code is the only guilty party here?
Maybe Plymouth needs to be adjusted to wait a bit longer?
In any case I have no objection to restructuring and optimizing the code size, but as many others on this thread have so eloquently expressed it's unlikely to be an easy task, and given the effort required care should be taken so that the changes address the issues of today, and the future, to as great a degree possible. And that will require time and input from many architects and engineers and users.
Leave a comment:
-
-
They should move documentation in headers to document files. Reference them as in the header, but leave the documentation out.
Also, split amdgpu-gcn and amdgpu-rdna into their own driver branches.
We don't need yet another bloated repo going up.
Leave a comment:
-
-
Originally posted by dragorth View Post
Well, technically, headers are definitions on how to call functions in the code. The code is the expanded form of the headers, in a sense.
The real issues seems to be there is a lot of code that isn't used, which is a different concern, for the maintainers and new folks coming to the project.
For example, imagine the Rust folks wanting to interface with the AMD Driver, they would need to read through all of the headers to find which ones to actually use, then make the equivalent to those headers in Rust.
The register headers just define the offsets and masks for registers and so that the code is readable. E.g.,
WREG32(mmMY_REGISTER, ENABLE_FEATURE_MASK);
vs.
WREG32(0x8800, (1 << 3));
The former is a lot more readable and less error prone than the latter.
Leave a comment:
-
Leave a comment: