diff mbox series

btrfs-progs: documentation for discard tunables and metrics in sysfs

Message ID 4800c5464b3fb4ace327180ffe32c378d6356e13.1678709623.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: documentation for discard tunables and metrics in sysfs | expand

Commit Message

Anand Jain March 14, 2023, 5 a.m. UTC
Since kernel v6.1, we have had discard tunables and metrics under sysfs.
This patch adds documentation for them.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 Documentation/ch-sysfs.rst | 39 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

Comments

David Sterba March 16, 2023, 2:48 p.m. UTC | #1
On Tue, Mar 14, 2023 at 01:00:50PM +0800, Anand Jain wrote:
> Since kernel v6.1, we have had discard tunables and metrics under sysfs.
> This patch adds documentation for them.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Added to devel, thanks.

> ---
>  Documentation/ch-sysfs.rst | 39 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
> 
> diff --git a/Documentation/ch-sysfs.rst b/Documentation/ch-sysfs.rst
> index b3cd8eec4c5a..055ebd457d0b 100644
> --- a/Documentation/ch-sysfs.rst
> +++ b/Documentation/ch-sysfs.rst
> @@ -13,6 +13,7 @@ features/                      All supported features               3.14+
>  <UUID>/devinfo/<DEVID>/        Btrfs specific info for each device  5.6+
>  <UUID>/qgroups/                Global qgroup info                   5.9+
>  <UUID>/qgroups/<LEVEL>_<ID>/   Info for each qgroup                 5.9+
> +<UUID>/discard/                Discard stats and tunables           6.1+
>  =============================  ===================================  ========
>  
>  For `/sys/fs/btrfs/features/` directory, each file means a supported feature
> @@ -247,3 +248,41 @@ rsv_meta_prealloc
>          (RO, since: 5.9)
>  
>          Shows the reserved bytes for preallocated metadata.
> +
> +Files in `/sys/fs/btrfs/<UUID>/discard/` directory are:
> +
> +discardable_bytes
> +        (RO, since: 6.1)

Note that there needs to be a newline between the version info and
descrtipion, so it's rendered on separate lines.
Anand Jain March 16, 2023, 9:03 p.m. UTC | #2
On 3/16/23 22:48, David Sterba wrote:
> On Tue, Mar 14, 2023 at 01:00:50PM +0800, Anand Jain wrote:
>> Since kernel v6.1, we have had discard tunables and metrics under sysfs.
>> This patch adds documentation for them.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> 
> Added to devel, thanks.
> 
>> ---
>>   Documentation/ch-sysfs.rst | 39 ++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 39 insertions(+)
>>
>> diff --git a/Documentation/ch-sysfs.rst b/Documentation/ch-sysfs.rst
>> index b3cd8eec4c5a..055ebd457d0b 100644
>> --- a/Documentation/ch-sysfs.rst
>> +++ b/Documentation/ch-sysfs.rst
>> @@ -13,6 +13,7 @@ features/                      All supported features               3.14+
>>   <UUID>/devinfo/<DEVID>/        Btrfs specific info for each device  5.6+
>>   <UUID>/qgroups/                Global qgroup info                   5.9+
>>   <UUID>/qgroups/<LEVEL>_<ID>/   Info for each qgroup                 5.9+
>> +<UUID>/discard/                Discard stats and tunables           6.1+
>>   =============================  ===================================  ========
>>   
>>   For `/sys/fs/btrfs/features/` directory, each file means a supported feature
>> @@ -247,3 +248,41 @@ rsv_meta_prealloc
>>           (RO, since: 5.9)
>>   
>>           Shows the reserved bytes for preallocated metadata.
>> +
>> +Files in `/sys/fs/btrfs/<UUID>/discard/` directory are:
>> +
>> +discardable_bytes
>> +        (RO, since: 6.1)
> 
> Note that there needs to be a newline between the version info and
> descrtipion, so it's rendered on separate lines.

$ man ./btrfs.5
   looks good in the devel branch.

Thank you for fixing it.
  Anand
diff mbox series

Patch

diff --git a/Documentation/ch-sysfs.rst b/Documentation/ch-sysfs.rst
index b3cd8eec4c5a..055ebd457d0b 100644
--- a/Documentation/ch-sysfs.rst
+++ b/Documentation/ch-sysfs.rst
@@ -13,6 +13,7 @@  features/                      All supported features               3.14+
 <UUID>/devinfo/<DEVID>/        Btrfs specific info for each device  5.6+
 <UUID>/qgroups/                Global qgroup info                   5.9+
 <UUID>/qgroups/<LEVEL>_<ID>/   Info for each qgroup                 5.9+
+<UUID>/discard/                Discard stats and tunables           6.1+
 =============================  ===================================  ========
 
 For `/sys/fs/btrfs/features/` directory, each file means a supported feature
@@ -247,3 +248,41 @@  rsv_meta_prealloc
         (RO, since: 5.9)
 
         Shows the reserved bytes for preallocated metadata.
+
+Files in `/sys/fs/btrfs/<UUID>/discard/` directory are:
+
+discardable_bytes
+        (RO, since: 6.1)
+        Shows amount of bytes that can be discarded in the async discard and
+        nodiscard mode.
+
+discardable_extents
+        (RO, since: 6.1)
+        Shows number of extents to be discarded in the async discard and
+        nodiscard mode.
+
+discard_bitmap_bytes
+        (RO, since: 6.1)
+        Shows amount of discarded bytes from data tracked as bitmaps.
+
+discard_extent_bytes
+        (RO, since: 6.1)
+        Shows amount of discarded extents from data tracked as bitmaps.
+
+discard_bytes_saved
+        (RO, since: 6.1)
+        Shows the amount of bytes that were reallocated without being discarded.
+
+kbps_limit
+        (RW, since: 6.1)
+        Tunable limit of kilobytes per second issued as discard IO in the async
+        discard mode.
+
+iops_limit
+        (RW, since: 6.1)
+        Tunable limit of number of discard IOs to be issued in the async
+        discard mode.
+
+max_discard_size
+        (RW, since: 6.1)
+        Tunable limit for size of one IO discard request.