Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE82BC6FA8B for ; Mon, 5 Sep 2022 07:00:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.398489.639331 (Exim 4.92) (envelope-from ) id 1oV65c-0004yT-9b; Mon, 05 Sep 2022 07:00:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 398489.639331; Mon, 05 Sep 2022 07:00:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oV65c-0004yL-6x; Mon, 05 Sep 2022 07:00:12 +0000 Received: by outflank-mailman (input) for mailman id 398489; Mon, 05 Sep 2022 07:00:10 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oV65a-0004y1-9o for xen-devel@lists.xenproject.org; Mon, 05 Sep 2022 07:00:10 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [2001:67c:2178:6::1c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 607261dc-2ce8-11ed-a016-b9edf5238543; Mon, 05 Sep 2022 09:00:08 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BCF79381F6; Mon, 5 Sep 2022 07:00:07 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 789E9139C7; Mon, 5 Sep 2022 07:00:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +S0vHHeeFWNlZAAAMHmgww (envelope-from ); Mon, 05 Sep 2022 07:00:07 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 607261dc-2ce8-11ed-a016-b9edf5238543 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1662361207; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=VwnnnHFVyMh4doC8T6gN9JLyib/ggCwOKhTiZDOdBa4=; b=PzDdNUlOKecQLi51LKGUBb5sNIfG+oOQZ0KyKXwa4LAJ7XwDVt7N3w6As09oNioYhwvB6b Oulc0MzAHxGAk1FyYPBU6q0cIzrZ3AxOCevF2g64Ou1ZavDIVQdSlk4TGR2ctZSGr62glv 3FhZMUV/6UB6fhxlyXiBPv+cMz40MAc= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Henry.Wang@arm.com, Juergen Gross , George Dunlap , Dario Faggioli , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v4 0/3] xen/sched: fix cpu hotplug Date: Mon, 5 Sep 2022 09:00:02 +0200 Message-Id: <20220905070005.16788-1-jgross@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A recent change in the hypervisor memory allocation framework led to crashes when unplugging host cpus. This was due to the (correct) assertion that allocating and freeing memory is allowed with enabled interrupts only. As the main cpu unplug operation is done in stop-machine context, this assertion triggers in debug builds. Correct that by pre-allocating all needed memory while interrupts are still on, and free memory after interrupts are enabled again. Changes in V4: - addressed comments Changes in V3: - addressed all comments Changes in V2: - addressed all comments Juergen Gross (3): xen/sched: introduce cpupool_update_node_affinity() xen/sched: carve out memory allocation and freeing from schedule_cpu_rm() xen/sched: fix cpu hotplug xen/common/sched/core.c | 214 ++++++++++++++++++++++++------------- xen/common/sched/cpupool.c | 92 +++++++++++----- xen/common/sched/private.h | 21 +++- xen/include/xen/sched.h | 9 +- 4 files changed, 236 insertions(+), 100 deletions(-) -- 2.35.3