qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC 0/2] tls: add macros for coroutine-safe TLS variables


From: Thomas Huth
Subject: Re: [RFC 0/2] tls: add macros for coroutine-safe TLS variables
Date: Tue, 26 Oct 2021 19:26:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 26/10/2021 19.10, Richard Henderson wrote:
On 10/26/21 9:34 AM, Stefan Hajnoczi wrote:
On Tue, Oct 26, 2021 at 08:10:16AM -0700, Richard Henderson wrote:
On 10/26/21 6:22 AM, Stefan Hajnoczi wrote:
If "safe" TLS variables are opt-in then we'll likely have obscure bugs
when code changes to access a TLS variable that was previously never
accessed from a coroutine. There is no compiler error and no way to
detect this. When it happens debugging it is painful.

Co-routines are never used in user-only builds.

If developers have the choice of using __thread then bugs can slip
through.

Huh?  How.  No, really.

Are you concerned about performance, the awkwardness of calling
getters/setters, or something else for qemu-user?

Awkwardness first, performance second.

I'll also note that coroutines never run on vcpu threads, only io threads. So I'll resist any use of these interfaces in TCG as well.

Would it maybe make sense to tweak check_patch.pl to forbid __thread in certain folders only, e.g. block/ and util/ (i.e. where we know that there might be code that the iothreads are using)?

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]