All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Peter Teoh <htmldeveloper@gmail.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: pthread_mutex_lock() and Xenstored
Date: Thu, 13 Sep 2007 16:21:40 +0100	[thread overview]
Message-ID: <20070913152140.GF23525@redhat.com> (raw)
In-Reply-To: <05c801c7eb94$850ae780$9a010a0a@eeyore>

On Fri, Aug 31, 2007 at 01:51:18PM +0800, Peter Teoh wrote:
> pthread_mutex_lock() are not async-signal safe (ref:
> http://www.gelato.org/pdf/Illinois/gelato_IL2004_libatomic_boehm.pdf)
> but I still see that it is used extensively in xenstored implementation
> (eg, xs.c).

So what ?  The pthread_mutex_lock calls aren't used inside any signal
handlers, so the question of whether its async-signal safe is irrelevant

> Moreover, pthread_mutex_lock() suffered a higher performance penalty 
> than other synchronization option.   For a one-time effort like domain
> creation this is ok, but Xenstore is used repeatedly to access data, 
> and therefore performance could potentially be enhanced.

That presentation giving figures comparing pthread_mutex_lock with other
primitives is useless. It doesn't say what OS / version it was tested on,
or what those figures are measuring. Linux NPTL (2.6.x) threading has radically
different (better) pthread_mutex performance characteristics that the older
LinuxThreads impl (2.4.x) for example, and that's ignoring any other non-Linux
OS' impl of pthreads. The performance characteristics of a contended mutex lock,
vs an uncontended lock are also completely different & not considered in those
figures. 

Finally there's no performance profile data to suggest that mutex locking
is even remotely relevant to xenstore performance. There is however data to
show that the huge amount of I/O xenstored does hurts performance.

By all means consider how to improve the performance of xenstored, but do
so based on *measured* facts about where the current problems are, rather
than bullet points in a presentation unrelated to Xen.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

  parent reply	other threads:[~2007-09-13 15:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-31  5:51 pthread_mutex_lock() and Xenstored Peter Teoh
2007-09-13 15:03 ` Vincent Hanquez
2007-09-13 15:21 ` Daniel P. Berrange [this message]
2007-09-15  6:01   ` Peter Teoh
2007-09-15  9:48     ` Bastian Blank
2007-09-15 16:51       ` Peter Teoh
2007-09-15 13:50     ` Daniel P. Berrange
2007-09-15 17:57       ` John Levon

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=20070913152140.GF23525@redhat.com \
    --to=berrange@redhat.com \
    --cc=htmldeveloper@gmail.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.