From patchwork Fri Aug 12 01:59:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9276193 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 C6510600CB for ; Fri, 12 Aug 2016 02:03:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4D3B287EB for ; Fri, 12 Aug 2016 02:03:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A96D9287F0; Fri, 12 Aug 2016 02:03:42 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 CD60A287EB for ; Fri, 12 Aug 2016 02:03:41 +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 1bY1lP-000611-5q; Fri, 12 Aug 2016 01:59:59 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bY1lN-00060v-NU for xen-devel@lists.xenproject.org; Fri, 12 Aug 2016 01:59:57 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 6F/52-09160-C9D2DA75; Fri, 12 Aug 2016 01:59:56 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRWlGSWpSXmKPExsXitHSDve5s3bX hBuc36Fl83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBl7/61jKuhUrjjwbDp7A+MT+S5GTg4JgRCJ /YfPsYPYvAKGEkeXtbGB2MIChRKff91gAbHZBAwk3uzYywpiiwj4SuzdOQcsziyQJ/H29HRmE JtFQFWiv/8DI4jNKWAvMbHzHVA9F4eQwAwmifmtu8Ga+QUkJW59+cgM0Vwt8b59HxPEEfoSx+ etYIM4QlDi5MwnYAuEBNQkZsy9DNTLAVTDLfG3234CI/8sJN2zkHRAxDUlWrf/ZoewtSWWLXz NDGHbSqxb9x6qxkZi09UFjBC2vMT2t3OYFzCyr2LUKE4tKkst0jUy00sqykzPKMlNzMzRNTQw 1stNLS5OTE/NSUwq1kvOz93ECAzyegYGxh2MDXv9DjFKcjApifJOvbQmXIgvKT+lMiOxOCO+q DQntfgQowwHh5IE71SdteFCgkWp6akVaZk5wHiDSUtw8CiJ8F4BSfMWFyTmFmemQ6ROMSpKif MuBkkIgCQySvPg2mAxfolRVkqYl5GBgUGIpyC1KDezBFX+FaM4B6OSMO8jkCk8mXklcNNfAS1 mAlp8wmwNyOKSRISUVANjkUVso7p5lLjjxJPtG7fUyizl9Fy2gf2gJu/J/V5LbXfXb1U6tLN0 88vzItd2Nd7sfdXVszFxkUaRS+f+X0+qrtUfWCETILt5VW/rb18R5WcqIXXf12lxX179MkRlT foLpvTEN/e0LAuULp61+PvoULZPjlfx2ZnFMnlfGJaXnp4YzsQo6hyjxFKckWioxVxUnAgAvu BcuOwCAAA= X-Env-Sender: prvs=025d78e59=dario.faggioli@citrix.com X-Msg-Ref: server-2.tower-31.messagelabs.com!1470967194!55180617!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10616 invoked from network); 12 Aug 2016 01:59:55 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-2.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 12 Aug 2016 01:59:55 -0000 X-IronPort-AV: E=Sophos;i="5.28,507,1464652800"; d="asc'?scan'208";a="379645079" Message-ID: <1470967188.6250.48.camel@citrix.com> From: Dario Faggioli To: Jan Beulich , George Dunlap Date: Fri, 12 Aug 2016 03:59:48 +0200 In-Reply-To: <57A4AFA70200007800103367@prv-mh.provo.novell.com> References: <1468605722-24239-1-git-send-email-george.dunlap@citrix.com> <1468605722-24239-2-git-send-email-george.dunlap@citrix.com> <579F434B0200007800101346@prv-mh.provo.novell.com> <1470054737.3311.0.camel@citrix.com> <57A4AFA70200007800103367@prv-mh.provo.novell.com> Organization: Citrix Inc. X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) MIME-Version: 1.0 X-DLP: MIA1 Cc: xen-devel@lists.xenproject.org, Anshul Makkar , MengXu Subject: [Xen-devel] dependences for backporting to 4.6 [was: Re: [PATCH 2/3] xen: Have schedulers revise initial placement] 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 On Fri, 2016-08-05 at 07:24 -0600, Jan Beulich wrote: > I'd really like to have those backported, but I have to ask one > of you to identify which prereq-s are needed on 4.6 and 4.5 > (I'll revert them from 4.5 right away, but I'll wait for an osstest > flight to confirm the same issue exists on 4.6). > So, for 4.6, I think the only prerequisite would be this: 6b53bb4ab3c9bd5eccde88a5175cf72589ba6d52 "sched: better handle (not) inserting idle vCPUs in runqueues" That, however, does not apply cleanly. The important part of it is the last hunk: With this only applied, things works for me. The hunk is actually the core of the patch, the only real functionality change. The other hunks are refactoring and cleanups (made possible by it). So, I'm not sure whether the best route here is:  - fully backport 6b53bb4ab3c9b;  - backport only the last hunk of 6b53bb4ab3c9b as its own patch;  - fold the last hunk of 6b53bb4ab3c9b in the backport of George's     patch (I mean, what was 83dff3992a89 in staging-4.6); Thoughts? Note that the issue Andrew is reporting (on 4.7) is, IMO, unrelated to the hunk above, and may well affect staging as well and (if that's the case) should be fixed there, and the fix backported, I think. Regards, Dario diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 92057eb..c195129 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -240,20 +240,22 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor)      init_timer(&v->poll_timer, poll_timer_fn,                 v, v->processor);   -    /* Idle VCPUs are scheduled immediately. */ +    v->sched_priv = SCHED_OP(DOM2OP(d), alloc_vdata, v, d->sched_priv); +    if ( v->sched_priv == NULL ) +        return 1; + +    TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id); + +    /* Idle VCPUs are scheduled immediately, so don't put them in runqueue. */      if ( is_idle_domain(d) )      {          per_cpu(schedule_data, v->processor).curr = v;          v->is_running = 1;      } - -    TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id); - -    v->sched_priv = SCHED_OP(DOM2OP(d), alloc_vdata, v, d->sched_priv); -    if ( v->sched_priv == NULL ) -        return 1; - -    SCHED_OP(DOM2OP(d), insert_vcpu, v); +    else +    { +        SCHED_OP(DOM2OP(d), insert_vcpu, v); +    }        return 0;  }