summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Harres <John.Harres@Sun.COM>2008-12-12 12:58:29 -0700
committerJohn Harres <John.Harres@Sun.COM>2008-12-12 12:58:29 -0700
commitf88604082ab7f434d64d4a9b92fdfe651e053a11 (patch)
tree4806ce7de9bb58ef2f075ea53de8eaa326b117bf
parent0b3b1319eb92d263a81849aef6cb9f10ea889c84 (diff)
downloadillumos-gate-f88604082ab7f434d64d4a9b92fdfe651e053a11.tar.gz
6461872 core_seg() causes performance problems when hires_tick=1
-rw-r--r--usr/src/uts/common/os/core.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/usr/src/uts/common/os/core.c b/usr/src/uts/common/os/core.c
index 71af0012d4..ece9d8f0eb 100644
--- a/usr/src/uts/common/os/core.c
+++ b/usr/src/uts/common/os/core.c
@@ -20,15 +20,13 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/param.h>
#include <sys/types.h>
#include <sys/time.h>
@@ -64,6 +62,7 @@
#include <sys/stat.h>
#include <sys/zone.h>
#include <sys/contract/process_impl.h>
+#include <sys/ddi.h>
/*
* Processes running within a zone potentially dump core in 3 locations,
@@ -723,7 +722,7 @@ core(int sig, int ext)
if (rp != NULL) {
fp_process = kmem_alloc(MAXPATHLEN, KM_SLEEP);
error1 = expand_string(refstr_value(rp),
- fp_process, MAXPATHLEN, p->p_cred);
+ fp_process, MAXPATHLEN, p->p_cred);
if (error1 == 0)
error1 = do_core(fp_process, sig, CORE_PROC,
my_cg);
@@ -771,6 +770,12 @@ core(int sig, int ext)
uint_t core_chunk = 32;
/*
+ * The delay between core_write() calls, in microseconds. The default
+ * matches one "normal" clock tick, or 10 milliseconds.
+ */
+clock_t core_delay_usec = 10000;
+
+/*
* Common code to core dump process memory. The core_seg routine does i/o
* using core_write() below, and so it has the same failure semantics.
*/
@@ -794,7 +799,7 @@ core_seg(proc_t *p, vnode_t *vp, offset_t offset, caddr_t addr, size_t size,
* single write and cause pageout to stop running.
*/
if (len > (size_t)core_chunk * PAGESIZE)
- len = (size_t)core_chunk * PAGESIZE;
+ len = (size_t)core_chunk * PAGESIZE;
err = core_write(vp, UIO_USERSPACE,
offset + (size_t)(base - addr), base, len, rlimit, credp);
@@ -804,7 +809,7 @@ core_seg(proc_t *p, vnode_t *vp, offset_t offset, caddr_t addr, size_t size,
* Give pageout a chance to run.
* Also allow core dumping to be interruptible.
*/
- err = delay_sig(1);
+ err = delay_sig(drv_usectohz(core_delay_usec));
}
if (err)
return (err);