• L
    fs/writeback: Attach inode's wb to root if needed · 4e97e104
    luanshi 提交于
    There might have tons of files queued in the writeback, awaiting for
    writing back. Unfortunately, the writeback's cgroup has been dead. In
    this case, we reassociate the inode with another writeback, but we
    possibly can't because the writeback associated with the dead cgroup is
    the only valid one. In this case, the new writeback is allocated,
    initialized and associated with the inode in the non-stopping fashion
    until all data resident in the inode's page cache are flushed to disk.
    It causes unnecessary high system load.
    
    This fixes the issue by enforce moving the inode to root cgroup when the
    previous binding cgroup becomes dead. With it, no more unnecessary
    writebacks are created, populated and the system load decreased by about
    6x in the test case we carried out:
        Without the patch: 30% system load
        With the patch:    5%  system load
    Signed-off-by: Nluanshi <zhangliguang@linux.alibaba.com>
    Signed-off-by: NJiufei Xue <jiufei.xue@linux.alibaba.com>
    Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
    4e97e104
fs-writeback.c 72.3 KB