On Fri, Aug 23, 2024 at 02:07:20PM GMT, Youling Tang wrote:I haven't performed the corresponding performance testing. Looking at
On 23/08/2024 11:55, Kent Overstreet wrote:I'm aware, but I'm not looking to microoptimize at the expense of making
On Fri, Aug 23, 2024 at 11:19:55AM GMT, Youling Tang wrote:Yes, functions should self-clean when they fail.
From: Youling Tang <tangyouling@xxxxxxxxxx>no, a function that returns an error should clean up after itself
- Reduces bkey_err() calls.
- Avoid redundant calls to bch2_trans_iter_exit() in some functions.
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.)
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.