All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [PATCH] posix-aio-compat: fix latency issues
Date: Sat, 13 Aug 2011 20:43:28 -0700	[thread overview]
Message-ID: <4E474460.2060803@redhat.com> (raw)
In-Reply-To: <4E452994.9080805@codemonkey.ws>

On 08/12/2011 06:24 AM, Anthony Liguori wrote:
> On 08/08/2011 06:37 AM, Avi Kivity wrote:
>>
>> +static void spawn_thread_bh_fn(void *opaque)
>> +{
>> +    mutex_lock(&lock);
>> +    do_spawn_thread();
>> +    mutex_unlock(&lock);
>> +}
>
> The locking here is odd.  Why not call do_spawn_thread() without the 
> lock, and acquire the lock for the section that needs to hold it?

Just the way the code evolved.  Note that aio_thread() does need to take 
the lock.  However, it is indeed cleaner to take the lock when needed 
rather than drop it when not.

>
> Otherwise, the logic seems correct to me.
>
> Kevin, could you also take a look at this patch?

Yes please.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] posix-aio-compat: fix latency issues
Date: Sat, 13 Aug 2011 20:43:28 -0700	[thread overview]
Message-ID: <4E474460.2060803@redhat.com> (raw)
In-Reply-To: <4E452994.9080805@codemonkey.ws>

On 08/12/2011 06:24 AM, Anthony Liguori wrote:
> On 08/08/2011 06:37 AM, Avi Kivity wrote:
>>
>> +static void spawn_thread_bh_fn(void *opaque)
>> +{
>> +    mutex_lock(&lock);
>> +    do_spawn_thread();
>> +    mutex_unlock(&lock);
>> +}
>
> The locking here is odd.  Why not call do_spawn_thread() without the 
> lock, and acquire the lock for the section that needs to hold it?

Just the way the code evolved.  Note that aio_thread() does need to take 
the lock.  However, it is indeed cleaner to take the lock when needed 
rather than drop it when not.

>
> Otherwise, the logic seems correct to me.
>
> Kevin, could you also take a look at this patch?

Yes please.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

  reply	other threads:[~2011-08-14  3:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08 11:37 [PATCH] posix-aio-compat: fix latency issues Avi Kivity
2011-08-08 11:37 ` [Qemu-devel] " Avi Kivity
2011-08-08 12:34 ` Anthony Liguori
2011-08-08 12:34   ` [Qemu-devel] " Anthony Liguori
2011-08-08 12:42   ` Avi Kivity
2011-08-08 12:49 ` Frediano Ziglio
2011-08-08 12:54   ` Avi Kivity
2011-08-08 12:54     ` [Qemu-devel] " Avi Kivity
2011-08-08 13:21     ` Frediano Ziglio
2011-08-08 13:26       ` Avi Kivity
2011-08-12 13:24 ` Anthony Liguori
2011-08-12 13:24   ` Anthony Liguori
2011-08-14  3:43   ` Avi Kivity [this message]
2011-08-14  3:43     ` Avi Kivity

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=4E474460.2060803@redhat.com \
    --to=avi@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.