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 E3EDAC32772 for ; Tue, 16 Aug 2022 10:13:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.388165.624754 (Exim 4.92) (envelope-from ) id 1oNtZa-00049j-M4; Tue, 16 Aug 2022 10:13:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 388165.624754; Tue, 16 Aug 2022 10:13:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oNtZa-00049c-J6; Tue, 16 Aug 2022 10:13:22 +0000 Received: by outflank-mailman (input) for mailman id 388165; Tue, 16 Aug 2022 10:13:21 +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 1oNtZZ-00049L-5y for xen-devel@lists.xenproject.org; Tue, 16 Aug 2022 10:13:21 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0d6452d3-1d4c-11ed-bd2e-47488cf2e6aa; Tue, 16 Aug 2022 12:13:20 +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 8FFA33520D; Tue, 16 Aug 2022 10:13:19 +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 4C1371345B; Tue, 16 Aug 2022 10:13:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2k5CEb9t+2IgEAAAMHmgww (envelope-from ); Tue, 16 Aug 2022 10:13:19 +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: 0d6452d3-1d4c-11ed-bd2e-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1660644799; 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=Asy5Kgw8PlveUfT7VJ0We2wZuRDth5FOcqrG2UrqP/o=; b=b0q0mWVJNkLW8gRJtsLydg9U6/MGkDtxA/2eJfR3PXudV9seHL/zderMKX7oVnMngYUNpL Ol/8zOJ6vK2hyx2rUncdFkj2S7zlpbBuIkiYYcA/LZ7UjTISxxEipNEFiuaNDSCNYfk5GR Mi9l4eQR/ZRp9obtuHYB1arg4cQFXEY= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , George Dunlap , Dario Faggioli , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v3 0/3] xen/sched: fix cpu hotplug Date: Tue, 16 Aug 2022 12:13:14 +0200 Message-Id: <20220816101317.23014-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 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 | 91 +++++++++++----- xen/common/sched/private.h | 21 +++- xen/include/xen/sched.h | 9 +- 4 files changed, 235 insertions(+), 100 deletions(-) -- 2.35.3