From: Stefan Hajnoczi <stefanha@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Cornelia Huck <cohuck@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] qemu-nbd vs 'simple' trace backend vs iotest 147
Date: Fri, 13 Jul 2018 14:53:46 +0100 [thread overview]
Message-ID: <20180713135346.GD13835@stefanha-x1.localdomain> (raw)
In-Reply-To: <eb3dd1ec-a420-1ede-d42a-4a01c8e9892f@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]
On Fri, Jul 13, 2018 at 08:40:19AM +0200, Paolo Bonzini wrote:
> On 12/07/2018 18:30, Stefan Hajnoczi wrote:
> > On Wed, Jul 11, 2018 at 03:33:21PM +0200, Cornelia Huck wrote:
> >> The other qemu-nbds (the inet and the unix socket ones from the first
> >> run, the second inet one from the second run) have a single thread with
> >> the same backtrace I posted above.
> >
> > We just discussed this on IRC, but for the record:
> >
> > qemu-nbd --fork will fork the process after the simpletrace write-out
> > thread has been spawned. The child process lacks this thread (due to
> > how fork(2) handles multithreading). Either qemu-nbd needs to
> > initialize tracing later (but that means we cannot trace early init) or
> > simpletrace needs a way to respawn the write-out thread.
>
> You can use pthread_atfork for this.
Thanks. The man page says:
The intent of pthread_atfork() was to provide a mechanism
whereby the application (or a library) could ensure that mutexes and
other process and thread state would be restored to a consistent
state. In practice, this task is generally too difficult to be
practicable.
Challenge accepted!
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
prev parent reply other threads:[~2018-07-13 13:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 13:45 [Qemu-devel] qemu-nbd vs 'simple' trace backend vs iotest 147 Cornelia Huck
2018-07-11 13:06 ` Stefan Hajnoczi
2018-07-11 13:15 ` Cornelia Huck
2018-07-11 13:33 ` Cornelia Huck
2018-07-12 16:30 ` Stefan Hajnoczi
2018-07-13 6:40 ` Paolo Bonzini
2018-07-13 13:53 ` Stefan Hajnoczi [this message]
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=20180713135346.GD13835@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=cohuck@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@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).