summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 18:14:02 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 18:14:02 -0800
commit236e6127ad942fa9712f83a2d441e0ba7c3fc190 (patch)
treec57f86b605bcd3b1c08d28a8de945cca83e4152b /kernel/fork.c
parent7216d3e927c3b6c5d28e5ffaa54afbb34649debb (diff)
v2.4.4 -> v2.4.4.1
- Al Viro: clean up driver "invalidate_device()" mess - Andries Brouwer: make sd.c work with USB Dane-Elec CompactFlash Card Reader - me: fix nasty lazy kernel page table update problem - me: undo fork changes. Too many user-level bugs and unresolved issues. - Peter Anvin: iso9660 cleanups - Alan Cox: big merge - Johannes Erdfelt: UHCI pci DMA setup fix
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 74b3ee7ca8cd..feed49eb35bc 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -666,17 +666,15 @@ int do_fork(unsigned long clone_flags, unsigned long stack_start,
p->pdeath_signal = 0;
/*
- * Give the parent's dynamic priority entirely to the child. The
- * total amount of dynamic priorities in the system doesn't change
- * (more scheduling fairness), but the child will run first, which
- * is especially useful in avoiding a lot of copy-on-write faults
- * if the child for a fork() just wants to do a few simple things
- * and then exec(). This is only important in the first timeslice.
- * In the long run, the scheduling behavior is unchanged.
+ * "share" dynamic priority between parent and child, thus the
+ * total amount of dynamic priorities in the system doesnt change,
+ * more scheduling fairness. This is only important in the first
+ * timeslice, on the long run the scheduling behaviour is unchanged.
*/
- p->counter = current->counter;
- current->counter = 0;
- current->need_resched = 1;
+ p->counter = (current->counter + 1) >> 1;
+ current->counter >>= 1;
+ if (!current->counter)
+ current->need_resched = 1;
/*
* Ok, add it to the run-queues and make it