morrownr / 8814au

Linux Driver for USB WiFi Adapters that are based on the RTL8814AU Chipset
Other
509 stars 98 forks source link

set GCC to -O3 #29

Closed abroenni closed 3 years ago

abroenni commented 3 years ago

increase GCC compile optimization to -O3 and set linker to omit all symbol information from the output file.

morrownr commented 3 years ago

What do these two items do for us in real world terms?

This needs to be tested on kernels 4.19, 5.4 and 5.10 on both Intel/AMD and ARM platforms before merging. You tell me what testing you can handle and I will do the rest.

morrownr commented 3 years ago

@abroenni

Regarding the -O3 optimization level: Please read the following and comment:

https://www.phoronix.com/scan.php?page=news_item&px=No-O3-For-Linux-Kernel

Let me propose this: I don't see a problem with the linker symbot information change so maybe it would be a good idea to delete this PR and you resubmit 2 separate PRs.

My concern with the -O3 optimization stems from the fact that we have some users installing this driver on very old kernels. Right now we show support for kernels 2.6.24 - 5.12. Do we change support to 4.19 - 5.12? This is something we need to discuss and this is not just an issue with this driver, the improvements/fixes to one driver are usually applied to the other 4 drivers here.

abroenni commented 3 years ago

Read the link and a bit more. Interesting. Ok, I understand the issues around old gcc and kernel builds.

morrownr commented 3 years ago

@abroenni

I read an article a couple of days ago where there was testing with -O1, -O2 and -O3. I can't find the link again or I would send it. Anyway, the results showed that in many cases, -O2 gives good results. I can't find anything about whether it would help drivers or not and I can't find anything about whether it would cause problems.

I decided to compile this driver with -O2. I didn't see any problems and am running with it now. Would you be up for researching and testing the issue with an eye toward changing the default here to -O2? I don't know if it will help but I don't know that it won't either. What I do know is that a lot of people around the world are using this driver now so we need to proceed with caution.

FYI: I am in the process or moving and I may not be online much, if any, at times over the next few weeks.

abroenni commented 3 years ago

Before I subitted this PR, had come across this gentoo wiki entry on GCC Optimisation. It might reflect what you found too. Their recommendation is -O2 for package compilation. I am OK with some researching and testing. My hardware availability is probably less then yours, so when it comes to distribution/kernel combination testing, I would have to go virtual.

I am probably very close to saying that no matter what other driver capabilities are found and activated, they will not greatly improve throughput in any significant percentage dimension. In my local branch, I have tried to activate various feature combination, but no matter what I do, the throughput stays the same in AP and STA mode, the driver becomes unstable/crashes, or causes system hangs. When I say features, I mean things like STBC stream count in HT and VHT, Beamforming with old version and version2. For some driver capability implementations, I found that it only has the flag defined (like in a CONFIG_..), but then the function where it would be used, is deactivated for the 8814au, because of some other DEFINE settings. If throughput is what matters to people, than the ~550mbit you get, might be the physical max of the device. I mean it is close enough the 1300mbit, considering that wifi is half duplex, thus leaving the max at 650mbit.