Centos-kernel-stream-9/ipc
Lucas Zampieri 912090bcce Merge: ipc/msg: mitigate the lock contention in ipc/msg
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/4114

JIRA: https://issues.redhat.com/browse/RHEL-15602  
  
This is a set of simple backports for the following upstream series  
plus its follow-up fixes:  
  
"  
    Patch series "/msg: mitigate the lock contention in ipc/msg", v6.  
  
    Here are two patches to mitigate the lock contention in ipc/msg.  
  
    The 1st patch is to add the new interface percpu_counter_add_local and  
    percpu_counter_sub_local.  The batch size in percpu_counter_add_batch  
    should be very large in heavy writing and rare reading case.  Add the  
    "_local" version, and mostly it will do local adding, reduce the global  
    updating and mitigate lock contention in writing.  
  
    The 2nd patch is to use percpu_counter instead of atomic update in  
    ipc/msg.  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.  
   
  Link: https://lkml.kernel.org/r/20220913192538.3023708-1-jiebin.sun@intel.com  
"  
  
Signed-off-by: Rafael Aquini <aquini@redhat.com>

Approved-by: Waiman Long <longman@redhat.com>
Approved-by: Nico Pache <npache@redhat.com>
Approved-by: Chris von Recklinghausen <crecklin@redhat.com>

Merged-by: Lucas Zampieri <lzampier@redhat.com>
2024-05-16 13:29:40 +00:00
..
Makefile
compat.c
ipc_sysctl.c sysctl: allow change system v ipc sysctls inside ipc namespace 2024-04-12 11:13:33 +02:00
mq_sysctl.c sysctl: allow to change limits for posix messages queues 2024-04-12 11:13:33 +02:00
mqueue.c ipc: fix memory leak in init_mqueue_fs() 2024-03-20 19:09:33 +01:00
msg.c ipc/msg.c: fix percpu_counter use after free 2024-04-24 17:10:18 -04:00
msgutil.c ipc: Use generic ns_common::count 2020-08-19 14:13:52 +02:00
namespace.c ipc/msg: mitigate the lock contention with percpu counter 2024-04-24 17:10:17 -04:00
sem.c ipc: remove memcg accounting for sops objects in do_semtimedop() 2021-10-05 16:17:31 -04:00
shm.c ipc/shm: introduce new do_vma_munmap() to munmap 2024-04-29 14:33:14 -04:00
syscall.c
util.c proc: remove PDE_DATA() completely 2022-04-08 17:38:02 +02:00
util.h ipc/msg: mitigate the lock contention with percpu counter 2024-04-24 17:10:17 -04:00