Skip to content
  • Nadia Derbey's avatar
    ipc: do not use a negative value to re-enable msgmni automatic recomputing · 9eefe520
    Nadia Derbey authored
    This patch proposes an alternative to the "magical
    positive-versus-negative number trick" Andrew complained about last week
    in http://lkml.org/lkml/2008/6/24/418.
    
    This had been introduced with the patches that scale msgmni to the amount
    of lowmem.  With these patches, msgmni has a registered notification
    routine that recomputes msgmni value upon memory add/remove or ipc
    namespace creation/ removal.
    
    When msgmni is changed from user space (i.e.  value written to the proc
    file), that notification routine is unregistered, and the way to make it
    registered back is to write a negative value into the proc file.  This is
    the "magical positive-versus-negative number trick".
    
    To fix this, a new proc file is introduced: /proc/sys/kernel/auto_msgmni.
    This file acts as ON/OFF for msgmni automatic recomputing.
    
    With this patch, the process is the following:
    1) kernel boots in "automatic recomputing mode"
       /proc/sys/kernel/msgmni contains the...
    9eefe520