diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-04-19 10:13:23 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-04-19 10:13:23 +0000 |
commit | ec31790625fc52095efcb5eb3a4b8feb4a017cd6 (patch) | |
tree | 54a4622e61a30faf688ad19108fab8b07e17e358 /sys/kern | |
parent | 1eb85a579a0d9030c50d66f0327dee8387ccf303 (diff) |
When logging genio, check if we need to yield in the same way as in uiomove.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_ktrace.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index f328f16eb9b..f9c4ea277ab 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_ktrace.c,v 1.15 2000/04/19 08:35:37 art Exp $ */ +/* $OpenBSD: kern_ktrace.c,v 1.16 2000/04/19 10:13:22 art Exp $ */ /* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */ /* @@ -194,6 +194,12 @@ ktrgenio(vp, fd, rw, iov, len, error) buflen -= sizeof(struct ktr_genio); while (resid > 0) { + /* + * Don't allow this process to hog the cpu when doing + * huge I/O. + */ + if (p->p_schedflags & PSCHED_SHOULDYIELD) + preempt(NULL); cnt = min(iov->iov_len, buflen); if (copyin(iov->iov_base, cp, cnt)) goto done; |