From: Stefan Hajnoczi <stefanha@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
famz@redhat.com, qemu-devel@nongnu.org, wu.wubin@huawei.com,
pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter()
Date: Thu, 19 Feb 2015 14:33:12 +0000 [thread overview]
Message-ID: <20150219143312.GA3032@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <20150218142026.GE4996@noname.str.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1777 bytes --]
On Wed, Feb 18, 2015 at 03:20:26PM +0100, Kevin Wolf wrote:
> Am 18.02.2015 um 14:50 hat Stefan Hajnoczi geschrieben:
> > On Tue, Feb 10, 2015 at 11:41:27AM +0100, Kevin Wolf wrote:
> > > qemu_coroutine_enter() is now the only user of coroutine_swap(). Both
> > > functions are short, so inline it.
> > >
> > > Also, using COROUTINE_YIELD is now even more confusing because this code
> > > is never called during qemu_coroutine_yield() any more. In fact, this
> > > value is never read back, so we can just introduce a new COROUTINE_ENTER
> > > which documents the purpose of the task switch better.
> > >
> > > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > > ---
> > > include/block/coroutine_int.h | 1 +
> > > qemu-coroutine.c | 36 +++++++++++++++---------------------
> > > 2 files changed, 16 insertions(+), 21 deletions(-)
> > >
> > > diff --git a/include/block/coroutine_int.h b/include/block/coroutine_int.h
> > > index f133d65..69b83db 100644
> > > --- a/include/block/coroutine_int.h
> > > +++ b/include/block/coroutine_int.h
> > > @@ -29,6 +29,7 @@
> > > #include "block/coroutine.h"
> > >
> > > typedef enum {
> > > + COROUTINE_ENTER = 0,
> >
> > This makes the ucontext code harder to understand because
> > CoroutineAction values are used with setjmp()/longjmp() in
> > qemu_coroutine_switch().
> >
> > The longjmp() man page says:
> >
> > If longjmp() is invoked with a second argument of 0, 1 will be
> > returned instead.
> >
> > I haven't checked whether or not this causes problems, but the code
> > would be simpler if we avoided using 0.
>
> It doesn't, the value is unused where we pass COROUTINE_ENTER. But I can
> make it 3 instead.
Thanks, that would be good.
Stefan
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-02-19 14:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 10:41 [Qemu-devel] [PATCH 0/3] coroutine: Fix qemu_coroutine_yield() Kevin Wolf
2015-02-10 10:41 ` [Qemu-devel] [PATCH 1/3] coroutine: Fix use after free with qemu_coroutine_yield() Kevin Wolf
2015-02-20 15:05 ` Kevin Wolf
2015-02-10 10:41 ` [Qemu-devel] [PATCH 2/3] coroutine: Clean up qemu_coroutine_enter() Kevin Wolf
2015-02-10 10:55 ` Paolo Bonzini
2015-02-10 11:09 ` Kevin Wolf
2015-02-10 11:15 ` Paolo Bonzini
2015-02-18 13:50 ` Stefan Hajnoczi
2015-02-18 14:20 ` Kevin Wolf
2015-02-19 14:33 ` Stefan Hajnoczi [this message]
2015-02-10 10:41 ` [Qemu-devel] [PATCH 3/3] test-coroutine: Regression test for yield bug Kevin Wolf
2015-02-16 10:19 ` [Qemu-devel] [PATCH 0/3] coroutine: Fix qemu_coroutine_yield() Kevin Wolf
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=20150219143312.GA3032@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).