Re: [PATCH] sched: Add SCHED_BGND (background) scheduling policy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Con Kolivas wrote:
some quick comments within code below.

On Wednesday 05 July 2006 09:35, Peter Williams wrote:
@@ -761,8 +770,18 @@ static void set_load_weight(struct task_
 		else
 #endif
 			p->load_weight = RTPRIO_TO_LOAD_WEIGHT(p->rt_priority);
-	} else
-		p->load_weight = PRIO_TO_LOAD_WEIGHT(p->static_prio);
+	} else {
+		/*
+		 * Reduce the probability of a task escaping the background
+		 * due to load balancing leaving it on a lighly used CPU
+		 * Can't use zero as that would kill load balancing when only
+		 * background tasks are running.
+		 */
+		if (bgnd_task(p))
+			p->load_weight = LOAD_WEIGHT(MIN_TIMESLICE / 2 ? : 1);

Why not just set it to 1 for all idleprio tasks? The granularity will be lost at anything lower anyway and it avoids a more complex calculation.

I missed this one in my previous reply. I agree, what you say makes sense. I was in my "think too hard" mode and probably thinking (unnecessarily) about how it might effect the smoothed load calculations.

Peter
--
Peter Williams                                   [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
 -- Ambrose Bierce
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux