lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190227183650.GC31119@twin.jikos.cz>
Date:   Wed, 27 Feb 2019 19:36:50 +0100
From:   David Sterba <dsterba@...e.cz>
To:     Dennis Zhou <dennis@...nel.org>
Cc:     David Sterba <dsterba@...e.cz>, David Sterba <dsterba@...e.com>,
        Josef Bacik <josef@...icpanda.com>, Chris Mason <clm@...com>,
        Omar Sandoval <osandov@...ndov.com>,
        Nick Terrell <terrelln@...com>,
        Nikolay Borisov <nborisov@...e.com>, kernel-team@...com,
        linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] btrfs: zstd ensure reclaim timer is properly cleaned
 up

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 :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ