• Colin Cross's avatar
    staging: lowmemorykiller: Make default lowmemorykiller debug message useful · cc635da2
    Colin Cross authored
    lowmemorykiller debug messages are inscrutable and mostly useful
    for debugging the lowmemorykiller, not explaining why a process
    was killed.  Make the messages more useful by prefixing them
    with "lowmemorykiller: " and explaining in more readable terms
    what was killed, who it was killed for, and why it was killed.
    
    The messages now look like:
    [   76.997631] lowmemorykiller: Killing 'droid.gallery3d' (2172), adj 1000,
    [   76.997635]    to free 27436kB on behalf of 'kswapd0' (29) because
    [   76.997638]    cache 122624kB is below limit 122880kB for oom_score_adj 1000
    [   76.997641]    Free memory is -53356kB above reserved
    
    A negative number for free memory above reserved means some of the
    reserved memory has been used and is being regenerated by kswapd,
    which is likely what called the shrinkers.
    
    Cc: Android Kernel Team <kernel-team@android.com>
    Cc: Greg KH <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarColin Cross <ccross@android.com>
    [jstultz: Minor checkpatch tweaks]
    Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    cc635da2
lowmemorykiller.c 6.4 KB