Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752019AbbBMFFG (ORCPT ); Fri, 13 Feb 2015 00:05:06 -0500 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.229]:53282 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751786AbbBMFFA (ORCPT ); Fri, 13 Feb 2015 00:05:00 -0500 Date: Fri, 13 Feb 2015 00:05:41 -0500 From: Steven Rostedt To: Xunlei Pang Cc: lkml , Peter Zijlstra , Juri Lelli Subject: Re: [PATCH v3 2/2] sched/rt: Add check_preempt_equal_prio() logic in pick_next_task_rt() Message-ID: <20150213000541.33d27b8f@grimm.local.home> In-Reply-To: References: <1423410686-1928-1-git-send-email-pang.xunlei@linaro.org> <1423410686-1928-2-git-send-email-pang.xunlei@linaro.org> <20150212190438.374b8cf2@gandalf.local.home> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.142:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1882 Lines: 42 On Fri, 13 Feb 2015 11:55:11 +0800 Xunlei Pang wrote: > > RT1 just got pushed behind RT3 and it is now not the next one to run. > > RT2 will get this rq, RT3 will be pushed off, but say there's no more > > rq's available to run RT1. > > > > You just broke FIFO. > > Yes, I've also thought of this point before. > > If this is a problem, we may have the same thing happening in > current check_preempt_equal_prio() code: > When a pinned waking task preempts the current successfully, > because it thinks current is migratable via cpupri_find(). > > But when resched happens, things may change, i.e. current > becomes non-migratable, so the waking task gets running, while > the previous running task gets stuck. See, it also broke FIFO. It breaks FIFO if the state of the system changes before the current task found another queue to run on, sure, and that probably should be fixed. And technically, that case does not break FIFO from a state point of view. Think of the timing, if that task was able to migrate to another CPU, but suddenly it could not, that means the CPU it was going to migrate to had a higher priority task that started to run on that CPU. It still fits the FIFO design. That's because if that task succeeded to migrate to that CPU, just before the high priority task ran, that high priority task would have bumped it anyway. Now if it couldn't migrate because a same priority task started, then, well yeah, it broke FIFO, and maybe that should be fixed. But your patch breaks FIFO if the system is in just one particular state. That's much worse, and it shouldn't be added. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/