aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/imgact_aout.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2001-09-08 20:02:33 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2001-09-08 20:02:33 +0000
commit06ae1e91c46630214235d443b72925cc295a9bc1 (patch)
tree5f36b4fb47a0f9f3d486afb708c5f95a6d1f5472 /sys/kern/imgact_aout.c
parent5002a60f9bc2499187cf64bc5ed603a3c157c459 (diff)
downloadsrc-06ae1e91c46630214235d443b72925cc295a9bc1.tar.gz
src-06ae1e91c46630214235d443b72925cc295a9bc1.zip
This brings in a Yahoo coredump patch from Paul, with additional mods by
me (addition of vn_rdwr_inchunks). The problem Yahoo is solving is that if you have large process images core dumping, or you have a large number of forked processes all core dumping at the same time, the original coredump code would leave the vnode locked throughout. This can cause the directory vnode to get locked up, which can cause the parent directory vnode to get locked up, and so on all the way to the root node, locking the entire machine up for extremely long periods of time. This patch solves the problem in two ways. First it uses an advisory non-blocking lock to abort multiple processes trying to core to the same file. Second (my contribution) it chunks up the writes and uses bwillwrite() to avoid holding the vnode locked while blocking in the buffer cache. Submitted by: ps Reviewed by: dillon MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=83222
Diffstat (limited to 'sys/kern/imgact_aout.c')
-rw-r--r--sys/kern/imgact_aout.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 9994ad558bcd..9aa8b3d7a7cb 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -264,15 +264,15 @@ aout_coredump(p, vp, limit)
fill_kinfo_proc(p, &p->p_addr->u_kproc);
error = cpu_coredump(p, vp, cred);
if (error == 0)
- error = vn_rdwr(UIO_WRITE, vp, vm->vm_daddr,
+ error = vn_rdwr_inchunks(UIO_WRITE, vp, vm->vm_daddr,
(int)ctob(vm->vm_dsize), (off_t)ctob(UPAGES), UIO_USERSPACE,
- IO_NODELOCKED|IO_UNIT, cred, (int *) NULL, p);
+ IO_UNIT, cred, (int *) NULL, p);
if (error == 0)
- error = vn_rdwr(UIO_WRITE, vp,
+ error = vn_rdwr_inchunks(UIO_WRITE, vp,
(caddr_t) trunc_page(USRSTACK - ctob(vm->vm_ssize)),
round_page(ctob(vm->vm_ssize)),
(off_t)ctob(UPAGES) + ctob(vm->vm_dsize), UIO_USERSPACE,
- IO_NODELOCKED|IO_UNIT, cred, (int *) NULL, p);
+ IO_UNIT, cred, (int *) NULL, p);
return (error);
}