Skip to contentSkip to conversation

getting rid of coroutine-gthread?

Qemu-devel Paolo Bonzini 5 participants 10 messages Jan 11, 2013 – Jan 15, 2013

lore
Share & tools
lore
#0 lore raw

Brad and Peter,

as far as I know OpenBSD and Linux/ARM were the main users of coroutine-gthread. Do you think we could dump it and rely on coroutine-sigaltstack only? The differences in signal handling of the gthread implementation always worried me.

What versions of OpenBSD would we have to drop support for? Is that acceptable to you?

Paolo

#1 lore raw

Am 11.01.2013 19:11, schrieb Paolo Bonzini:

Quoted 9 lines

Brad and Peter,

as far as I know OpenBSD and Linux/ARM were the main users of coroutine-gthread. Do you think we could dump it and rely on coroutine-sigaltstack only? The differences in signal handling of the gthread implementation always worried me.

What versions of OpenBSD would we have to drop support for? Is that acceptable to you?

No, I believe there is explicit code in configure to force the GThread implementation on Mac OS X.

Andreas

#2 lore raw
Quoted 8 lines · Andreas F?rber

Am 11.01.2013 19:11, schrieb Paolo Bonzini:

Quoted 7 lines

Brad and Peter,

as far as I know OpenBSD and Linux/ARM were the main users of coroutine-gthread. Do you think we could dump it and rely on coroutine-sigaltstack only? The differences in signal handling of the gthread implementation always worried me.

Quoted 5 lines
Quoted 2 lines

What versions of OpenBSD would we have to drop support for? Is that acceptable to you?

No, I believe there is explicit code in configure to force the GThread implementation on Mac OS X.

That is to skip over testing for the ucontext implementation. There was a build issue with the sigaltstack implementation but it was fixed relatively recently.

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#3 lore raw
Quoted 6 lines · Brad Smith
Quoted 5 lines · Andreas F?rber

Am 11.01.2013 19:11, schrieb Paolo Bonzini:

Quoted 3 lines

as far as I know OpenBSD and Linux/ARM were the main users of coroutine-gthread. Do you think we could dump it and rely on coroutine-sigaltstack only?

Quoted 6 lines
Quoted 2 lines

No, I believe there is explicit code in configure to force the GThread implementation on Mac OS X.

That is to skip over testing for the ucontext implementation. There was a build issue with the sigaltstack implementation but it was fixed relatively recently.

Yes. That configure skip code is actually broken because it skips the test for the ucontext implementation but doesn't actually set the coroutine_backend variable to anything, so we end up with (a) a confusing message to the user saying just "coroutine backend" rather than "coroutine backend foo" and (b) the gthreads backend more by luck than judgement. Easiest fix here is probably to replace the 'if darwin' check with an "#ifdef some-darwin-symbol #error" in the makecontext test program (and incidentally we could add a comment to the effect that at least some versions of MacOS provide makecontext but make getcontext always return ENOTSUP; I had to trawl the mailing list to find out why we did that :-))

Even if we don't drop gthreads, I think there's an argument to be made for having sigcontext be the next backend to try after ucontext.

-- PMM

#4 lore raw
Quoted 26 lines · Peter Maydell
Quoted 6 lines · Brad Smith
Quoted 5 lines · Andreas F?rber

Am 11.01.2013 19:11, schrieb Paolo Bonzini:

Quoted 3 lines

as far as I know OpenBSD and Linux/ARM were the main users of coroutine-gthread. Do you think we could dump it and rely on coroutine-sigaltstack only?

Quoted 6 lines
Quoted 2 lines

No, I believe there is explicit code in configure to force the GThread implementation on Mac OS X.

That is to skip over testing for the ucontext implementation. There was a build issue with the sigaltstack implementation but it was fixed relatively recently.

Yes. That configure skip code is actually broken because it skips the test for the ucontext implementation but doesn't actually set the coroutine_backend variable to anything, so we end up with (a) a confusing message to the user saying just "coroutine backend" rather than "coroutine backend foo" and (b) the gthreads backend more by luck than judgement. Easiest fix here is probably to replace the 'if darwin' check with an "#ifdef some-darwin-symbol #error" in the makecontext test program (and incidentally we could add a comment to the effect that at least some versions of MacOS provide makecontext but make getcontext always return ENOTSUP; I had to trawl the mailing list to find out why we did that :-))

Quoted 3 lines

Even if we don't drop gthreads, I think there's an argument to be made for having sigcontext be the next backend to try after ucontext.

The ucontext support in OS X has been marked as deprecated, that seems to have popped up with 10.6. No idea if it has been removed all together since then. It was made obsolete in POSIX.1-2001.

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#5 lore raw
In reply to Paolo Bonzini
Quoted 9 lines · Paolo Bonzini

Brad and Peter,

as far as I know OpenBSD and Linux/ARM were the main users of coroutine-gthread. Do you think we could dump it and rely on coroutine-sigaltstack only? The differences in signal handling of the gthread implementation always worried me.

What versions of OpenBSD would we have to drop support for? Is that acceptable to you?

I'm OK with this. For our ports tree I have QEMU using the sigaltstack backend with 1.2.2 at the moment with -current.

Our official policy is to use the ports/packages wherever possible for third-party software. For our current release (5.2) we provide QEMU 1.1.0. For -current we have 1.2.2 at the moment and I plan on updating to 1.3.1/1.4.0 depending on when and if 1.3.1 is released or if 1.4.0 is released sooner I'll just skip to 1.4.0. 1.3.1 with the back ported patch for using sem_timedwait() will require 5.2. 1.4.0 if dropping support for the gthread backend will require -current or the next release 5.3 which we will be going into freeze for within a month and a bit and the release will be May 1st. This is acceptable to me. I'd prefer that QEMU wherever possible do things properly and put the pressure on OpenBSD to do things properly as well and have bugs fixed. I had proded the developer working on the sigaltstack fix to get his work in and it has been commited.

http://marc.info/?l=openbsd-cvs&m=135443183201631&w=2

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#6 lore raw
In reply to Paolo Bonzini

Am 11.01.2013 19:11, schrieb Paolo Bonzini:

Quoted 9 lines

Brad and Peter,

as far as I know OpenBSD and Linux/ARM were the main users of coroutine-gthread. Do you think we could dump it and rely on coroutine-sigaltstack only? The differences in signal handling of the gthread implementation always worried me.

What versions of OpenBSD would we have to drop support for? Is that acceptable to you?

Changing the defaults for these platforms may be a good idea, but I actually like the option of having coroutine-gthread because it's much friendlier to debug - gdb supports threads, but not coroutines.

Is coroutine-gthread blocking anything or is it just that you're not entirely confident in its correctness?

Kevin

#7 lore raw

Il 15/01/2013 14:18, Kevin Wolf ha scritto:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Brad and Peter,

as far as I know OpenBSD and Linux/ARM were the main users of coroutine-gthread. Do you think we could dump it and rely on coroutine-sigaltstack only? The differences in signal handling of the gthread implementation always worried me.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

What versions of OpenBSD would we have to drop support for? Is that acceptable to you?

Changing the defaults for these platforms may be a good idea, but I actually like the option of having coroutine-gthread because it's much friendlier to debug - gdb supports threads, but not coroutines.

Is coroutine-gthread blocking anything or is it just that you're not entirely confident in its correctness?

I'm not entirely confident in its correctness, and I'd be afraid of breaking things when converting dataplane to AIOContext.

Paolo

#8 lore raw

Am 15.01.2013 14:28, schrieb Paolo Bonzini:

Quoted 14 lines

Il 15/01/2013 14:18, Kevin Wolf ha scritto:

Quoted 13 lines
Quoted 9 lines
Quoted 9 lines

Brad and Peter,

as far as I know OpenBSD and Linux/ARM were the main users of coroutine-gthread. Do you think we could dump it and rely on coroutine-sigaltstack only? The differences in signal handling of the gthread implementation always worried me.

What versions of OpenBSD would we have to drop support for? Is that acceptable to you?

Changing the defaults for these platforms may be a good idea, but I actually like the option of having coroutine-gthread because it's much friendlier to debug - gdb supports threads, but not coroutines.

Quoted 5 lines
Quoted 2 lines

Is coroutine-gthread blocking anything or is it just that you're not entirely confident in its correctness?

I'm not entirely confident in its correctness, and I'd be afraid of breaking things when converting dataplane to AIOContext.

Dataplane is (at least for now) not the most important thing to have when debugging a block driver. Would it help if we made dataplane and coroutine-gthread mutually exclusive?

Kevin

#9 lore raw

Il 15/01/2013 14:40, Kevin Wolf ha scritto:

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

I'm not entirely confident in its correctness, and I'd be afraid of breaking things when converting dataplane to AIOContext.

Dataplane is (at least for now) not the most important thing to have when debugging a block driver. Would it help if we made dataplane and coroutine-gthread mutually exclusive?

I thought the plan was to make dataplane the default. Anyway no problem, we'll see.

Paolo