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 <tangyoul...@kylinos.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.

Reply via email to