Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15
STALE3755d

[PATCH] pack-objects: don't use too many threads with few objects

From: Nicolas Pitre <hidden>
Date: 2016-06-15 22:45:46
Subsystem: the rest · Maintainer: Linus Torvalds

If there are few objects to deltify, they might be split amongst threads 
so that there is simply no other objects left to delta against within 
the same thread.  Let's use the same 2*window treshold as used for the 
final load balancing to allow extra threads to be created.

This fixes the benign t5300 test failure.

Signed-off-by: Nicolas Pitre <redacted>
---

On Sat, 13 Dec 2008, Jeff King wrote:
On Thu, Dec 11, 2008 at 03:36:47PM -0500, Nicolas Pitre wrote:
quoted
... and display the actual number of threads used when locally 
repacking.  A remote server still won't tell you how many threads it 
uses during a fetch though.
Hrm. I have no idea how, but this patch reliably causes t5300 to fail on
my FreeBSD test box ("next" is broken, bisection pointed to 43cc2b42).
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 619e597..e851534 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1620,6 +1620,10 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,
 	for (i = 0; i < delta_search_threads; i++) {
 		unsigned sub_size = list_size / (delta_search_threads - i);
 
+		/* don't use too small segments or no deltas will be found */
+		if (sub_size < 2*window && i+1 < delta_search_threads)
+			sub_size = 0;
+
 		p[i].window = window;
 		p[i].depth = depth;
 		p[i].processed = processed;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help