aboutsummaryrefslogtreecommitdiffstats
path: root/schedcat/sched/edf/gfb.py
blob: 6ee4367ad9c07d6adfc510f836dd27752c8fa5c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
from __future__ import division

# The G-EDF density test.
def is_schedulable(no_cpus, tasks):
    """Is the system schedulable according to the GFB test?
    Also known as the "density test."
    """
    if not tasks:
        return True
    dmax  = max([t.density() for t in tasks])
    bound = no_cpus - (no_cpus - 1) * dmax
    return tasks.density() <= bound