• Sha Zhengju's avatar
    memcg, oom: provide more precise dump info while memcg oom happening · 58cf188e
    Sha Zhengju authored
    Currently when a memcg oom is happening the oom dump messages is still
    global state and provides few useful info for users.  This patch prints
    more pointed memcg page statistics for memcg-oom and take hierarchy into
    consideration:
    
    Based on Michal's advice, we take hierarchy into consideration: supppose
    we trigger an OOM on A's limit
    
            root_memcg
                |
                A (use_hierachy=1)
               / \
              B   C
              |
              D
    then the printed info will be:
    
      Memory cgroup stats for /A:...
      Memory cgroup stats for /A/B:...
      Memory cgroup stats for /A/C:...
      Memory cgroup stats for /A/B/D:...
    
    Following are samples of oom output:
    
    (1) Before change:
    
        mal-80 invoked oom-killer:gfp_mask=0xd0, order=0, oom_score_adj=0
        mal-80 cpuset=/ mems_allowed=0
        Pid: 2976, comm: mal-80 Not tainted 3.7.0+ #10
        Call Trace:
         [<ffffffff8167fbfb>] dump_header+0x83/0x1ca
         ..... (call trace)
         [<ffffffff8168...
    58cf188e
oom_kill.c 19.5 KB