• David Rientjes's avatar
    mm, oom: rename zonelist locking functions · e972a070
    David Rientjes authored
    try_set_zonelist_oom() and clear_zonelist_oom() are not named properly
    to imply that they require locking semantics to avoid out_of_memory()
    being reordered.
    
    zone_scan_lock is required for both functions to ensure that there is
    proper locking synchronization.
    
    Rename try_set_zonelist_oom() to oom_zonelist_trylock() and rename
    clear_zonelist_oom() to oom_zonelist_unlock() to imply there is proper
    locking semantics.
    
    At the same time, convert oom_zonelist_trylock() to return bool instead
    of int since only success and failure are tested.
    Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
    Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Rik van Riel <riel@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e972a070
oom_kill.c 19.8 KB