From nobody Sun May 5 08:31:41 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1559048983; cv=none; d=zoho.com; s=zohoarc; b=jIp//pd6Yed0nXVRmjQDjHO7w8sUN1MaVHd/+yc7W7geXdf0onFFGe8Gblb85a12N6Aw3B3meKkqtCpV4AywRBAXYsOguq+2vz65pJ6UvGwcl9Sv1gnOervcE1ZKojJS53Ub63H3rvn5t8v+G0TvSgFkKas37rGirQXZ1jVOZb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559048983; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=PCnYIlo0XxKdaXLlnKi15DexFIjnOH03Wx0q5U9Yp8s=; b=Rlas41CNZ6fg0X50OsXLyy6ZlWQeJQmS9OAE/ambC2hf9DAOA1e03Ed86/ilCbkqudHIptxQ0oOZ6Pc4uMWz255YkNZkq1VFAheIY4KxIjoa88K4OPl3Jkn1PtbITcMdp7ncAYaxtIUa4iaxXpNiKxduE9OjhXPU7Ub9iF+jEM4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1559048983591514.9264358055939; Tue, 28 May 2019 06:09:43 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hVbpz-0007tD-GW; Tue, 28 May 2019 13:08:19 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hVbpy-0007t8-Ec for xen-devel@lists.xenproject.org; Tue, 28 May 2019 13:08:18 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id a7d05117-8149-11e9-8980-bc764e045a96; Tue, 28 May 2019 13:08:16 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4FFB3AEF3; Tue, 28 May 2019 13:08:15 +0000 (UTC) X-Inumbo-ID: a7d05117-8149-11e9-8980-bc764e045a96 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 28 May 2019 15:08:11 +0200 Message-Id: <20190528130811.26480-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH] xen: remove on-stack cpumask from stop_machine_run() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The "allbutself" cpumask in stop_machine_run() is not needed. Instead of allocating it on the stack it can easily be avoided. Signed-off-by: Juergen Gross --- xen/common/stop_machine.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/xen/common/stop_machine.c b/xen/common/stop_machine.c index ce6f5624c4..ccda2efa3e 100644 --- a/xen/common/stop_machine.c +++ b/xen/common/stop_machine.c @@ -69,8 +69,8 @@ static void stopmachine_wait_state(void) =20 int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu) { - cpumask_t allbutself; unsigned int i, nr_cpus; + unsigned int my_cpu =3D smp_processor_id(); int ret; =20 BUG_ON(!local_irq_is_enabled()); @@ -79,9 +79,7 @@ int stop_machine_run(int (*fn)(void *), void *data, unsig= ned int cpu) if ( !get_cpu_maps() ) return -EBUSY; =20 - cpumask_andnot(&allbutself, &cpu_online_map, - cpumask_of(smp_processor_id())); - nr_cpus =3D cpumask_weight(&allbutself); + nr_cpus =3D cpumask_weight(&cpu_online_map) - 1; =20 /* Must not spin here as the holder will expect us to be descheduled. = */ if ( !spin_trylock(&stopmachine_lock) ) @@ -100,8 +98,9 @@ int stop_machine_run(int (*fn)(void *), void *data, unsi= gned int cpu) =20 smp_wmb(); =20 - for_each_cpu ( i, &allbutself ) - tasklet_schedule_on_cpu(&per_cpu(stopmachine_tasklet, i), i); + for_each_cpu ( i, &cpu_online_map ) + if ( i !=3D my_cpu ) + tasklet_schedule_on_cpu(&per_cpu(stopmachine_tasklet, i), i); =20 stopmachine_set_state(STOPMACHINE_PREPARE); stopmachine_wait_state(); --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel