From 644a177521a390133c98b9de83934a25e2be4f67 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Fri, 11 Jan 2013 23:49:23 +0100 Subject: kern/thread: improve processor-local scheduling This change introduces scheduling classes, including support for real-time and time-sharing threads. The real-time class matches the requirements of the POSIX SCHED_FIFO and SCHED_RR policies. The time-sharing class makes use of a scheduling algorithm based on group ratio round-robin (GR3) to provide proportional fairness. --- kern/macros.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kern/macros.h') diff --git a/kern/macros.h b/kern/macros.h index 012dd15b..8e04d72b 100644 --- a/kern/macros.h +++ b/kern/macros.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010 Richard Braun. + * Copyright (c) 2009, 2010, 2013 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,6 +44,8 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define DIV_CEIL(n, d) (((n) + (d) - 1) / (d)) + #define P2ALIGNED(x, a) (((x) & ((a) - 1)) == 0) #define ISP2(x) P2ALIGNED(x, x) #define P2ALIGN(x, a) ((x) & -(a)) -- cgit v1.2.3