Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758261Ab0HDFza (ORCPT ); Wed, 4 Aug 2010 01:55:30 -0400 Received: from fafnir.cs.unc.edu ([152.2.129.90]:56194 "EHLO fafnir.cs.unc.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755976Ab0HDFz3 convert rfc822-to-8bit (ORCPT ); Wed, 4 Aug 2010 01:55:29 -0400 References: <1278682707.6083.227.camel@Palantir> <1278685800.1900.212.camel@laptop> <1278786710.1998.63.camel@laptop> Message-Id: <42DEF92D-9AF0-46AA-B8D2-777FE4116C44@cs.unc.edu> From: Bjoern Brandenburg To: Harald Gustafsson In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Mailer: iPad Mail (7B405) Mime-Version: 1.0 (iPad Mail 7B405) Subject: Re: periods and deadlines in SCHED_DEADLINE Date: Wed, 4 Aug 2010 01:55:55 -0400 Cc: Bjoern Brandenburg , Peter Zijlstra , Raistlin , linux-kernel , Song Yuan , Dmitry Adamushko , Thomas Gleixner , Nicola Manica , Luca Abeni , Claudio Scordino , Harald Gustafsson , "bastoni@cs.unc.edu" , Giuseppe Lipari Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4489 Lines: 58 On Jul 12, 2010, at 6:21 AM, Harald Gustafsson wrote: > 2010/7/11 Bjoern Brandenburg : >> Trying to infer whether a task is "hard" or "soft" from task parameters is not a good idea, IMO. It's much better to make this an explicit part of the task model that is configured via sched_setparam. By default, tasks should be marked "soft" (this leaves more wiggle room to the kernel); users who care can change the flag to "hard". > > Yes, this was along the lines of my suggestions also. > >> Taking a step back, I think the problem here is that we are trying to shove too many concepts and properties into a single scheduler. Hard (no tardiness) is different from soft (bounded tardiness) is different from global is different from partitioned. >> >> From my point of view, it makes no sense to support hard deadlines under G-EDF (this is backed up by our schedulability studies [1]). Hard deadlines are best served by a P-EDF implementation (that only migrates on task creation/admission). >> >> Also, it makes little sense to worry about supporting both hard and soft in a P-EDF implementation. Just schedule everything by its deadline and both hard and soft tasks will be fine (if the admissions test was passed). >> >> In my opinion, it is much more useful to have a two-level scheduling framework: a truly partitioned EDF implementation at the top level to support "hard" tasks, and a truly global EDF implementation at the second level for "soft" tasks, with the property that the second level implementation is only invoked if the first level is idle. This nicely matches Linux's scheduling class hierarchy. > > Would this prevent soft RT tasks to be pinned to a specific CPU, i.e. > have an affinity set of one CPU? I'm asking since we would like to use > soft deadline RT (bounded tardiness, e.g. with relative deadlines > short than periods), but with threads set to run on a specific CPU. > This is due to that we do an analysis on data dependencies etc in user > space applications (or offline) and distribute jobs among threads on > each CPU. At the same time we would like the isolation between > parallel running such applications and other CPU activities. I think this is asking the wrong question. In the context of a global scheduler, it doesn't make sense to pin threads to individual CPUs. However, nobody is forcing you to use a global scheduler—just use partitioned EDF for your soft tasks, too, and you get bounded tardiness (the bound happens to be zero for implicit-deadline tasks). The appeal of using a global scheduler at all is that some workloads have bounded tardiness under global scheduling but not under partitioned scheduling, but the reverse is not true. > > I'm not saying that all soft RT needs to be pinned or that some such > tasks can't be made to meet hard admission control but we would need > the possibility. If I would need to priorities between soft deadline > RT and CPU affinity, soft deadline RT would win, since it is still > quite likely that the tasks get scheduled on individual cores when > needed. > > When you say truly global EDF implementation does that mean the > scheduler only considers relative deadline and may "migrate" a thread > among all the CPUs at each scheduling instance, disregarding cache > effects, power management (e.g. waking an idle core), etc? Global EDF does not consider cache affinity (but a reasonable implementation will avoid needless migrations). Applications that require string cache affinity are better served by partitioned schedulers if it is possible to partition the workload. Power management is likely an area that will require some additional thought. However, at ECRTS, Thomas was strongly advocating race-to-idle, and this is what G-EDF does anyway: use all cores to get everything out of the way, asap. > Or can > these things be factored into the relative deadlines (maybe they > already are by the user)? I'm not sure what you mean by that. Relative deadlines represent an application's timeliness requirements and nothing else. I guess the user could tweak parameters to force certain scheduling decisions, but I wouldn't recommend to encourage that in the kernel API. - Björn > -- 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/