Received: from eggs.gnu.org ([2001:4830:134:3::10]:43319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpFs7-0004kO-Ux for qemu-devel@nongnu.org; Mon, 13 Aug 2018 12:39:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpFs3-00011q-6E for qemu-devel@nongnu.org; Mon, 13 Aug 2018 12:39:11 -0400 From: "Emilio G. Cota" Date: Mon, 13 Aug 2018 12:38:56 -0400 Message-Id: <20180813163859.17964-1-cota@braap.org> Subject: [Qemu-devel] [PATCH 0/3] convert CPU list to RCU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Peter Crosthwaite , Richard Henderson , David Gibson , Alexander Graf , Riku Voipio , Laurent Vivier , qemu-ppc@nongnu.org We iterate over the CPU list quite frequently (e.g. with CPU_FOREACH), but we rarely acquire the cpu_list_lock to do so. This is incorrect, since the CPU list can be updated (new CPUs added to it) pretty much anytime, particularly in user-mode. Instead of grabbing cpu_list_lock everywhere, convert the list to RCU to that iterations can be safe and wait-free. Thanks, Emilio