From nobody Tue Nov 11 11:45:08 2025 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=1564122436; cv=none; d=zoho.com; s=zohoarc; b=gkxdcDixJIJ3usJDRaGo0zFoH8FNg1R9aV8FW0IB+mdo+VfQFeWPLTiTZPr9H2DuRTZfXhDAXpWeDON8dk+qd4t4/FDW11iiwCL8otb+BcN4FJiSgh/2pGgVCHM4W8NuzC4zcQanFY0v3coyGKtqslg84MjerZQiP/wlEuGYzcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564122436; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vZA6PUELiVFIfQB6RiYQBXCT6+SAXTiaVvnFP+JRHew=; b=E26OFHMM2EO9qJlkGwpc3MUHTZNHpae/T9yeIAUR54H+Y/N+bimwV4rhFFjuTZnu1uvU7jqzobfaXMvKn13TTYVFR+bUQVNrQtWSWaiYihyj6NU6BxFNzQ3e+dlb3jEoXEuHmuTsjOuYyzUAqMg6CjIzWYNxyUe+g7cSS7y7tz8= 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 1564122436417202.03833259071666; Thu, 25 Jul 2019 23:27:16 -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 1hqtgB-0003DW-7w; Fri, 26 Jul 2019 06:26:11 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqtgA-0003D8-9K for xen-devel@lists.xenproject.org; Fri, 26 Jul 2019 06:26:10 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 413df3ca-af6e-11e9-8980-bc764e045a96; Fri, 26 Jul 2019 06:26:09 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 73B98AD31; Fri, 26 Jul 2019 06:26:08 +0000 (UTC) X-Inumbo-ID: 413df3ca-af6e-11e9-8980-bc764e045a96 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 26 Jul 2019 08:26:07 +0200 Message-ID: <156412236781.2385.9110155201477198899.stgit@Palanthas> In-Reply-To: <156412188377.2385.12588508835559819141.stgit@Palanthas> References: <156412188377.2385.12588508835559819141.stgit@Palanthas> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 4/4] xen: sched: refactor the ASSERTs around vcpu_deassing() 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: George Dunlap Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" It is all the time that we call vcpu_deassing() that the vcpu _must_ be assigned to a pCPU, and hence that such pCPU can't be free. Therefore, move the ASSERT-s which check for these properties in that function, where they belong better. Signed-off-by: Dario Faggioli Reviewed-by: George Dunlap --- xen/common/sched_null.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/common/sched_null.c b/xen/common/sched_null.c index 1bbcaf92b9..c72335e5fa 100644 --- a/xen/common/sched_null.c +++ b/xen/common/sched_null.c @@ -368,6 +368,8 @@ static bool vcpu_deassign(struct null_private *prv, str= uct vcpu *v) struct null_vcpu *wvc; =20 ASSERT(list_empty(&null_vcpu(v)->waitq_elem)); + ASSERT(per_cpu(npc, v->processor).vcpu =3D=3D v); + ASSERT(!cpumask_test_cpu(v->processor, &prv->cpus_free)); =20 per_cpu(npc, cpu).vcpu =3D NULL; cpumask_set_cpu(cpu, &prv->cpus_free); @@ -529,9 +531,6 @@ static void null_vcpu_remove(const struct scheduler *op= s, struct vcpu *v) goto out; } =20 - ASSERT(per_cpu(npc, v->processor).vcpu =3D=3D v); - ASSERT(!cpumask_test_cpu(v->processor, &prv->cpus_free)); - vcpu_deassign(prv, v); =20 out: _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel