From patchwork Sun Apr 26 17:10:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 47588 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CCA3C20553 for ; Sun, 26 Apr 2015 17:13:35 +0000 (UTC) Received: by wgin8 with SMTP id n8sf20770827wgi.0 for ; Sun, 26 Apr 2015 10:13:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=/A7PYw9Z8WZdsWbg98UY+kZOGzX9/CcEmrlKVt41N8w=; b=mXqhJNpVcV4I7J3SKL6z4HetHiY0TGeNO7dPbNdx2bQgn4TO3s4WwRjcIXImDLjp80 QZnB/N42LKffgMVf1wBjIn5pgvt+ok7Md00c+zDPmvcCvyrvhthOko2PwZLVSUvvyaKQ 47IdEI0+932989LCZ8TEVb5AcuyYd8LYmQy5uF+agZaUeiV8Q98fMxWU2EogN9KSVHNo ebGqNQ45YdMqJiVEH3epvuvJQPMTMlFB0LrvnW3fmn+CFPJpCRs+YoxbYmudA2YqOa9v JMqkpWsQ8SUiobSw3zoqjJTsksIbwg1fIJC+k03RiM2SPpfDiGVoY9izIozoBvuFn+GJ wUOA== X-Gm-Message-State: ALoCoQn0mstIx7/7hRZ5NNsfHe38Or4L+/cmDKyg74qwQzDQmlSqKQj5xfepMF0npam1H1vRkqf6 X-Received: by 10.180.107.33 with SMTP id gz1mr4800734wib.3.1430068415070; Sun, 26 Apr 2015 10:13:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.7 with SMTP id m7ls604111laj.70.gmail; Sun, 26 Apr 2015 10:13:34 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr7044879lbc.32.1430068414830; Sun, 26 Apr 2015 10:13:34 -0700 (PDT) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com. [2a00:1450:4010:c03::230]) by mx.google.com with ESMTPS id au9si12956770lbc.168.2015.04.26.10.13.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Apr 2015 10:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::230 as permitted sender) client-ip=2a00:1450:4010:c03::230; Received: by labbd9 with SMTP id bd9so65054360lab.2 for ; Sun, 26 Apr 2015 10:13:34 -0700 (PDT) X-Received: by 10.152.36.2 with SMTP id m2mr6750846laj.72.1430068414709; Sun, 26 Apr 2015 10:13:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp868435lbt; Sun, 26 Apr 2015 10:13:33 -0700 (PDT) X-Received: by 10.68.69.105 with SMTP id d9mr14932391pbu.144.1430068413015; Sun, 26 Apr 2015 10:13:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kw1si26346369pab.127.2015.04.26.10.13.32; Sun, 26 Apr 2015 10:13:33 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752231AbbDZRMx (ORCPT + 27 others); Sun, 26 Apr 2015 13:12:53 -0400 Received: from m15-114.126.com ([220.181.15.114]:56528 "EHLO m15-114.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751045AbbDZRMv (ORCPT ); Sun, 26 Apr 2015 13:12:51 -0400 Received: from localhost.localdomain (unknown [220.166.221.63]) by smtp7 (Coremail) with SMTP id DsmowACX+G4iHD1V8BojAA--.830S4; Mon, 27 Apr 2015 01:11:08 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Steven Rostedt , Juri Lelli , Ingo Molnar , Xunlei Pang Subject: [RFC PATCH 3/6] sched/rt: Check to push FIFO current away at each tick Date: Mon, 27 Apr 2015 01:10:55 +0800 Message-Id: <1430068258-1960-3-git-send-email-xlpang@126.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430068258-1960-1-git-send-email-xlpang@126.com> References: <1430068258-1960-1-git-send-email-xlpang@126.com> X-CM-TRANSID: DsmowACX+G4iHD1V8BojAA--.830S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7JFWkJw4UGrWfCr1DGr4kJFb_yoWkCwb_G3 90vrna9w1j9F1qqFy7Gw4Sqr92va90yFn7Xw4jgrZrCryrtrn8tr98uFyDJrsxJF48CFnx ZF9Iga4IyrsrWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5IeHPUUUUU== X-Originating-IP: [220.166.221.63] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbiJwznv01sBbhjvQAAsx Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: xlpang@126.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::230 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=126.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Xunlei Pang There may be some non-migratable tasks queued in the "run queue" with the same priority as current which is FIFO and migratable, so at each tick we can check and try to push current away and give these tasks a chance of running(we don't do this for tasks queued with lower priority). Signed-off-by: Xunlei Pang --- kernel/sched/rt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 7b76747..ddd5b19 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2314,10 +2314,17 @@ static void task_tick_rt(struct rq *rq, struct task_struct *p, int queued) /* * RR tasks need a special form of timeslice management. - * FIFO tasks have no timeslices. + * FIFO tasks have no timeslices. But if p(current) is a + * FIFO task, try to push it away. */ - if (p->policy != SCHED_RR) + if (p->policy != SCHED_RR) { + if (p->nr_cpus_allowed > 1 && + rq->rt.rt_nr_running > 1 && + !test_tsk_need_resched(p)) + check_preempt_equal_prio_common(rq); + return; + } if (--p->rt.time_slice) return;