• No se han encontrado resultados

AUDITORIA A COMPAÑÍA ANÓNIMA MORETRAN CON REQUISITOS DE NORMA ISO/DIS 9001:

There are two fundamental classes of multiprocessor schedulers: globalandpartitioned. Under global scheduling (illustrated in inset (a) of Figure 1.1), all processors serve a single ready queue and jobs may migrate among processors. In contrast, underpartitionedscheduling (illustrated in inset (b) of Figure 1.1), tasks are statically assigned to processors during an offline phase and each processor is scheduled individually using a uniprocessor policy such asEDForFP.

There is a clear analytical answer to Question Q1: some global schedulers areprovably superior

to any partitioned approach. This is because partitioned scheduling requires tasks to be statically assigned to processors such that no processor is overloaded, which is equivalent to solving a bin- packing problem. As even an optimal packing may leave some bins incompletely filled (i.e., some processors partially idle), there exist task sets with total utilization at mostm+12 +that cannot be

partitioned ontomprocessors (Oh and Baker, 1998; Anderssonet al., 2001; Andersson and Jonsson, 2003), whereis an arbitrary small positive number. In other words, nearly up to half of the available processor capacity may be lost to the algorithmic limitations of partitioned scheduling.

In contrast, optimal global schedulers exist. For example, considerglobalEDF (G-EDF), where the uniprocessorEDFpolicy is globally applied to a shared ready queue. While it has long been known thatG-EDFcan be subject to severe algorithmic capacity loss in an HRT context (Dhall and Liu, 1978), Devi and Anderson (2005) recently showed thatG-EDFdoes in fact ensure bounded tardiness for any sporadic task set with utilization at mostm,i.e., G-EDFis optimal in an SRT context (Devi, 2006; Devi and Anderson, 2008).

For HRT constraints, the global algorithmPD2 is optimal (Srinivasan and Anderson, 2006). PD2is aproportionate fair(Baruahet al., 1996), orpfair, scheduler, which is a class of schedulers that ensure that a task’s processor allocation is always proportional to its utilization (within stringent bounds, see Chapter 2).PD2derives its properties from dividing jobs into (many) subtasks of fixed

size, each of which is assigned an individual deadline. Subtasks are scheduled on anEDFbasis with additional rules to break deadline ties.3With an appropriate subtask granularity,PD2 ensures that all

deadlines will be met for any task set with utilization at mostm(assuming implicit deadlines). Therefore,in theory, global scheduling is clearly preferable to partitioned scheduling.

However,in practice, global schedulers are commonly eschewed. Many OS developers consider global scheduling to be impractical due to the associated runtime overheads and implementation complexity. For example,PD2’s subtask-based scheduling causes jobs to incur frequent preemptions and migrations. While the scheduling literature generally considers such costs to be negligible, the associated loss of cache affinity4can significantly increase a job’s processor demand in practice by

introducing additional cache misses. Preemptions occur less frequently underG-EDF. However, processors must still access a shared ready queue, which OS developers traditionally avoid because frequent accesses to global data structures often entail high lock contention and cache-coherency overheads. Consequently, virtually all multiprocessor-capable RTOSs employ partitioned scheduling, where most data structures and scheduling decisions are processor-local and thus cache-friendly.

3The namePD2

is due to its use of two tie-breaking rules and since it supersedes an earlier algorithm namedPDby Baruahet al. (1995). AlgorithmPDderives its name from the use of “pseudo-deadlines” (Baruahet al., 1995).

4

Of course, it would be unrealistic to expect global algorithms to scale to tens or hundreds of processors. However, this does not imply that the other extreme, partitioned scheduling, is the best choice. Instead,clustered scheduling(Calandrinoet al., 2007; Baker and Baruah, 2007) could be a practical, better-performing compromise. Illustrated in inset (c) of Figure 1.1, clustered scheduling is a hybrid of both global and partitioned scheduling that groups processors sharing low-level caches into disjointclusters. As under partitioning, tasks are statically assigned to clusters during an offline phase. Within each cluster, jobs are then scheduled “globally” from a shared per-cluster ready queue. The intuition behind clustered scheduling is to reconcile the advantages of both partitioned and global scheduling: the impact of bin-packing issues is reduced as there are fewer and larger bins (compared to partitioned scheduling), some level of cache affinity is maintained during job migrations, and lock contention is reduced as queues are shared among fewer processors (compared to global scheduling).

Nonetheless, most multiprocessor-capable RTOSs currently rely onpartitioned fixed-priority

(P-FP) scheduling as the primary supported real-time scheduling policy. This choice reflects great conservatism: even among partitioned schedulers,P-FPis inferior topartitioned earliest-deadline first(P-EDF) scheduling sinceEDFis optimal on a uniprocessor andFPis not (Liu and Layland, 1973). YetP-FPhas remained thetraditionalRTOS scheduler due to its uniprocessor legacy and the previously mentioned POSIX-compliance reasons.

Compliance with the POSIX real-time standard (IEEE, 1993, 2003, 2008b), however, should not prevent needed innovation and adaptation. The standard is in fact silent on multiprocessor issues,5and understandably so, as multiprocessor real-time systems were still an “academic curiosity”

when it was first ratified. It further does not preclude RTOSs from supporting other, possibly better- performing scheduling policies in addition to the mandatedFP. With the advent of the multicore age, and given that RTOSs are now being redesigned and restructured to adapt, it is presently an opportune time to revisit the choice of a “default” RTOS scheduler.

5

The preamble to the original POSIX real-time extension makes this explicit: “It is beyond the scope of these interfaces to support networking or multiprocessor functionality” (IEEE, 1993, p. 2). The original document has since been superseded by the “real-time and embedded application profiles” (IEEE, 2003), which define use-case-specific subsets of the (much larger) POSIX “base profile” (IEEE, 2008b). The former does mention multiprocessors, but only in the context of the absence of memory barriers and spinlocks (IEEE, 2003, p. 49). The latter does not discuss multiprocessor scheduling, but does mandateFPscheduling with at least 32 distinct priorities for OSs that support scheduling at all (IEEE, 2008b, pp. 501–505).