mbox series

[0/4] Small QOI fixes for transaction_kthread

Message ID 20201008122430.93433-1-nborisov@suse.com (mailing list archive)
Headers show
Series Small QOI fixes for transaction_kthread | expand

Message

Nikolay Borisov Oct. 8, 2020, 12:24 p.m. UTC
Following 4 patches make transaction_kthread code slitghly more user friendly.
Namely, patch 1 convert from open-coded multiplicaiton by HZ to using
msecs_to_jiffies helper. Patch 2 relies on the observation that the running
transaction is obtained under trans_lock so an extra check can be removed.
Patch 3/4 could possibly be squashed into 1 but the net effect is that the code
is more intuitive when sleeping in case a lower interval than commit_trans has
elapsed.


This has survived full xfstest run.

Nikolay Borisov (4):
  btrfs: Use helpers to convert from seconds to jiffies in
    transaction_kthread
  btrfs: Remove redundant check
  btrfs: Record delta directly in transaction_kthread
  btrfs: Be smarter when sleeping in transaction_kthread

 fs/btrfs/disk-io.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

--
2.17.1

Comments

David Sterba Oct. 16, 2020, 2:26 p.m. UTC | #1
On Thu, Oct 08, 2020 at 03:24:26PM +0300, Nikolay Borisov wrote:
> Following 4 patches make transaction_kthread code slitghly more user friendly.
> Namely, patch 1 convert from open-coded multiplicaiton by HZ to using
> msecs_to_jiffies helper. Patch 2 relies on the observation that the running
> transaction is obtained under trans_lock so an extra check can be removed.
> Patch 3/4 could possibly be squashed into 1 but the net effect is that the code
> is more intuitive when sleeping in case a lower interval than commit_trans has
> elapsed.
> 
> 
> This has survived full xfstest run.
> 
> Nikolay Borisov (4):
>   btrfs: Use helpers to convert from seconds to jiffies in
>     transaction_kthread
>   btrfs: Remove redundant check
>   btrfs: Record delta directly in transaction_kthread

1-3 added to misc-next, with some fixups.

>   btrfs: Be smarter when sleeping in transaction_kthread

There's a comment regarding correctness.