Skip to content
  • Tim Gore's avatar
    lib/igt_core.c : only disable low mem killer once · 48a27bca
    Tim Gore authored
    
    
    The call to low_mem_killer_disable(true) was being done
    from within function oom_adjust_for_doom. However,
    oom_adjust_for_doom gets called from 3 places. We only
    want the call to low_mem_killer_disable(true) to happen
    during common_init, so call it from here instead of from
    oom_adjust_for_doom.
    
    v2:Thomas Wood pointed out that the initial call to disable
    the low_mem_killer does not get made when we are just
    listing subtests; so I have qualified the call from the
    exit handler, which re-enables the low_mem_killer, with
    if (!igt_only_list_subtests()).
    For belt and braces I have also made low_mem_killer_disable
    idempotent, so multiple calls to disable or re-enable are
    safe.
    
    Signed-off-by: default avatarTim Gore <tim.gore@intel.com>
    [Thomas: small coding style fix]
    Signed-off-by: default avatarThomas Wood <thomas.wood@intel.com>
    48a27bca