Re: [PATCH 1/2] btree: Fix tree corruption in btree_get_prev()

From: Roland Dreier
Date: Wed Jun 06 2012 - 20:44:36 EST


On Wed, Jun 6, 2012 at 4:36 PM, Roland Dreier <roland@xxxxxxxxxx> wrote:
> On the other hand, your change makes me think we don't
> even need a separate iterator (and we can avoid the variable
> length array declaration)

FWIW with that change on top of my patch, I see

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-123 (-123)
function old new delta
btree_get_prev 646 523 -123

on x86-64, so avoiding the variable length array is definitely
worth something.

So the issue for me is whether messing with the caller's
__key storage is OK, or if it's worth having a temporary
local variable.

- R.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/