From patchwork Thu Aug 11 14:59:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9275385 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 E75206022E for ; Thu, 11 Aug 2016 15:07:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7BBC286C1 for ; Thu, 11 Aug 2016 15:07:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC604286E1; Thu, 11 Aug 2016 15:07:24 +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 135C6286C1 for ; Thu, 11 Aug 2016 15:07:24 +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 1bXrWv-0004Lq-HG; Thu, 11 Aug 2016 15:04:21 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXrWu-0004Lk-JE for xen-devel@lists.xenproject.org; Thu, 11 Aug 2016 15:04:20 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id D1/15-19922-3F39CA75; Thu, 11 Aug 2016 15:04:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRWlGSWpSXmKPExsXitHSDve6nyWv CDa4f1LP4vmUykwOjx+EPV1gCGKNYM/OS8isSWDP+r/vCXnDOu+LQxpeMDYwf3boYOTkkBEIk Zh1eyQxi8woYSjyes4IJxBYWcJM4OHU5G4jNJmAg8WbHXlYQW0TAV2LvzjksIDazQJ7E29PTw XpZBFQl9k6ZwQhicwrYS0zsfAdUz8UhJDCDSWJ+626wZn4BSYlbXz4yQzRXS3RN3MIOcYS+xP F5K9ggjhCUODnzCdgCIQE1iRlzL7NC1HBL3D49lXkCI/8sJO2zkLRAxDUlWrf/ZoewtSWWLXz NDGHbSqxb9x6qxkZi09UFjBC2vMT2t3OYFzCyr2JUL04tKkst0jXWSyrKTM8oyU3MzNE1NDDV y00tLk5MT81JTCrWS87P3cQIDHIGINjBuPef0yFGSQ4mJVFe4ZjV4UJ8SfkplRmJxRnxRaU5q cWHGGU4OJQkeB0mrQkXEixKTU+tSMvMAcYbTFqCg0dJhPfQRKA0b3FBYm5xZjpE6hSjopQ4ry RInwBIIqM0D64NFuOXGGWlhHkZgQ4R4ilILcrNLEGVf8UozsGoJMwbADKFJzOvBG76K6DFTEC LT5iBLS5JREhJNTDy1rDonV8/77bRKZZTBt0LF4vf+txct/LEuRslx1sq5BQMKhbvXH47kvnL awcrxcm+y8pE9PX6pnJ81vI5V3j++nTHmOWK0+8cuTQ5QnbpA0s+pX8KHDP3WvxeaLH8d+rGL V/X//js7Jjc5SIRfr78y/5b4Q4nzPjtV7q+dfCujGFIKHw5l81WiaU4I9FQi7moOBEAmBDLD+ wCAAA= X-Env-Sender: prvs=02474b12f=dario.faggioli@citrix.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1470927856!36879301!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.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35219 invoked from network); 11 Aug 2016 15:04:18 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 11 Aug 2016 15:04:18 -0000 X-IronPort-AV: E=Sophos;i="5.28,505,1464652800"; d="asc'?scan'208";a="379484673" Message-ID: <1470927584.6250.26.camel@citrix.com> From: Dario Faggioli To: Jan Beulich , George Dunlap Date: Thu, 11 Aug 2016 16:59:44 +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: MIA2 Cc: xen-devel@lists.xenproject.org, Anshul Makkar , MengXu Subject: Re: [Xen-devel] [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). > Hey, I could only start working on this this morning (sorry for the delay), and I'll continue tomorrow but, at least here, staging-4.6 (plus the patches!) crashes like this: (XEN) [    0.000000] ----[ Xen-4.6.4-pre  x86_64  debug=y  Not tainted ]---- (XEN) [    0.000000] CPU:    0 (XEN) [    0.000000] RIP:    e008:[] _csched_cpu_pick+0x156/0x612 (XEN) [    0.000000] RFLAGS: 0000000000010046   CONTEXT: hypervisor (XEN) [    0.000000] rax: 0000000000000040   rbx: 0000000000000040   rcx: 0000000000000000 (XEN) [    0.000000] rdx: 000000000000003f   rsi: 0000000000000040   rdi: 0000000000000040 (XEN) [    0.000000] rbp: ffff82d0802f7d68   rsp: ffff82d0802f7c78   r8:  0000000000000000 (XEN) [    0.000000] r9:  0000000000000001   r10: 0000000000000001   r11: 00000000000000b4 (XEN) [    0.000000] r12: 0000000000000040   r13: ffff83032152bf40   r14: ffff82d08033ae40 (XEN) [    0.000000] r15: ffff8300dbdf4000   cr0: 0000000080050033   cr4: 00000000000006e0 (XEN) [    0.000000] cr3: 00000000dba9f000   cr2: 0000000000000000 (XEN) [    0.000000] ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008 (XEN) [    0.000000] Xen stack trace from rsp=ffff82d0802f7c78: (XEN) [    0.000000]    0000000000000046 0000000200000092 ffff82d08033ae48 ffff82d08028b020 (XEN) [    0.000000]    0000000000000000 ffff82d0802ff040 0000000100000001 ffff82d08033ae40 (XEN) [    0.000000]    0000000000000097 ffff82d0802f7cd8 0000000000000006 ffff82d0802f7ce8 (XEN) [    0.000000]    ffff82d08012d027 ffff830321532000 ffff82d0802f7d28 ffff82d08013c779 (XEN) [    0.000000]    0000000000000000 0000000000000010 0000000000000048 0000000000000048 (XEN) [    0.000000]    0000000000000000 0000000000000000 0000000000000000 0000000000000000 (XEN) [    0.000000]    ffff82d0802f7d78 ffff8300dbdf4000 ffff83032152a000 ffff83032152bf40 (XEN) [    0.000000]    0000000000000000 ffff82d08028e020 ffff82d0802f7d78 ffff82d080123d8e (XEN) [    0.000000]    ffff82d0802f7db8 ffff82d080123db0 ffff83032152a000 ffff8300dbdf4000 (XEN) [    0.000000]    ffff83032152a000 0000000000000000 0000000000000000 ffff82d08028e020 (XEN) [    0.000000]    ffff82d0802f7de8 ffff82d080129e8d ffff82d0802f7de8 ffff82d08013cda0 (XEN) [    0.000000]    ffff8300dbdf4000 ffff83032152a000 ffff82d0802f7e18 ffff82d080105f59 (XEN) [    0.000000]    ffff82d0802a1720 ffff82d0802a1718 ffff82d0802a1720 ffff82d0802daa60 (XEN) [    0.000000]    ffff82d0802f7e48 ffff82d0802a8145 0000000000000002 ffff83032152b610 (XEN) [    0.000000]    0000000000000002 0000000000000001 ffff82d0802f7f08 ffff82d0802c5c6f (XEN) [    0.000000]    0000000000000000 0000000000100000 00000000014ae000 0000000000324000 (XEN) [    0.000000]    0080016300000000 0000000300000015 0000000000000000 0000000000000010 (XEN) [    0.000000]    ffff83000008dd50 ffff83000008df20 0000000000000002 ffff83000008dfb0 (XEN) [    0.000000]    0000000800000000 000000010000006e 0000000000000003 00000000000002f8 (XEN) [    0.000000]    0000000000000000 0000000000000000 0000000000000000 0000000000000000 (XEN) [    0.000000] Xen call trace: (XEN) [    0.000000]    [] _csched_cpu_pick+0x156/0x612 (XEN) [    0.000000]    [] csched_cpu_pick+0xe/0x10 (XEN) [    0.000000]    [] csched_vcpu_insert+0x20/0x145 (XEN) [    0.000000]    [] sched_init_vcpu+0x1d1/0x218 (XEN) [    0.000000]    [] alloc_vcpu+0x1ba/0x2a4 (XEN) [    0.000000]    [] scheduler_init+0x1b0/0x271 (XEN) [    0.000000]    [] __start_xen+0x1f85/0x2550 (XEN) [    0.000000]    [] __high_start+0x53/0x55 (XEN) [    0.000000]  (XEN) [    0.000000]  (XEN) [    0.000000] **************************************** (XEN) [    0.000000] Panic on CPU 0: (XEN) [    0.000000] Assertion 'cpu < nr_cpu_ids' failed at ...e/SOURCES/xen/xen.git/xen/include/xen/cpumask.h:97 Which, I think needs at least this hunk (from 6b53bb4ab3c9  "sched: better handle (not) inserting idle vCPUs in runqueues"): So, yeah, it's proving a little more complicated than how I thought it would have, just by looking at the patches. :-/ Will let know. Regards, Dario diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 2beebe8..fddcd52 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;  }