On Fri, Jul 20, 2018 at 01:28:29AM -0400, Jeff King wrote:

> @@ -162,8 +166,10 @@ struct object_entry *packlist_alloc(struct packing_data 
> *pdata,
>  
>               if (!pdata->in_pack_by_idx)
>                       REALLOC_ARRAY(pdata->in_pack, pdata->nr_alloc);
> +             pack_delta_lock(pdata);
>               if (pdata->delta_size)
>                       REALLOC_ARRAY(pdata->delta_size, pdata->nr_alloc);
> +             pack_delta_unlock(pdata);
>       }

This made me wonder if in_pack_by_idx needs a similar lock. But
actually, I don't think either is necessary. We only allocate new
entries during the counting phase, not during the threaded delta search.

So this hunk could be dropped (and the system CPU benefit I saw is just
from reduced lock contention).

-Peff

Reply via email to