• Josef Bacik's avatar
    btrfs: do not use GFP_ATOMIC in the read endio · 48acc47d
    Josef Bacik authored
    We have done read endio in an async thread for a very, very long time,
    which makes the use of GFP_ATOMIC and unlock_extent_atomic() unneeded in
    our read endio path.  We've noticed under heavy memory pressure in our
    fleet that we can fail these allocations, and then often trip a
    BUG_ON(!allocation), which isn't an ideal outcome.  Begin to address
    this by simply not using GFP_ATOMIC, which will allow us to do things
    like actually allocate a extent state when doing
    set_extent_bits(UPTODATE) in the endio handler.
    
    End io handlers are not called in atomic context, besides we have been
    allocating failrec with GFP_NOFS so we'd notice there's a problem.
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    48acc47d
extent_io.c 159 KB