From patchwork Sat Jan 28 01:42:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9542927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A5D0360429 for ; Sat, 28 Jan 2017 01:45:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 982CC271BC for ; Sat, 28 Jan 2017 01:45:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C8E827F93; Sat, 28 Jan 2017 01:45:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E5F6E27F9F for ; Sat, 28 Jan 2017 01:45:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXI29-0005AJ-1x; Sat, 28 Jan 2017 01:42:29 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXI28-0005AD-I6 for xen-devel@lists.xenproject.org; Sat, 28 Jan 2017 01:42:28 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id A1/D6-25337-307FB885; Sat, 28 Jan 2017 01:42:27 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGIsWRWlGSWpSXmKPExsXiVRvkpMv8vTv C4NdnTovvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPRl+usBXP4K2afucnUwHiBp4uRk0NIYAaj xLL38l2MXBwsAlNZJd7Nm8YE4kgIbGSV2HL1CjtIlYRAjMSs7wuZIOwyiXXHO9khulUkbm5fB dYANIlJYv2FncwgCWEBPYkjR3+wQ9iBEr+7noHF2QQMJN7s2MsKYosIKEncWzUZbCizQLXEvu fHwWpYBFQlvm67AxbnFfCWeNrVBmaLCshJrLzcwgoRF5Q4OfMJSxcjB1CvpsT6XfoQY+Qltr+ dwzyBUWgWkqpZCFWzkFQtYGRexahRnFpUllqka2iul1SUmZ5RkpuYmaNraGCml5taXJyYnpqT mFSsl5yfu4kRGM4MQLCD8fbGgEOMkhxMSqK83BbdEUJ8SfkplRmJxRnxRaU5qcWHGDU4OAQmn J07nUmKJS8/L1VJglfkG1CdYFFqempFWmYOMOJgSiU4eJREeG9/BUrzFhck5hZnpkOkTjHqcu zadfklkxDYDClxXguQGQIgRRmleXAjYNF/iVFWSpiXEehAIZ6C1KLczBJU+VeM4hyMSsK8d0F W8WTmlcBtegV0BBPQEeI/ukCOKElESEk1ME7gNK3+tOFDVUuE9N5Qrsa4ha1uZyvvSu2VrNma GyNrcOn/VJvzy2YX8gr5ir0Kvto38/nHjkdhZ45s2derLspio8+aUbx0yrlVbemrQ5ca2LXNv jfX6+kNjrWvnlasP26xJerC2Q9G9vJB75+cqcic+yzrifySyMdaEzMi565pPPV1UcFtZlUllu KMREMt5qLiRABbUblb+QIAAA== X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1485567746!49119231!1 X-Originating-IP: [74.125.82.66] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51988 invoked from network); 28 Jan 2017 01:42:27 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-14.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 28 Jan 2017 01:42:27 -0000 Received: by mail-wm0-f66.google.com with SMTP id c85so61920457wmi.1 for ; Fri, 27 Jan 2017 17:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=cpT1oSBOcQYPgXEeAA+KLClJYv8f18O/LcKW+HWyNpg=; b=t5pL4JyJDcCSMbHQ63e1DFCvMZ++srKbFGzBtSIJKdScQ/zY4QZyvZDmB9AdaZSLBj vvxOSvAmWMTQAlAD2j6zSwKXq2fsT+ElUxkNj++u/asKd3H+xfngnVZd12VihGI2EImY UZdrqO4f+MnorG5/zii38dOJY+kXThw42sXLlKEg/7ij1Tg17cA4D6xJdaYj28NMyzcm 5VkofsMcvqm7I7XwBCmAuwK2HF8VPVc6Ec3RMjibJPRIqf1AYHjzkuKFrjN4eJ6Sm2qu FiUScQxeTGgNAB5PYk6KKwceOzaDBYEhagSxCQkr41VB2i2VLrpwAOKZEtn8AlCgMX0J etJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :user-agent:mime-version:content-transfer-encoding; bh=cpT1oSBOcQYPgXEeAA+KLClJYv8f18O/LcKW+HWyNpg=; b=BHglt6/FCKjGpWurmjHTrwsW5ZvziSSlwu0JrINhEyL2mc7FPOSi8wrPdWZCashsu+ FHbLtAUQNh5EXxW0RLITrQ7ShXIIZ0FKbe4U/Fh8VwqK5Q97AtbvsaZkjGyx+KY1dFXT DhzaQM4PupQ/w0pAipch7QQX4HKUcGlZrxK7ACOEyrh1YHkmSs1EN66NpmF3T9wGPXWf v8Hy2uWk8yT8Jg85fMlAYBhLw7lXTGrRVp1ndNKgJAEmPyBOZN8UZNwUdoRJu2masMjl 2YbOddYv2qHsONnRYedOyO/IScK2Qm8uKTjDMRzfJD/rncemR080XelR0Qxyfv4hwewe 1NLw== X-Gm-Message-State: AIkVDXIaxdfNfb8YvdmUskuCMro1PoierWVOjyURpXFq/RWQp7VjxvL9+M1ddyo4HsBIWA== X-Received: by 10.28.103.3 with SMTP id b3mr4979624wmc.99.1485567746717; Fri, 27 Jan 2017 17:42:26 -0800 (PST) Received: from Solace.fritz.box (58-209-66-80.hosts.abilene.it. [80.66.209.58]) by smtp.gmail.com with ESMTPSA id q5sm10570705wrd.32.2017.01.27.17.42.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jan 2017 17:42:25 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Sat, 28 Jan 2017 02:42:22 +0100 Message-ID: <148556774217.15340.9983189953428043418.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap , Anshul Makkar , Jan Beulich Subject: [Xen-devel] [PATCH] xen: credit2: non Credit2 pCPUs are ok during shutdown/suspend. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Commit 7478ebe1602e6 ("xen: credit2: fix shutdown/suspend when playing with cpupools"), while doing the right thing for actual code, forgot to update the ASSERT()s accordingly, in csched2_vcpu_migrate(). In fact, as stated there already, during shutdown/suspend, we must allow a Credit2 vCPU to temporarily migrate to a non Credit2 BSP, without any ASSERT() triggering. Move them down, after the check for whether or not we are shutting down, where the assumption that the pCPU must be valid Credit2 ones, is valid. Signed-off-by: Dario Faggioli Reviewed-by: George Dunlap --- Cc: George Dunlap Cc: Anshul Makkar Cc: Jan Beulich --- If 7478ebe1602e is backported, this one should be as well. Sorry for this. I'm sure I tested, so I don't know how it could happened... I must have forgotten debug=n when testing this case. :-( --- xen/common/sched_credit2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index b2f2b17..85f36bc 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -1953,10 +1953,6 @@ csched2_vcpu_migrate( struct csched2_runqueue_data *trqd; s_time_t now = NOW(); - /* Check if new_cpu is valid */ - ASSERT(cpumask_test_cpu(new_cpu, &CSCHED2_PRIV(ops)->initialized)); - ASSERT(cpumask_test_cpu(new_cpu, vc->cpu_hard_affinity)); - /* * Being passed a target pCPU which is outside of our cpupool is only * valid if we are shutting down (or doing ACPI suspend), and we are @@ -1985,6 +1981,10 @@ csched2_vcpu_migrate( return; } + /* If here, new_cpu must be a valid Credit2 pCPU, and in our affinity. */ + ASSERT(cpumask_test_cpu(new_cpu, &CSCHED2_PRIV(ops)->initialized)); + ASSERT(cpumask_test_cpu(new_cpu, vc->cpu_hard_affinity)); + trqd = RQD(ops, new_cpu); /*