git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	David Michael Barr <david.barr@cordelta.com>,
	Sverre Rabbelier <srabbelier@gmail.com>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/6] Add memory pool library
Date: Mon, 7 Jun 2010 15:28:13 +0200	[thread overview]
Message-ID: <AANLkTimzuJXjX4OJUkmQtLwjGDgHBaZUHSGA0xUUi6kY@mail.gmail.com> (raw)
In-Reply-To: <20100604182928.GB20909@progeny.tock>

Hi Jonathan,

Jonathan Nieder wrote:
>  The memory pool library is distinguished from the existing specialized
>  allocators in alloc.c by using a contiguous block for all allocations.
>  This means that on one hand, long-lived pointers have to be written as
>  offsets, since the base address changes as the pool grows, but on the
>  other hand, the entire pool can be easily written to the file system.
>  This allows the memory pool to persist between runs of an application.
>
>  For svn-fe, such a facility is useful because each svn revision can
>  copy trees and files from any previous revision.  Therefore the
>  relevant information for all revisions has to persist somehow to
>  support incremental runs.
>
>  The current implementation is backed by the file system using mmap().
>
> Thanks for the explanations, David.

Thanks. Added to commit message: should be fine the next time I post the series.

> Whitespace damaged.

Fixed in b180ad7 (pushed few seconds ago).

> Probably an ignorant question, but why?  I do not think the win32 mmap
> emulation in git currently supports sysconf().

I'm not sure why the pool capacity should be dependent on the page size.

>        ..._pool.file = open(..., O_RDWR);

Fixed in b180ad7 (pushed few seconds ago).

> This is the first use of MAP_SHARED in git.  I wouldn’t be surprised if
> the win32 mmap emulation does not support it.

You're right; I just checked. compat/mmap.c:7 clearly specifies that
only MAP_PRIVATE is supported.
	if (start != NULL || !(flags & MAP_PRIVATE))
		die("Invalid usage of mmap when built with NO_MMAP");

What can we do about this? Should we attempt to implement MAP_SHARED?

> Necessary?  (Maybe yes: we are about to truncate the file, so the
> fsync() may be intended to force the data to be committed before
> the metadata.)  Portable?  (I suspect the fsync() should go after
> the munmap().)

You want to flush changes *after* unmapping the pages of memory from
the file? I can't find any notes on portability relating to this- can
you clarify?

> Because of these portability concerns, I’d rather use the old version
> until the incremental parser is ready.

Rolling back that many changes can be more painful than actually
fixing these few concerns (especially large number of change after
`dirents` was merged in). It means more delay in getting the exporter
merged.

-- Ram

  reply	other threads:[~2010-06-07 13:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04 13:41 [PATCH 0/6] Merge David's SVN exporter Ramkumar Ramachandra
2010-06-04 13:41 ` [PATCH 1/6] Add memory pool library Ramkumar Ramachandra
2010-06-04 18:29   ` Jonathan Nieder
2010-06-07 13:28     ` Ramkumar Ramachandra [this message]
2010-06-07 14:00       ` Erik Faye-Lund
2010-06-07 14:35         ` Ramkumar Ramachandra
2010-06-04 13:41 ` [PATCH 2/6] Add cpp macro implementation of treaps Ramkumar Ramachandra
2010-06-04 13:41 ` [PATCH 3/6] Add library for string-specific memory pool Ramkumar Ramachandra
2010-06-04 13:41 ` [PATCH 4/6] Add stream helper library Ramkumar Ramachandra
2010-06-04 18:35   ` Jonathan Nieder
2010-06-04 13:41 ` [PATCH 5/6] Add infrastructure to write revisions in fast-export format Ramkumar Ramachandra
2010-06-04 19:02   ` Jonathan Nieder
2010-06-07 12:35     ` Ramkumar Ramachandra
2010-06-07 13:36       ` David Michael Barr
2010-06-04 13:41 ` [PATCH 6/6] Add SVN dump parser Ramkumar Ramachandra
  -- strict thread matches above, loose matches on Subject: below --
2010-06-10 13:09 [PATCH 0/6] Another attempt to get the SVN exporter merged Ramkumar Ramachandra
2010-06-10 13:09 ` [PATCH 1/6] Add memory pool library Ramkumar Ramachandra
2010-06-12  6:42   ` Jonathan Nieder
2010-06-14 14:25     ` Ramkumar Ramachandra
2010-06-14 14:44       ` Andreas Ericsson
2010-06-04 13:26 [PATCH 0/6] Merge David's SVN exporter into git.git Ramkumar Ramachandra
2010-06-04 13:26 ` [PATCH 1/6] Add memory pool library Ramkumar Ramachandra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimzuJXjX4OJUkmQtLwjGDgHBaZUHSGA0xUUi6kY@mail.gmail.com \
    --to=artagnon@gmail.com \
    --cc=david.barr@cordelta.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=srabbelier@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).