Comment 0 for bug 2058485

Revision history for this message
Thibf (thibf) wrote :

This is a public version of https://bugs.launchpad.net/bugs/2034980

Backport: ipc/msg: mitigate the lock contention with percpu counter (merged upstream in 6.1) 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:
  72d1e611082e ipc/msg: mitigate the lock contention with percpu counter

[Test Plan]

I have tested this code.

[Where problems could occur]

TODO