All of lore.kernel.org
 help / color / mirror / Atom feed
From: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
To: "Denis V. Lunev" <den-lists@virtuozzo.com>,
	qemu devel <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] rfifolock: no need to get thread identifier when nesting
Date: Tue, 10 May 2016 17:54:31 +0800	[thread overview]
Message-ID: <5731AFD7.4030504@cn.fujitsu.com> (raw)
In-Reply-To: <5731AC04.8010709@virtuozzo.com>

On 05/10/2016 05:38 PM, Denis V. Lunev wrote:
> On 05/10/2016 12:16 PM, Changlong Xie wrote:
>> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
>> ---
>>   util/rfifolock.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/util/rfifolock.c b/util/rfifolock.c
>> index c22f5fe..f406cc1 100644
>> --- a/util/rfifolock.c
>> +++ b/util/rfifolock.c
>> @@ -50,6 +50,7 @@ void rfifolock_lock(RFifoLock *r)
>>       if (r->nesting > 0 && qemu_thread_is_self(&r->owner_thread)) {
>>           r->tail--; /* put ticket back, we're nesting */
>> +        goto out;
>>       } else {
>>           while (ticket != r->head) {
>>               /* Invoke optional contention callback */
>> @@ -61,6 +62,7 @@ void rfifolock_lock(RFifoLock *r)
>>       }
>>       qemu_thread_get_self(&r->owner_thread);
>> +out:
>>       r->nesting++;
>>       qemu_mutex_unlock(&r->lock);
>>   }
> it would be better to put
>      qemu_thread_get_self(&r->owner_thread);
> 2 lines up and avoid unnecessary goto

Yes, it's a better choice, will send out v2

Thanks
	-Xie
>
>
>

      reply	other threads:[~2016-05-10  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10  9:16 [Qemu-devel] [PATCH] rfifolock: no need to get thread identifier when nesting Changlong Xie
2016-05-10  9:38 ` Denis V. Lunev
2016-05-10  9:54   ` Changlong Xie [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=5731AFD7.4030504@cn.fujitsu.com \
    --to=xiecl.fnst@cn.fujitsu.com \
    --cc=den-lists@virtuozzo.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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.