• Daeho Jeong's avatar
    ext4: send parallel discards on commit completions · a0154344
    Daeho Jeong authored
    Now, when we mount ext4 filesystem with '-o discard' option, we have to
    issue all the discard commands for the blocks to be deallocated and
    wait for the completion of the commands on the commit complete phase.
    Because this procedure might involve a lot of sequential combinations of
    issuing discard commands and waiting for that, the delay of this
    procedure might be too much long, even to 17.0s in our test,
    and it results in long commit delay and fsync() performance degradation.
    
    To reduce this kind of delay, instead of adding callback for each
    extent and handling all of them in a sequential manner on commit phase,
    we instead add a separate list of extents to free to the superblock and
    then process this list at once after transaction commits so that
    we can issue all the discard commands in a parallel manner like XFS
    filesystem.
    
    Finally, we could enhance the discard command handling performance.
    The result was such that 17.0s delay of a single commit in the worst
    case has been enhanced to 4.8s.
    Signed-off-by: default avatarDaeho Jeong <daeho.jeong@samsung.com>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    Tested-by: default avatarHobin Woo <hobin.woo@samsung.com>
    Tested-by: default avatarKitae Lee <kitae87.lee@samsung.com>
    Reviewed-by: default avatarJan Kara <jack@suse.cz>
    a0154344
mballoc.c 147 KB