From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754600AbbBOEXM (ORCPT ); Sat, 14 Feb 2015 23:23:12 -0500 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.229]:49061 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754451AbbBOEXK (ORCPT ); Sat, 14 Feb 2015 23:23:10 -0500 Date: Sat, 14 Feb 2015 23:23:50 -0500 From: Steven Rostedt To: pang.xunlei@zte.com.cn Cc: Juri Lelli , lkml , linux-kernel-owner@vger.kernel.org, Xunlei Pang , Peter Zijlstra Subject: Re: [PATCH v3 2/2] sched/rt: Add check_preempt_equal_prio() logic in pick_next_task_rt() Message-ID: <20150214232350.42b8eeae@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> <20150213000541.33d27b8f@grimm.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 On Sun, 15 Feb 2015 10:54:25 +0800 pang.xunlei@zte.com.cn wrote: > I think this can also happen for check_preempt_equal_prio(): > When RT1(current task) gets preempted by RT2, if there is a > migratable RT3 with same prio, RT3 will be pushed away instead > of RT1 afterwards, because RT1 will be enqueued to the tail of > the pushable list via succeeding put_prev_task_rt() triggered > by resched. > > There seems some trouble involved in rt equal prio cases. Hmm, you may be right, and that should be fixed. If a task is running and gets preempted by a higher priority task (or even of same priority for migrating), then it should stay at the front of the queue to be migrated. It should only be placed after other FIFO tasks of the same priority if that task calls schedule() directly (not preempted). SMP always cracks a few rotten eggs in the RT omelet. -- Steve