[Cbe-oss-dev] [PATCH 1/2]MARS/base: kernel scheduler block counter not updated

Yuji Mano yuji.mano at am.sony.com
Fri Feb 13 13:53:51 EST 2009


This fixes a bug in the kernel scheduler where the block counter was not being
properly incremented for each block with ready workloads, causing workloads to
be scheduled unfairly.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>
---
 base/src/mpu/kernel/kernel.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

--- a/base/src/mpu/kernel/kernel.c
+++ b/base/src/mpu/kernel/kernel.c
@@ -708,16 +708,17 @@ static int reserve_workload(void)
 		uint16_t block_counter = MARS_BITS_GET(bits, BLOCK_COUNTER);
 
 		/* block is ready so check scheduling conditions */
-		if (block_ready &&
-		    (block < 0 || block_priority > max_block_priority ||
-		    (block_priority == max_block_priority &&
-		     block_counter > max_block_counter))) {
-			block = i;
-			max_block_priority = block_priority;
-			max_block_counter = block_counter;
+		if (block_ready) {
+			if (block < 0 || block_priority > max_block_priority ||
+			    (block_priority == max_block_priority &&
+			     block_counter > max_block_counter)) {
+				block = i;
+				max_block_priority = block_priority;
+				max_block_counter = block_counter;
+			}
 
 			/* increment block counter */
-			update_header_bits_counter(block, 0);
+			update_header_bits_counter(i, 0);
 		}
 
 		/* block is waiting so check block */






More information about the cbe-oss-dev mailing list