Linus personally helped Intel optimize the LAM code
- Seagate 12TB HDD: 7.46% failure rate and 1.5 year lifespan
- An American company made 0.7nm chips: EUV lithography machines can’t do it
- 14000 cores + 450W: RTX 4080 graphics card perfectly replaces the RTX 3080
- Big upgrade: The difference between Bluetooth 5.0 and 5.2
- Geeks Disappointed that RTX 4080/4090 doesn’t come with PCIe 5.0
- What are advantages and disadvantages of different load balancing?
Linus personally helped Intel optimize the LAM code.
At the end of last year, Intel submitted the LAM (Linear Address Masking: linear address mask) function to the merge window of Linux 6.2, but this function was criticized by Linus and refused to merge.
After a period of code improvement, Linus finally agreed to merge the LAM code into Linux 6.4 windows.
But Linus still seems not satisfied with the code submitted by Intel engineers.
After merging the LAM code, he first wrote a new patch to make access_ok() independent of LAM , and then wrote several patches by himself to optimize the LAM code. .
In the latest LAM optimization patch submission , Linus explains his motivation:
I was very upset with the way the “access_ok()” of the LAM (“Linear Address Mask”) was done in this version, and it actually had some small bugs, so I got my hands dirty and cleaned up the code.
The changes mainly focus on the following aspects:
- Use the sign bit of the __user pointer instead of the masked address, and check it against the TASK_SIZE range. The get/put_user() side does this part, but ‘access_ok()’ does a naive “mask and range check”, which not only generates redundant code, but also means that __access_ok itself doesn’t do its job well, copy_from_user_nmi () is not properly checked.
- Move all 64-bit code into header files only for 64-bit versions, so you don’t pollute shared x86 code, and don’t mislead users that LAM works in 32-bit environments.
- Fix bug in address mask (it doesn’t matter, just removes bad code completely).
- A couple of simple cleanups, and added a note about the access_ok() rule.
Linus rewrote about a hundred lines of code to clean up the LAM, which means that if the test is OK, the LAM function can be successfully enabled in Linux 6.4 . However, this time Linus actually personally modified the “flawed code” for Intel engineers, which is quite rare.
Linus personally helped Intel optimize the LAM code
- DIY a PBX (Phone System) on Raspberry Pi
- How to host multiple websites on Raspberry Pi 3/4?
- A Free Intercom/Paging system with Raspberry pi and old Android phones
- DIY project: How to use Raspberry Pi to build DNS server?
- Raspberry Pi project : How to use Raspberry Pi to build git server?