• David Sterba's avatar
    btrfs: sysfs: show discard stats and tunables in non-debug build · fb731430
    David Sterba authored
    When discard=async was introduced there were also sysfs knobs and stats
    for debugging and tuning, hidden under CONFIG_BTRFS_DEBUG. The defaults
    have been set and so far seem to satisfy all users on a range of
    workloads. As there are not only tunables (like iops or kbps) but also
    stats tracking amount of discardable bytes, that should be available
    when the async discard is on (otherwise it's not).
    
    The stats are moved from the per-fs debug directory, so it's under
      /sys/fs/btrfs/FSID/discard
    
    - discard_bitmap_bytes - amount of discarded bytes from data tracked as
                             bitmaps
    - discard_extent_bytes - dtto but as extents
    - discard_bytes_saved -
    - discardable_bytes - amount of bytes that can be discarded
    - discardable_extents - number of extents to be discarded
    - iops_limit - tunable limit of number of discard IOs to be issued
    - kbps_limit - tunable limit of kilobytes per second issued as discard IO
    - max_discard_size - tunable limit for size of one IO discard request
    Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    fb731430
ctree.h 140 KB