[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
interactive performance patch from NetBSD
Hi,
I found that the following patch (From NetBSD by Ross Harvey and Bill
Sommerfeld) greatly improve interactive performance (while compiling
the whole system under X11 for instance) on OpenBSD too.
I think this solves all the 'sluggish mouse' problems that were
reported.
This was discussed on NetBSD's tech-kern mailing list last january
in the 'sucky performance' thread
(archived at <http://mail-index.netbsd.org/tech-kern/1999/01/>). Since
it was a significant update on my NetBSD machine, I wanted to try it
on OpenBSD for a long time. Ross has recently made it easier by
sending a patch against NetBSD 1.3 source. I merged it into
OpenBSD-current, and it works for me.
Index: kern_exit.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_exit.c,v
retrieving revision 1.16
diff -u -u -r1.16 kern_exit.c
--- kern_exit.c 1999/03/02 22:19:09 1.16
+++ kern_exit.c 1999/03/12 07:52:32
@@ -368,6 +368,11 @@
wakeup((caddr_t)t);
return (0);
}
+
+ /* Charge us for our child's sins */
+ curproc->p_estcpu = min(curproc->p_estcpu +
+ p->p_estcpu, UCHAR_MAX);
+
p->p_xstat = 0;
ruadd(&q->p_stats->p_cru, p->p_ru);
FREE(p->p_ru, M_ZOMBIE);
Index: kern_fork.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_fork.c,v
retrieving revision 1.19
diff -u -u -r1.19 kern_fork.c
--- kern_fork.c 1999/03/02 22:19:08 1.19
+++ kern_fork.c 1999/03/12 07:52:32
@@ -297,6 +297,13 @@
}
#endif
+ /*
+ * set priority of child to be that of parent
+ * XXX should move p_estcpu into the region of struct proc which gets
+ * copied.
+ */
+ p2->p_estcpu = p1->p_estcpu;
+
/*
* This begins the section where we must prevent the parent
* from being swapped.
Matthieu