• Li Zefan's avatar
    cgroup: don't bother to resize pid array · 6ee211ad
    Li Zefan authored
    When we open cgroup.procs, we'll allocate an buffer and store all tasks'
    tgid in it, and then duplicate entries will be stripped. If that results
    in a much smaller pid list, we'll re-allocate a smaller buffer.
    
    But we've already sucessfully allocated memory and reading the procs
    file is a short period and the memory will be freed very soon, so why
    bother to re-allocate memory.
    Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    6ee211ad
cgroup.c 145 KB