login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
git
»
2010
»
March
»
24
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Nicolas Pitre
Subject:
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
Date: Wednesday, March 24, 2010 - 10:53 am
On Wed, 24 Mar 2010, Fredrik Kuivinen wrote:
quoted text
> On Wed, Mar 24, 2010 at 00:50, Nicolas Pitre <nico@fluxnic.net> wrote: > > On Tue, 23 Mar 2010, Fredrik Kuivinen wrote: > > > >> On Tue, Mar 23, 2010 at 19:43, Shawn O. Pearce <spearce@spearce.org> wrote: > >> > If that is what we are doing, disabling the release of pack windows > >> > when malloc fails, why can't we do that all of the time? > >> > >> The idea was that most git programs are single threaded, so they can > >> still benefit from releasing the pack windows when they are low on > >> memory. > > > > This is bobus. The Git program using the most memory is probably > > pack-objects and it is threaded. Most single-threaded programs don't > > use close to as much memory. > > Ok, you are right. But xmalloc/xrealloc cannot be used in multiple > threads simultaneously without some serialization. > > For example, I think there are some potential race conditions in the > pack-objects code. In the threaded code we have the following call > chains leading to xcalloc, xmalloc, and xrealloc: > > find_deltas -> xcalloc > find_deltas -> do_compress -> xmalloc > find_deltas -> try_delta -> xrealloc > find_deltas -> try_delta -> read_sha1_file -> ... -> xmalloc (called > with read_lock held, but it can still race with the other calls) > > As far as I can see there is no serialization between these calls.
True. We already have a problem. This is nasty. Nicolas
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Fredrik Kuivinen
, (Tue Mar 23, 10:31 am)
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Shawn O. Pearce
, (Tue Mar 23, 11:43 am)
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Fredrik Kuivinen
, (Tue Mar 23, 2:21 pm)
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Tue Mar 23, 4:50 pm)
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Fredrik Kuivinen
, (Wed Mar 24, 8:23 am)
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Wed Mar 24, 10:53 am)
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Shawn Pearce
, (Wed Mar 24, 11:22 am)
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Junio C Hamano
, (Wed Mar 24, 11:44 am)
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Wed Mar 24, 11:54 am)
Re: [PATCH 1/2] Make xmalloc and xrealloc thread-safe
, Shawn Pearce
, (Wed Mar 24, 12:57 pm)
[PATCH] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Wed Mar 24, 1:22 pm)
Re: [PATCH] Make xmalloc and xrealloc thread-safe
, Shawn O. Pearce
, (Wed Mar 24, 1:28 pm)
Re: [PATCH] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Wed Mar 24, 2:02 pm)
Re: [PATCH] Make xmalloc and xrealloc thread-safe
, Junio C Hamano
, (Wed Mar 24, 2:11 pm)
Re: [PATCH] Make xmalloc and xrealloc thread-safe
, Junio C Hamano
, (Wed Mar 24, 2:28 pm)
Re: [PATCH] Make xmalloc and xrealloc thread-safe
, Fredrik Kuivinen
, (Sat Mar 27, 6:26 am)
Re: [PATCH] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Sat Mar 27, 11:59 am)
Re: [PATCH] Make xmalloc and xrealloc thread-safe
, Fredrik Kuivinen
, (Tue Mar 30, 11:57 pm)
[PATCH v2] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Tue Apr 6, 7:57 pm)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Shawn O. Pearce
, (Tue Apr 6, 8:16 pm)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Tue Apr 6, 9:51 pm)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Junio C Hamano
, (Tue Apr 6, 10:21 pm)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Shawn Pearce
, (Wed Apr 7, 5:29 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Wed Apr 7, 6:17 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Shawn Pearce
, (Wed Apr 7, 7:30 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Fredrik Kuivinen
, (Wed Apr 7, 7:45 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Wed Apr 7, 7:47 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Wed Apr 7, 8:08 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Sverre Rabbelier
, (Wed Apr 7, 8:27 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Fredrik Kuivinen
, (Wed Apr 7, 9:13 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Fredrik Kuivinen
, (Wed Apr 7, 9:15 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Junio C Hamano
, (Wed Apr 7, 9:17 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Erik Faye-Lund
, (Wed Apr 7, 9:44 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Nicolas Pitre
, (Wed Apr 7, 11:37 am)
Re: [PATCH v2] Make xmalloc and xrealloc thread-safe
, Johannes Sixt
, (Wed Apr 7, 11:49 am)
[PATCH] Thread-safe xmalloc and xrealloc needs a recursive ...
, Johannes Sixt
, (Thu Apr 8, 12:15 am)
Re: [PATCH] Thread-safe xmalloc and xrealloc needs a recur ...
, Fredrik Kuivinen
, (Thu Apr 8, 1:42 am)
Navigation
Mailing list archives
Recent posts