qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Jie Wang <wangjie88@huawei.com>
Cc: famz@redhat.com, stefanha@redhat.com, eblake@redhat.com,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	eric.fangyi@huawei.com, wu.wubin@huawei.com
Subject: Re: [Qemu-devel] [PATCH v6 2/2] iothread: let aio_epoll_disable fit to aio_context_destroy
Date: Thu, 17 May 2018 14:22:58 +0800	[thread overview]
Message-ID: <20180517062258.GP9089@xz-mi> (raw)
In-Reply-To: <1526523977-73930-1-git-send-email-wangjie88@huawei.com>

On Thu, May 17, 2018 at 10:26:17AM +0800, Jie Wang wrote:
> epoll_available will only be set if epollfd != -1, os we
> can swap the two variables in aio_epoll_disable, and
> aio_context_destroy can call aio_epoll_disable directly.
> 
> Signed-off-by: Jie Wang <wangjie88@huawei.com>
> ---
>  util/aio-posix.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/util/aio-posix.c b/util/aio-posix.c
> index 0ade2c7..118bf57 100644
> --- a/util/aio-posix.c
> +++ b/util/aio-posix.c
> @@ -45,11 +45,11 @@ struct AioHandler
>  
>  static void aio_epoll_disable(AioContext *ctx)
>  {
> -    ctx->epoll_available = false;
> -    if (!ctx->epoll_enabled) {
> +    ctx->epoll_enabled = false;
> +    if (!ctx->epoll_available) {
>          return;
>      }
> -    ctx->epoll_enabled = false;
> +    ctx->epoll_available = false;
>      close(ctx->epollfd);
>  }
>  
> @@ -716,9 +716,7 @@ void aio_context_setup(AioContext *ctx)
>  void aio_context_destroy(AioContext *ctx)
>  {
>  #ifdef CONFIG_EPOLL_CREATE1
> -    if (ctx->epollfd >= 0) {
> -        close(ctx->epollfd);
> -    }
> +    aio_epoll_disable(ctx);

Hmm... I think this patch should be the first if to split.

Anyway, IMHO version 5 is already good enough and has got r-bs, no
need to bother reposting a version 7.  Maintainer could possibly touch
up the commit message if necessary.

Thanks,

>  #endif
>  }
>  
> -- 
> 1.8.3.1
> 

-- 
Peter Xu

  parent reply	other threads:[~2018-05-17  6:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17  2:26 [Qemu-devel] [PATCH v6 2/2] iothread: let aio_epoll_disable fit to aio_context_destroy Jie Wang
2018-05-17  5:56 ` Fam Zheng
2018-05-17  6:22 ` Peter Xu [this message]
2018-05-17  6:48   ` WangJie (Pluto)
2018-05-18  8:24     ` [Qemu-devel] Ping? " WangJie (Pluto)
2018-05-18  9:12       ` Fam Zheng

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=20180517062258.GP9089@xz-mi \
    --to=peterx@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eric.fangyi@huawei.com \
    --cc=famz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wangjie88@huawei.com \
    --cc=wu.wubin@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).