Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756588Ab0DUU6V (ORCPT ); Wed, 21 Apr 2010 16:58:21 -0400 Received: from casper.infradead.org ([85.118.1.10]:57458 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754968Ab0DUU6U (ORCPT ); Wed, 21 Apr 2010 16:58:20 -0400 Subject: Re: Considerations on sched APIs under RT patch From: Peter Zijlstra To: Primiano Tucci Cc: rostedt@goodmis.org, linux-kernel@vger.kernel.org, tglx In-Reply-To: References: <1271755208.1676.422.camel@laptop> <1271804453.10448.168.camel@gandalf.stny.rr.com> <1271839772.1776.58.camel@laptop> <1271854016.10448.172.camel@gandalf.stny.rr.com> <1271879833.1776.186.camel@laptop> Content-Type: text/plain; charset="UTF-8" Date: Wed, 21 Apr 2010 22:58:16 +0200 Message-ID: <1271883496.1776.263.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2171 Lines: 52 On Wed, 2010-04-21 at 22:38 +0200, Primiano Tucci wrote: > > No, any syscall can end up blocking/scheduling there are no exceptions. > > But blocking doesn't mean its non-deterministic, esp. when coupled with > > things like PI. > > > > But you do have to treat system resources as such, that is they can (and > > will) create cross-cpu dependencies, if you do not take that into > > account you will of course be surprised. > > > I actually don't understand why do you recall PI so frequently, it > seems to be the unique point of interest. PI keeps preemptible locks working in a RT environment. Non-preemptible or preemptible+PI are both valid RT constructs that can be analyzed > Actually I take care about not sharing cross-cpu resources, but I > cannot take care of what the kernel should do. An SMP kernel must be treated as a cross-cpu resource. There's just no way around that. For instance, Unix allows two processes on different cpus to invoke sched_setscheduler/sched_setaffinity or any number of system calls on the same target process. Filesystems are shared etc.. > In my viewpoint is unacceptable that the scheduler apis can led into a > rescheduling. They can even lead to pagefaults and disk IO if you're not careful. I'm not sure if there are blocking locks left thereabout, but spinlocks or rt_mutex, both create cross-cpu dependencies that need to be analyzed, !preempt isn't magic in any way. > It voids any form of process control. > If I lose the control while controlling other processes, Quis > custodiet ipsos custodes? > > P.S. It actually does not happen in other RTOSes, e.g., VxWorks SMP I don't know any of those, but its impossible to migrate tasks from one cpu to another without creating cross-cpu dependencies. Whether locks are preemptible or not doesn't make them any less analyzable, if you use system-calls in your RT program, their implementation needs to be considered. -- 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/