qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Gan Qixin <ganqixin@huawei.com>
Cc: zhang.zhanghailiang@huawei.com, qemu-trivial@nongnu.org,
	qemu-devel@nongnu.org, mreitz@redhat.com, dnbrdsky@gmail.com,
	stefanha@redhat.com, kuhn.chenqun@huawei.com,
	pbonzini@redhat.com
Subject: Re: [PATCH 3/4] block/throttle-groups.c: Use lock guard macros
Date: Wed, 2 Dec 2020 12:12:26 +0100	[thread overview]
Message-ID: <20201202111226.GD16765@merkur.fritz.box> (raw)
In-Reply-To: <20201109154327.325675-4-ganqixin@huawei.com>

Am 09.11.2020 um 16:43 hat Gan Qixin geschrieben:
> Replace manual lock()/unlock() calls with lock guard macros
> (QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/throttle-groups.c.
> 
> Signed-off-by: Gan Qixin <ganqixin@huawei.com>

> @@ -638,14 +636,14 @@ void throttle_group_detach_aio_context(ThrottleGroupMember *tgm)
>      assert(qemu_co_queue_empty(&tgm->throttled_reqs[1]));
>  
>      /* Kick off next ThrottleGroupMember, if necessary */
> -    qemu_mutex_lock(&tg->lock);
> -    for (i = 0; i < 2; i++) {
> -        if (timer_pending(tt->timers[i])) {
> -            tg->any_timer_armed[i] = false;
> -            schedule_next_request(tgm, i);
> +     WITH_QEMU_LOCK_GUARD(&tg->lock) {

Indentation is off.

> +        for (i = 0; i < 2; i++) {
> +            if (timer_pending(tt->timers[i])) {
> +                tg->any_timer_armed[i] = false;
> +                schedule_next_request(tgm, i);
> +            }
>          }
>      }
> -    qemu_mutex_unlock(&tg->lock);
>  
>      throttle_timers_detach_aio_context(tt);
>      tgm->aio_context = NULL;

Kevin



  reply	other threads:[~2020-12-02 11:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 15:43 [PATCH 0/4] Use lock guard macros in block Gan Qixin
2020-11-09 15:43 ` [PATCH 1/4] block/accounting.c: Use lock guard macros Gan Qixin
2020-11-09 15:43 ` [PATCH 2/4] block/curl.c: " Gan Qixin
2020-11-09 15:43 ` [PATCH 3/4] block/throttle-groups.c: " Gan Qixin
2020-12-02 11:12   ` Kevin Wolf [this message]
2020-11-09 15:43 ` [PATCH 4/4] block/iscsi.c: " Gan Qixin
2020-12-02 11:11   ` Kevin Wolf
2020-12-03  7:04     ` ganqixin
2020-12-02  9:22 ` [PATCH 0/4] Use lock guard macros in block Markus Armbruster
2020-12-02  9:33   ` Paolo Bonzini

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=20201202111226.GD16765@merkur.fritz.box \
    --to=kwolf@redhat.com \
    --cc=dnbrdsky@gmail.com \
    --cc=ganqixin@huawei.com \
    --cc=kuhn.chenqun@huawei.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=zhang.zhanghailiang@huawei.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).