Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: Josef Bacik <josef@toxicpanda.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/4] btrfs: Use helpers to convert from seconds to jiffies in transaction_kthread
Date: Fri, 23 Oct 2020 19:06:47 +0200	[thread overview]
Message-ID: <20201023170647.GN6756@twin.jikos.cz> (raw)
In-Reply-To: <4d6a4f4e-3f70-a984-f4b3-dfcd5731620c@suse.com>

On Wed, Oct 21, 2020 at 06:03:00PM +0300, Nikolay Borisov wrote:
> 
> 
> On 21.10.20 г. 17:51 ч., Josef Bacik wrote:
> > On 10/8/20 8:24 AM, Nikolay Borisov wrote:
> >> The kernel provides easy to understand helpers to convert from human
> >> understandable units to the kernel-friendly 'jiffies'. So let's use
> >> those to make the code easier to understand. No functional changes.
> >>
> >> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> >> ---
> >>   fs/btrfs/disk-io.c | 4 ++--
> >>   1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> >> index 764001609a15..77b52b724733 100644
> >> --- a/fs/btrfs/disk-io.c
> >> +++ b/fs/btrfs/disk-io.c
> >> @@ -1721,7 +1721,7 @@ static int transaction_kthread(void *arg)
> >>         do {
> >>           cannot_commit = false;
> >> -        delay = HZ * fs_info->commit_interval;
> >> +        delay = msecs_to_jiffies(fs_info->commit_interval * 1000);
> > 
> > Since we're now doing everything in msecs, why don't we just make sure
> > ->commit_interval is set to msecs, that way we don't have to carry
> > around the * 1000?  If we still need the multiplication we should be
> > using MSEC_PER_SEC.  Thanks,
> 
> Yes, as a matter of fact I intend on making commit_interval into
> jiffies, to completely eliminate the msecs_to_jiffies helpers here.
> 
> But that will be a follow on work once David merges the v2 of "Be
> smarter" patch.

As the commit_interval is an internal value, jiffies is ok, the
conversions happen happen for mount option set and print only. So ok
from me.

  reply	other threads:[~2020-10-23 17:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 12:24 [PATCH 0/4] Small QOI fixes for transaction_kthread Nikolay Borisov
2020-10-08 12:24 ` [PATCH 1/4] btrfs: Use helpers to convert from seconds to jiffies in transaction_kthread Nikolay Borisov
2020-10-21 14:51   ` Josef Bacik
2020-10-21 15:03     ` Nikolay Borisov
2020-10-23 17:06       ` David Sterba [this message]
2020-10-08 12:24 ` [PATCH 2/4] btrfs: Remove redundant check Nikolay Borisov
2020-10-08 12:24 ` [PATCH 3/4] btrfs: Record delta directly in transaction_kthread Nikolay Borisov
2020-10-08 12:24 ` [PATCH 4/4] btrfs: Be smarter when sleeping " Nikolay Borisov
2020-10-16 14:20   ` David Sterba
2020-10-16 16:26     ` Nikolay Borisov
2020-10-19  7:21       ` Nikolay Borisov
2020-10-20  9:44     ` [PATCH v2] " Nikolay Borisov
2020-10-16 14:26 ` [PATCH 0/4] Small QOI fixes for transaction_kthread David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201023170647.GN6756@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox