git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: 2.18.0 Regression: packing performance and effectiveness

From
Duy Nguyen <pclouds@gmail.com>
Date
Jul 20, 2018, 05:47 UTC
Message-ID
<CACsJy8Aw1JKpv_o13GmicR1BstJxF1ow358YcRax2EmnjuZuhA@mail.gmail.com>
In-Reply-To
<20180720052829.GA3852@sigill.intra.peff.net>
On Fri, Jul 20, 2018 at 7:28 AM Jeff King <peff@peff.net> wrote:
Show 28 quoted lines
>
> On Thu, Jul 19, 2018 at 04:11:01PM -0700, Elijah Newren wrote:
>
> > Looking at the output from Peff's instrumentation elsewhere in this
> > thread, I see a lot of lines like
> >    mismatched get: 32889efd307c7be376da9e3d45a78305f14ba73a = (, 28)
> > Does that mean it was reading the array when it wasn't ready?
>
> Yes, it looks like we saw a "get" without a "set". Though this could
> also be due to threading. The tracing isn't atomic with respect to the
> actual get/set operation, so it's possible that the ordering of the
> trace output does not match the ordering of the actual operations.
>
> > However, it's interesting to also look at the effect on packing
> > linux.git (on the same beefy hardware):
> >
> > Version  Pack (MB)  MaxRSS(kB)  Time (s)
> > -------  ---------  ----------  --------
> >  2.17.0     1279     11382932      632.24
> >  2.18.0     1279     10817568      621.97
> >  fiv-v4     1279     11484168     1193.67
> >
> > While the pack size is nice and small, the original memory savings
> > added in 2.18.0 are gone and the performance is much worse.  :-(
>
> Interesting. I can't reproduce here. The fix-v4 case is only slightly
> slower than 2.18.0. Can you double check that your compiler flags, etc,
> were the same? Many times I've accidentally compared -O0 to -O0. :)

He ran 40 threads though. That number of threads can make lock contention very expensive. Yeah my money is also on lock contention.

> You might also try the patch below (on top of fix-v4), which moves the

Another thing Elijah could try is watch CPU utilization. If this is lock contention, I think core utilization should be much lower because we spend more time waiting than actually doing things.

> locking to its own dedicated mutex. That should reduce lock contention,

I think we could use cache_lock() which is for non-odb shared data (and delta_size[] fits this category)

> and it fixes the remaining realloc where I think we're still racy. On my

Yeah it's not truly racy as you also noted in another mail. I'll make a note about this in the commit message.

> repack of linux.git, it dropped the runtime from 6m3s to 5m41s, almost
> entirely in system CPU.
-- 
Duy
Previous: Jeff KingNext: Elijah Newren
Message 19 of 44 in “2.18.0 Regression: packing performance and effectiveness”
  1. Elijah NewrenJul 18, 2018
  2. fix-v1: revert "pack-objects: shrink delta_size field in struct object_entry"Elijah Newren, Jul 18, 2018
  3. fix-v2: make OE_DELTA_SIZE_BITS a bit biggerElijah Newren, Jul 18, 2018
  4. Duy NguyenJul 19, 2018
  5. Jeff KingJul 19, 2018
  6. Elijah NewrenJul 19, 2018
  7. Duy NguyenJul 19, 2018
  8. Jeff KingJul 19, 2018
  9. Duy NguyenJul 19, 2018
  10. Duy NguyenJul 19, 2018
  11. Elijah NewrenJul 19, 2018
  12. Jeff KingJul 19, 2018
  13. Duy NguyenJul 19, 2018
  14. Duy NguyenJul 19, 2018
  15. Jeff KingJul 19, 2018
  16. Elijah NewrenJul 19, 2018
  17. Jeff KingJul 20, 2018
  18. Jeff KingJul 20, 2018
  19. Duy NguyenJul 20, 2018
  20. Elijah NewrenJul 20, 2018
  21. Jeff KingJul 19, 2018
  22. Junio C HamanoJul 19, 2018
  23. Junio C HamanoJul 19, 2018
  24. pack-objects: fix performance issues on packing large deltasNguyễn Thái Ngọc Duy, Jul 20, 2018
  25. Jeff KingJul 20, 2018
  26. Duy NguyenJul 21, 2018
  27. Jeff KingJul 23, 2018
  28. Elijah NewrenJul 20, 2018
  29. Elijah NewrenJul 20, 2018
  30. Duy NguyenJul 21, 2018
  31. Duy NguyenJul 21, 2018
  32. Duy NguyenJul 21, 2018
  33. Elijah NewrenJul 21, 2018
  34. Duy NguyenJul 21, 2018
  35. Elijah NewrenJul 22, 2018
  36. Duy NguyenJul 22, 2018
  37. Elijah NewrenJul 23, 2018
  38. Duy NguyenJul 23, 2018
  39. pack-objects: fix performance issues on packing large deltasNguyễn Thái Ngọc Duy, Jul 22, 2018
  40. Junio C HamanoJul 23, 2018
  41. Duy NguyenJul 23, 2018
  42. Duy NguyenJul 23, 2018
  43. Jeff KingJul 23, 2018
  44. Johannes SixtJul 26, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.