[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] linux-user: call rcu_(un)register_thread on
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] linux-user: call rcu_(un)register_thread on thread creation/deletion |
Date: |
Wed, 26 Aug 2015 02:22:08 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 25/08/2015 02:41, Emilio G. Cota wrote:
> Note that the right place to call rcu_register_thread() is
> do_cpu_loop() and not just in clone_func(), since the
> original 'main' thread needs to call rcu_register_thread()
> as well.
>
> Signed-off-by: Emilio G. Cota <address@hidden>
It doesn't actually, see rcu_init in util/rcu.c. I'm still queueing the
original patch.
Paolo
> ---
> linux-user/qemu.h | 1 +
> linux-user/syscall.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/linux-user/qemu.h b/linux-user/qemu.h
> index 8af5e01..08e6609 100644
> --- a/linux-user/qemu.h
> +++ b/linux-user/qemu.h
> @@ -203,6 +203,7 @@ void fork_end(int child);
>
> static inline void do_cpu_loop(CPUArchState *env)
> {
> + rcu_register_thread();
> current_cpu = ENV_GET_CPU(env);
> cpu_loop(env);
> }
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 701c8fa..84909b4 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5614,6 +5614,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
> arg1,
> thread_cpu = NULL;
> object_unref(OBJECT(cpu));
> g_free(ts);
> + rcu_unregister_thread();
> pthread_exit(NULL);
> }
> #ifdef TARGET_GPROF
> --
[Qemu-devel] [RFC 04/38] translate-all: remove volatile from have_tb_lock, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 06/38] seqlock: add missing 'inline' to seqlock_read_retry, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 02/38] hw/i386/kvmvapic: add missing include of tcg.h, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 01/38] cpu-exec: add missing mmap_lock in tb_find_slow, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 10/38] translate-all: remove obsolete comment about l1_map, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 18/38] tcg: add fences, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 12/38] linux-user: call rcu_(un)register_thread on pthread_(exit|create), Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 05/38] thread-posix: inline qemu_spin functions, Emilio G. Cota, 2015/08/23