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: <dcutapnlzvglzlbta2tzcvch26g2nnptluykgz5gabcoolxywu@fwq3u7jzd3y2>
Date: Fri, 23 Aug 2024 10:51:53 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Youling Tang <youling.tang@...ux.dev>
Cc: linux-bcachefs@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Youling Tang <tangyouling@...inos.cn>
Subject: Re: [PATCH] bcachefs: Remove the handling of bch2_trans_iter_exit()
 in __bch2_bkey_get_iter()

On Fri, Aug 23, 2024 at 02:07:20PM GMT, Youling Tang wrote:
> On 23/08/2024 11:55, Kent Overstreet wrote:
> > On Fri, Aug 23, 2024 at 11:19:55AM GMT, Youling Tang wrote:
> > > From: Youling Tang <tangyouling@...inos.cn>
> > > 
> > > - Reduces bkey_err() calls.
> > > - Avoid redundant calls to bch2_trans_iter_exit() in some functions.
> > no, a function that returns an error should clean up after itself
> Yes, functions should self-clean when they fail.
> 
> However, there are repeated calls to bch2_trans_iter_exit in
> some functions, take lookup_inode() as an example,
> 
> When bkey_err(k) returns a non-zero, call bch2_trans_iter_exit()
> once in bch2_bkey_get_iter(). It is then called again in
> lookup_inode() via 'goto err'. (We can correct it by simply changing
> it to 'return ret', but there are many similar cases.)

I'm aware, but I'm not looking to microoptimize at the expense of making
the code more fragile and less clear, especially right now when the
priority is stabilizing and fixing bugs.

If you were also doing performance testing and could show that it
makes a measurable difference I'd consider it. Did you even look at the
assembly output for any of these functions? CSE might be optimizing away
the redundant calls.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ