[SPR] performance: Remove operations to mm_struct out of file mapping lock's critical section
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Jammy |
New
|
Undecided
|
Unassigned |
Bug Description
This is a public version of https:/
Backport: 6852c46c783d mm/mmap: move vma operations to mm_struct out of the critical section of file mapping lock (merged upstream in 6.6) to jammy
[Impact]
The msg_bytes and msg_hdrs atomic counters are frequently updated when IPC msg queue is in heavy use, causing heavy cache bounce and overhead. Change them to percpu_counter greatly improve the performance. Since there is one percpu struct per namespace, additional memory cost is minimal. Reading of the count done in msgctl call, which is infrequent. So the need to sum up the counts in each CPU is infrequent.
[Fix]
Backport:
6852c46c783d mm/mmap: move vma operations to mm_struct out of the critical section of file mapping lock
[Test]
I have tested this code.
[Where problems could occur]
TODO