2.3.51: this doesn't look right

From: Dimitris Michailidis (dimitris@cthulhu.engr.sgi.com)
Date: Sat Mar 11 2000 - 21:22:58 EST


The following was added to exit.c in 2.3.51:

+ /*
+ * Potentially available timeslices are retrieved
+ * here - this way the parent does not get penalized
+ * for creating too many processes.
+ *
+ * (this cannot be used to artificially 'generate'
+ * timeslices, because any timeslice recovered here
+ * was given away by the parent in the first place.)
+ */
+ current->counter += p->counter;
+ if (current->counter > current->priority)
+ current->counter = current->priority;

Because of counter recalculation current->counter may be > current->priority
before the above is executed. In this case not only does the parent not get
any of the child's ticks, it loses some of its own. This tick reclamation
looks questionable if the parent's counter has been renewed since the fork().
In that case, contrary to the comment, the above can be used to artificially
'generate' timeslices.

-- 
Dimitris Michailidis                    dimitris@engr.sgi.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:20 EST