• Chris Mason's avatar
    Btrfs: Allow worker threads to exit when idle · 9042846b
    Chris Mason authored
    The Btrfs worker threads don't currently die off after they have
    been idle for a while, leading to a lot of threads sitting around
    doing nothing for each mount.
    
    Also, they are unable to start atomically (from end_io hanlders).
    
    This commit reworks the worker threads so they can be started
    from end_io handlers (just setting a flag that asks for a thread
    to be added at a later date) and so they can exit if they
    have been idle for a long time.
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    9042846b
async-thread.c 15 KB