diff options
Diffstat (limited to 'usr/src/uts')
| -rw-r--r-- | usr/src/uts/common/os/callout.c | 8 | ||||
| -rw-r--r-- | usr/src/uts/common/os/kmem.c | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/usr/src/uts/common/os/callout.c b/usr/src/uts/common/os/callout.c index 23de83c0ca..6c2fbd071e 100644 --- a/usr/src/uts/common/os/callout.c +++ b/usr/src/uts/common/os/callout.c @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <sys/callo.h> @@ -37,6 +36,8 @@ #include <sys/sysmacros.h> #include <sys/sdt.h> +int callout_init_done; /* useful during boot */ + /* * Callout tables. See timeout(9F) for details. */ @@ -2190,4 +2191,7 @@ callout_init(void) callout_boot_ct = &callout_table[CALLOUT_TABLE(0, CPU->cpu_seqid)]; callout_cpu_online(CPU); mutex_exit(&cpu_lock); + + /* heads-up to boot-time clients that timeouts now available */ + callout_init_done = 1; } diff --git a/usr/src/uts/common/os/kmem.c b/usr/src/uts/common/os/kmem.c index c9f7313f56..56b67b3147 100644 --- a/usr/src/uts/common/os/kmem.c +++ b/usr/src/uts/common/os/kmem.c @@ -832,6 +832,7 @@ extern void streams_msg_init(void); extern int segkp_fromheap; extern void segkp_cache_free(void); +extern int callout_init_done; struct kmem_cache_kstat { kstat_named_t kmc_buf_size; @@ -3124,7 +3125,12 @@ kmem_reap_timeout(void *flag_arg) static void kmem_reap_done(void *flag) { - (void) timeout(kmem_reap_timeout, flag, kmem_reap_interval); + if (!callout_init_done) { + /* can't schedule a timeout at this point */ + kmem_reap_timeout(flag); + } else { + (void) timeout(kmem_reap_timeout, flag, kmem_reap_interval); + } } static void |
