From: "Denis V. Lunev" <den-lists@virtuozzo.com>
To: Changlong Xie <xiecl.fnst@cn.fujitsu.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 12:38:12 +0300 [thread overview]
Message-ID: <5731AC04.8010709@virtuozzo.com> (raw)
In-Reply-To: <1462871793-31561-1-git-send-email-xiecl.fnst@cn.fujitsu.com>
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
next prev parent reply other threads:[~2016-05-10 9:39 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 [this message]
2016-05-10 9:54 ` Changlong Xie
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=5731AC04.8010709@virtuozzo.com \
--to=den-lists@virtuozzo.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=xiecl.fnst@cn.fujitsu.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.