From patchwork Thu Jun 29 12:56:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9816707 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 CC01A603D7 for ; Thu, 29 Jun 2017 12:58:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 117E4285DA for ; Thu, 29 Jun 2017 12:58:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05E38286E2; Thu, 29 Jun 2017 12:58:30 +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 7C440285DA for ; Thu, 29 Jun 2017 12:58:29 +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 1dQYzl-0006gb-3z; Thu, 29 Jun 2017 12:56: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 1dQYzj-0006gG-Ig for xen-devel@lists.xenproject.org; Thu, 29 Jun 2017 12:56:27 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id 70/67-03582-AF8F4595; Thu, 29 Jun 2017 12:56:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEIsWRWlGSWpSXmKPExsXiVRvkpPvrR0i kweIWWYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWP9w1bGgsVcFXd3fGZuYJzO0cXIxSEkMJ1R ovHkXhYQh0VgDavE6r4/jCCOhMAlVoneWXuYuxg5gZw4iZZPq1gh7HKJS59vsIDYQgIqEje3r 2KCGPWdUeLbjVZGkISwgJ7EkaM/2CHsYImXSz+CxdkEDCTe7NgLNkhEQEni3qrJQM0cHMwC+h Krv/KAhFkEVCVedE1kA7F5BewlDv7sBrM5BRwlNj1cwgix10HizoVXYLaogJzEysstrBD1ghI nZz5hgRipKbF+lz5ImFlAXmL72znMExhFZiGpmoVQNQtJ1QJG5lWMGsWpRWWpRbqGZnpJRZnp GSW5iZk5uoYGZnq5qcXFiempOYlJxXrJ+bmbGIHhzwAEOxjvbww4xCjJwaQkymv4PCRSiC8pP 6UyI7E4I76oNCe1+BCjDAeHkgRv1negnGBRanpqRVpmDjASYdISHDxKIrwPvwKleYsLEnOLM9 MhUqcYdTkmHdj+hUmIJS8/L1VKnHcjyAwBkKKM0jy4EbCkcIlRVkqYlxHoKCGegtSi3MwSVPl XjOIcjErCvH9BpvBk5pXAbXoFdAQT0BHCM8COKElESEk1MJo9jOjwynjKt/eb3Jp7dZ0ft/2c FbipPWypf23qtezDktxq0cqP1b6mrXLvifDoX3Vj3exbuibnJtb8cTmQaHo6eHKs2KMpd+07r AK2fH3HtmtDh0imSX5crEKG1CG3n9+Op7vfD7bdcVVN6eQ30zszn65e1VQi7Fqx+4jn5HP/dn oo3++01FViKc5INNRiLipOBACaA0uNBQMAAA== X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-16.tower-21.messagelabs.com!1498740986!58948573!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.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4523 invoked from network); 29 Jun 2017 12:56:26 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-16.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 29 Jun 2017 12:56:26 -0000 Received: by mail-wm0-f66.google.com with SMTP id u23so2423542wma.2 for ; Thu, 29 Jun 2017 05:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=e7fxj+sw45/1GV63p0SVHJC3HOZ26HjhkVf7ezzWa7s=; b=FxSdyLAOjNy7a6tpuFlFnSGov+cuiippkMyJhs0xPcoY9fJ7GGJqO7JvgUTB3OPdpX sMvBa9Groe3jvKdo0IwGhVeTLZtDe6wfbffidzR1wP31IFl1/nNdB/SdCUzB73dRj2mA nfu5fS42XKHxlBpxA0l2SYbkhMWWaRv/quZ6/8IwPSJ+OHVZBe6C6dBXit1wo3NILFtY VcNH2N8wxWihZllyukz0Wzf7osNEY+/7yl+je4zYgOUPXOJW1LR0M3GX0ImFhvQHbrsb lYYGNI6j4VzJE9ONfuLK2Zphb827sG4lrfGJEbbj2/gmjlko79oxqeNoyonaOrUFq7ws 3tig== 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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=e7fxj+sw45/1GV63p0SVHJC3HOZ26HjhkVf7ezzWa7s=; b=kLC5hKEOBqPzMbs3mPLaFHAH0QsJYCHd7sSMHCBQDRyqYpRdGNPJ7uF8V6KUc9FXJI tgYFGOE+yYYiUmvQYoIbMPbeydODQ/nVWrttPzvyIDPYYcJMhjvUKPXyZpN2eavR8h+h D6vOZyMo6WhEU76aen0a309cI7elC6w+KDeCBsCUkas5UXyXfEFh9EVnb0Rj/6zJ5SUS sxmkJLvIL4a4g7dRiNu7NxSG7495eo41xZsORAhU4hvvR+u3GCXJMUOCff9liNo+QBLR S62t/orsw8G5qcLLYEYIoiUXW3zh0NmoZwD//QrFoKVjDOG2fYEKMfNk77C8CLztGjF1 HsLQ== X-Gm-Message-State: AKS2vOxziEsVpXB+cLg01akWMBPrDCUX0QQFVcOQIRfrFlxu2750vDWM NCD1+H6ZzdIzyqSh X-Received: by 10.28.138.8 with SMTP id m8mr11557714wmd.40.1498740986167; Thu, 29 Jun 2017 05:56:26 -0700 (PDT) Received: from [192.168.0.31] ([80.66.223.37]) by smtp.gmail.com with ESMTPSA id b94sm4241434wrd.40.2017.06.29.05.56.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 05:56:25 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Thu, 29 Jun 2017 14:56:24 +0200 Message-ID: <149874098367.524.1300209233921079469.stgit@Solace> In-Reply-To: <149874017405.524.14075439009139766753.stgit@Solace> References: <149874017405.524.14075439009139766753.stgit@Solace> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap Subject: [Xen-devel] [PATCH 2/5] xen: sched_null: check for pending tasklet work a bit earlier 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 Whether or not there's pending tasklet work to do, it's something we know from the tasklet_work_scheduled parameter. Deal with that as soon as possible, like all other schedulers do. Signed-off-by: Dario Faggioli Reviewed-by: George Dunlap --- Cc: George Dunlap --- xen/common/sched_null.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/common/sched_null.c b/xen/common/sched_null.c index 705c00a..610a150 100644 --- a/xen/common/sched_null.c +++ b/xen/common/sched_null.c @@ -641,7 +641,10 @@ static struct task_slice null_schedule(const struct scheduler *ops, SCHED_STAT_CRANK(schedule); NULL_VCPU_CHECK(current); - ret.task = per_cpu(npc, cpu).vcpu; + if ( tasklet_work_scheduled ) + ret.task = idle_vcpu[cpu]; + else + ret.task = per_cpu(npc, cpu).vcpu; ret.migrated = 0; ret.time = -1; @@ -663,9 +666,7 @@ static struct task_slice null_schedule(const struct scheduler *ops, spin_unlock(&prv->waitq_lock); } - if ( unlikely(tasklet_work_scheduled || - ret.task == NULL || - !vcpu_runnable(ret.task)) ) + if ( unlikely(ret.task == NULL || !vcpu_runnable(ret.task)) ) ret.task = idle_vcpu[cpu]; NULL_VCPU_CHECK(ret.task);