From patchwork Thu Apr 30 16:33:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 47857 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 39E6820553 for ; Thu, 30 Apr 2015 17:05:38 +0000 (UTC) Received: by wiun10 with SMTP id n10sf6587908wiu.1 for ; Thu, 30 Apr 2015 10:05:37 -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=g40V/KatX/r0z7BAfTpNBsW1Bnm1EI8XbtC3+9TxAPU=; b=RR97yfztKInaqjSuRDGzMwLcAXZ2/CdZI7tMMe57IGmwTF4YiUdtHtyiyERx75W8RV 48o6gEHLrSmgm78vzCjhyCDmus4jdsGsBbioJ0pjjVjYEZoetmcHFRQ634u/eIr4djTi cbfSGQkFMgMec/Nv2JsnSToIHvjCqusMzO5DE7x2pA2EuwHvV7pbCEVqe9FCPE1MKexC 9udnZxhbjeuflT3kx3LGeFmrQnKtdKsQ1o5CcdxsvrX7Mlf0OF5wgRWp9ds2IDKIFDaF MNJDTGS1j7v0QiWfshTc39EeL8hduBNqTxgA797KNy8anZrfUkWhd5KqdC1mbMNJEg5S 3CLQ== X-Gm-Message-State: ALoCoQnheiQv5MzDf6+D5OT0H3gmiaav3PkQ7XkRk7VhXbmL/C0rROcv0JpaQS5E0clkZBPStKgE X-Received: by 10.112.151.146 with SMTP id uq18mr3088296lbb.20.1430413537421; Thu, 30 Apr 2015 10:05:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.98 with SMTP id ln2ls412396lac.61.gmail; Thu, 30 Apr 2015 10:05:37 -0700 (PDT) X-Received: by 10.112.180.201 with SMTP id dq9mr4872741lbc.78.1430413537234; Thu, 30 Apr 2015 10:05:37 -0700 (PDT) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com. [2a00:1450:4010:c04::230]) by mx.google.com with ESMTPS id i6si2159212laa.144.2015.04.30.10.05.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 10:05:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::230 as permitted sender) client-ip=2a00:1450:4010:c04::230; Received: by lbcga7 with SMTP id ga7so49626233lbc.1 for ; Thu, 30 Apr 2015 10:05:37 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr4668921lac.41.1430413536936; Thu, 30 Apr 2015 10:05:36 -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 l1csp3236832lbt; Thu, 30 Apr 2015 10:05:36 -0700 (PDT) X-Received: by 10.70.52.130 with SMTP id t2mr10095388pdo.34.1430413535206; Thu, 30 Apr 2015 10:05:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf5si4356972pbb.45.2015.04.30.10.05.33; Thu, 30 Apr 2015 10:05:35 -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 S1752479AbbD3RF3 (ORCPT + 28 others); Thu, 30 Apr 2015 13:05:29 -0400 Received: from m50-112.126.com ([123.125.50.112]:48006 "EHLO m50-112.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751252AbbD3RF0 (ORCPT ); Thu, 30 Apr 2015 13:05:26 -0400 X-Greylist: delayed 1866 seconds by postgrey-1.27 at vger.kernel.org; Thu, 30 Apr 2015 13:05:26 EDT Received: from vptest-PC.zte.com.cn (unknown [118.114.222.231]) by smtp6 (Coremail) with SMTP id j9KowAA3KO1PWUJVW+IHBQ--.69S4; Fri, 01 May 2015 00:33:31 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Steven Rostedt , Juri Lelli , Ingo Molnar , Xunlei Pang Subject: [PATCH 2/2] sched/rt: Optimizate task_woken_rt() Date: Fri, 1 May 2015 00:33:18 +0800 Message-Id: <1430411598-4904-2-git-send-email-xlpang@126.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1430411598-4904-1-git-send-email-xlpang@126.com> References: <1430411598-4904-1-git-send-email-xlpang@126.com> X-CM-TRANSID: j9KowAA3KO1PWUJVW+IHBQ--.69S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrtF48AF1kGFyDWF4kCw4xCrg_yoWDZwbE9w n2gr18Cw4jvryDt345Ga13KrykK39FqryrAa1qgrykArW0yrZxA395uFWUJrZ5ZFWfCFn3 Can2gF48Crn5WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8KsjUUUUUU== X-Originating-IP: [118.114.222.231] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbi7xvrv1UwxaIwXwAAsN 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:c04::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 - Remove "has_pushable_tasks(rq)" condition, because for queued p, "!task_running(rq, p)" and "p->nr_cpus_allowed > 1" implies true "has_pushable_tasks(rq)". - Remove "!test_tsk_need_resched(rq->curr)" condition, because the flag might be set right before the waking up, but we still need to push equal or lower priority tasks, it should be removed. Without this condition, we actually get the right logic. Signed-off-by: Xunlei Pang --- kernel/sched/rt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index a9d33a3..9d735da 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2233,8 +2233,6 @@ out: static void task_woken_rt(struct rq *rq, struct task_struct *p) { if (!task_running(rq, p) && - !test_tsk_need_resched(rq->curr) && - has_pushable_tasks(rq) && p->nr_cpus_allowed > 1 && (dl_task(rq->curr) || rt_task(rq->curr)) && (rq->curr->nr_cpus_allowed < 2 ||