linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Dennis Zhou <dennis@kernel.org>
Cc: David Sterba <dsterba@suse.cz>, David Sterba <dsterba@suse.com>,
	Josef Bacik <josef@toxicpanda.com>, Chris Mason <clm@fb.com>,
	Omar Sandoval <osandov@osandov.com>,
	Nick Terrell <terrelln@fb.com>,
	Nikolay Borisov <nborisov@suse.com>,
	kernel-team@fb.com, linux-btrfs@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: zstd ensure reclaim timer is properly cleaned up
Date: Wed, 27 Feb 2019 19:36:50 +0100	[thread overview]
Message-ID: <20190227183650.GC31119@twin.jikos.cz> (raw)
In-Reply-To: <20190227182916.GA18373@dennisz-mbp.dhcp.thefacebook.com>

On Wed, Feb 27, 2019 at 01:29:16PM -0500, Dennis Zhou wrote:
> > I've noticed while reading the code, why do you use the indirect call
> > here? The wsm.ops points to btrfs_zstd_compress so free_workspace is
> > always zstd_free_workspace.
> > 
> > The compiler is usually smart to replace such things by direct call if
> > the type has not escaped, but this is not true for btrfs_compress_op so
> > the indirect function call must be preserved.
> 
> I don't have a strong reason to use the indirect call here. It was just
> to make it consistent for everyone to use the indirection. This at least
> is in the cleanup path, so I don't think performance is that important?

It's not just that, the timer uses it too and there are indirect calls
of the alloc_workspace callback. The indirection is not used by lzo nor
zlib code, so I don't see what 'everyone' you mean. In the generic
compression code it makes sense, I see that.

> But I don't feel strongly for or against calling zstd_free_workspace()
> directly.

I feel strongly about not using the indirection when not necessary :)

  reply	other threads:[~2019-02-27 18:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 19:53 [PATCH v2] btrfs: zstd ensure reclaim timer is properly cleaned up Dennis Zhou
2019-02-27 16:44 ` David Sterba
2019-02-27 18:29   ` Dennis Zhou
2019-02-27 18:36     ` David Sterba [this message]
2019-02-27 21:24       ` Dennis Zhou

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=20190227183650.GC31119@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=dennis@kernel.org \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nborisov@suse.com \
    --cc=osandov@osandov.com \
    --cc=terrelln@fb.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;
as well as URLs for NNTP newsgroup(s).