login
Header Space

 
 

Re: Something is broken in repack

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nicolas Pitre <nico@...>
Cc: Jon Smirl <jonsmirl@...>, Junio C Hamano <gitster@...>, <gcc@...>, Git Mailing List <git@...>
Date: Wednesday, December 12, 2007 - 12:37 pm

On Wed, 12 Dec 2007, Nicolas Pitre wrote:

Yes.

Note that delta following involves patterns something like

   allocate (small) space for delta
   for i in (1..depth) {
	allocate large space for base
	allocate large space for result
	.. apply delta ..
	free large space for base
	free small space for delta
   }

so if you have some stupid heap algorithm that doesn't try to merge and 
re-use free'd spaces very aggressively (because that takes CPU time!), you 
might have memory usage be horribly inflated by the heap having all those 
holes for all the objects that got free'd in the chain that don't get 
aggressively re-used.

Threaded memory allocators then make this worse by probably using totally 
different heaps for different threads (in order to avoid locking), so they 
will *all* have the fragmentation issue.

And if you *really* want to cause trouble for a memory allocator, what you 
should try to do is to allocate the memory in one thread, and free it in 
another, and then things can really explode (the freeing thread notices 
that the allocation is not in its thread-local heap, so instead of really 
freeing it, it puts it on a separate list of areas to be freed later by 
the original thread when it needs memory - or worse, it adds it to the 
local thread list, and makes it effectively totally impossible to then 
ever merge different free'd allocations ever again because the freed 
things will be on different heap lists!).

I'm not saying that particular case happens in git, I'm just saying that 
it's not unheard of. And with the delta cache and the object lookup, it's 
not at _all_ impossible that we hit the "allocate in one thread, free in 
another" case!

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Something is broken in repack, Jon Smirl, (Fri Dec 7, 7:05 pm)
Re: Something is broken in repack, Nicolas Pitre, (Mon Dec 10, 3:56 pm)
Re: Something is broken in repack, Jon Smirl, (Mon Dec 10, 4:05 pm)
Re: Something is broken in repack, Morten Welinder, (Mon Dec 10, 4:16 pm)
Re: Something is broken in repack, Nicolas Pitre, (Fri Dec 7, 9:46 pm)
Re: Something is broken in repack, Jon Smirl, (Fri Dec 7, 10:22 pm)
Re: Something is broken in repack, Jon Smirl, (Fri Dec 7, 10:04 pm)
Re: Something is broken in repack, Nicolas Pitre, (Fri Dec 7, 10:28 pm)
Re: Something is broken in repack, Jon Smirl, (Fri Dec 7, 11:29 pm)
Re: Something is broken in repack, David Brown, (Fri Dec 7, 11:37 pm)
Re: Something is broken in repack, Jon Smirl, (Sat Dec 8, 12:22 am)
Re: Something is broken in repack, Nicolas Pitre, (Sat Dec 8, 12:30 am)
Re: Something is broken in repack, Jon Smirl, (Sat Dec 8, 1:01 am)
Re: Something is broken in repack, Nicolas Pitre, (Sat Dec 8, 1:12 am)
Re: Something is broken in repack, Harvey Harrison, (Fri Dec 7, 11:48 pm)
Re: Something is broken in repack, Junio C Hamano, (Sat Dec 8, 6:18 pm)
Re: Something is broken in repack, Nicolas Pitre, (Sun Dec 9, 10:49 pm)
Re: Something is broken in repack, Junio C Hamano, (Sun Dec 9, 4:05 am)
Re: Something is broken in repack, Jon Smirl, (Sun Dec 9, 2:25 pm)
Re: Something is broken in repack, Nicolas Pitre, (Sun Dec 9, 9:07 pm)
Re: Something is broken in repack, Jon Smirl, (Sun Dec 9, 11:19 am)
Re: Something is broken in repack, Harvey Harrison, (Fri Dec 7, 11:44 pm)
Re: Something is broken in repack, Linus Torvalds, (Fri Dec 7, 8:37 pm)
[PATCH] pack-objects: fix delta cache size accounting, Nicolas Pitre, (Fri Dec 7, 9:27 pm)
Re: Something is broken in repack, Jon Smirl, (Mon Dec 10, 10:25 pm)
Re: Something is broken in repack, Nicolas Pitre, (Mon Dec 10, 11:49 pm)
Re: Something is broken in repack, Jon Smirl, (Tue Dec 11, 1:25 am)
Re: Something is broken in repack, Sean, (Tue Dec 11, 2:01 am)
Re: Something is broken in repack, Jon Smirl, (Tue Dec 11, 2:20 am)
Re: Something is broken in repack, Jon Smirl, (Tue Dec 11, 1:29 am)
Re: Something is broken in repack, Nicolas Pitre, (Tue Dec 11, 9:31 am)
Re: Something is broken in repack, Jon Smirl, (Tue Dec 11, 3:01 am)
Re: Something is broken in repack, Nicolas Pitre, (Tue Dec 11, 9:49 am)
Re: Something is broken in repack, Nicolas Pitre, (Tue Dec 11, 11:00 am)
Re: Something is broken in repack, Nicolas Pitre, (Tue Dec 11, 12:20 pm)
Re: Something is broken in repack, Jon Smirl, (Tue Dec 11, 12:21 pm)
Re: Something is broken in repack, Nicolas Pitre, (Wed Dec 12, 1:12 am)
Re: Something is broken in repack, Nicolas Pitre, (Wed Dec 12, 12:13 pm)
Re: Something is broken in repack, Andreas Ericsson, (Thu Dec 13, 3:32 am)
Re: Something is broken in repack, Wolfram Gloger, (Fri Dec 14, 12:03 pm)
Re: Something is broken in repack, Nicolas Pitre, (Wed Dec 12, 11:48 am)
Re: Something is broken in repack, Nguyen Thai Ngoc Duy, (Thu Dec 13, 9:32 am)
Re: Something is broken in repack, Paolo Bonzini, (Thu Dec 13, 11:32 am)
Re: Something is broken in repack, Johannes Sixt, (Thu Dec 13, 12:39 pm)
Re: Something is broken in repack, Paolo Bonzini, (Thu Dec 13, 12:29 pm)
Re: Something is broken in repack, Linus Torvalds, (Wed Dec 12, 12:37 pm)
Re: Something is broken in repack, Wolfram Gloger, (Fri Dec 14, 12:12 pm)
Re: Something is broken in repack, David Kastrup, (Fri Dec 14, 12:45 pm)
Re: Something is broken in repack, Wolfram Gloger, (Fri Dec 14, 12:59 pm)
Re: Something is broken in repack, Jon Smirl, (Wed Dec 12, 1:12 pm)
Re: Something is broken in repack, David Miller, (Wed Dec 12, 12:42 pm)
Re: Something is broken in repack, Linus Torvalds, (Wed Dec 12, 12:54 pm)
Re: Something is broken in repack, David Kastrup, (Wed Dec 12, 4:05 am)
Re: Something is broken in repack, Wolfram Gloger, (Fri Dec 14, 12:18 pm)
Re: Something is broken in repack, Jon Smirl, (Tue Dec 11, 11:36 am)
Re: Something is broken in repack, Linus Torvalds, (Tue Dec 11, 12:33 pm)
Re: Something is broken in repack, Nicolas Pitre, (Tue Dec 11, 1:21 pm)
Re: Something is broken in repack, David Miller, (Tue Dec 11, 1:24 pm)
Re: Something is broken in repack, Nicolas Pitre, (Tue Dec 11, 1:44 pm)
Re: Something is broken in repack, Andreas Ericsson, (Tue Dec 11, 4:26 pm)
Re: Something is broken in repack, Daniel Berlin, (Tue Dec 11, 1:28 pm)
Re: Something is broken in repack, Andreas Ericsson, (Tue Dec 11, 3:34 am)
Re: Something is broken in repack, Junio C Hamano, (Mon Dec 10, 10:55 pm)
Re: Something is broken in repack, Nicolas Pitre, (Mon Dec 10, 11:27 pm)
Re: Something is broken in repack, David Kastrup, (Tue Dec 11, 7:08 am)
Re: Something is broken in repack, Pierre Habouzit, (Tue Dec 11, 8:08 am)
Re: Something is broken in repack, David Kastrup, (Tue Dec 11, 8:18 am)
Re: Something is broken in repack, David Brown, (Fri Dec 7, 10:56 pm)
speck-geostationary