login
Header Space

 
 

Re: Something is broken in repack

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <nico@...>, <jonsmirl@...>, <gitster@...>, <gcc@...>, <git@...>
Date: Wednesday, December 12, 2007 - 12:54 pm

On Wed, 12 Dec 2007, David Miller wrote:

Well, we actually already *do* have a customized allocator, but currently 
only for the actual core "object descriptor" that really just has the SHA1 
and object flags in it (and a few extra words depending on object type).

Those are critical for certain loads, and small too (so using the standard 
allocator wasted a _lot_ of memory). In addition, they're fixed-size and 
never free'd, so a specialized allocator really can do a lot better than 
any general-purpose memory allocator ever could.

But the actual object *contents* are currently all allocated with whatever 
the standard libc malloc/free allocator is that you compile for (or load 
dynamically). Havign a specialized allocator for them is a much more 
involved issue, exactly because we do have interesting allocation patterns 
etc.

That said, at least those object allocations are all single-threaded (for 
right now, at least), so even when git does multi-threaded stuff, the core 
sha1_file.c stuff is always run under a single lock, and a simpler 
allocator that doesn't care about threads is likely to be much better than 
one that tries to have thread-local heaps etc.

I suspect that is what the google allocator does. It probably doesn't have 
per-thread heaps, it just uses locking (and quite possibly things like 
per-*size* heaps, which is much more memory-efficient and helps avoid some 
of the fragmentation problems). 

Locking is much slower than per-thread accesses, but it doesn't have the 
issues with per-thread-fragmentation and all the problems with one thread 
allocating and another one freeing.

			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