Re: [PATCH v3 1/5] btrfs: replace stripe extents

Johannes Thumshirn
2024-07-02T05:41:23Z

On 01.07.24 22:37, Josef Bacik wrote:
>> + if (ret == -EEXIST)
>> + ret = replace_raid_extent_item(trans, &stripe_key,
>> + stripe_extent, item_size);
>
> I had another thought, how often is this particular thing happening? Bec ause
> we're doing 3 path allocations here in the worst case. If it happens more than
> say 10% of the time then we need to allocate a path once in
> btrfs_insert_one_raid_extent(), do the insert, and if it fails re-use that path
> to do the delete and insert the new one. Thanks,

That indeed is a good question. I'll add some tracepoints to see how
often this is getting called.