4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
22 /* All Rights Reserved */
23
24
25 /*
26 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30 #include <sys/types.h>
31 #include <sys/t_lock.h>
32 #include <sys/param.h>
33 #include <sys/tuneable.h>
34 #include <sys/inline.h>
35 #include <sys/systm.h>
36 #include <sys/proc.h>
37 #include <sys/user.h>
38 #include <sys/var.h>
39 #include <sys/buf.h>
40 #include <sys/vfs.h>
41 #include <sys/cred.h>
42 #include <sys/kmem.h>
43 #include <sys/vnode.h>
44 #include <sys/swap.h>
45 #include <sys/vm.h>
46 #include <sys/debug.h>
47 #include <sys/cmn_err.h>
48 #include <sys/sysinfo.h>
49 #include <sys/callb.h>
50 #include <sys/reboot.h>
51 #include <sys/time.h>
52 #include <sys/fs/ufs_inode.h>
53 #include <sys/fs/ufs_bio.h>
54
55 #include <vm/hat.h>
56 #include <vm/page.h>
57 #include <vm/pvn.h>
58 #include <vm/seg_kmem.h>
59
60 int doiflush = 1; /* non-zero to turn inode flushing on */
61 int dopageflush = 1; /* non-zero to turn page flushing on */
62
63 /*
64 * To improve boot performance, don't run the inode flushing loop until
65 * the specified number of seconds after boot. To revert to the old
66 * behavior, set fsflush_iflush_delay to 0. We have not created any new
67 * filesystem danger that did not exist previously, since there is always a
68 * window in between when fsflush does the inode flush loop during which the
69 * system could crash, fail to sync the filesystem, and fsck will be needed
70 * to recover. We have, however, widened this window. Finally,
71 * we never delay inode flushing if we're booting into single user mode,
72 * where the administrator may be modifying files or using fsck. This
73 * modification avoids inode flushes during boot whose only purpose is to
74 * update atimes on files which have been accessed during boot.
75 */
76 int fsflush_iflush_delay = 60;
77
78 kcondvar_t fsflush_cv;
79 static kmutex_t fsflush_lock; /* just for the cv_wait */
80 ksema_t fsflush_sema; /* to serialize with reboot */
81
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
22 /* All Rights Reserved */
23
24 /*
25 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28 /*
29 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
30 */
31
32 #include <sys/types.h>
33 #include <sys/t_lock.h>
34 #include <sys/param.h>
35 #include <sys/tuneable.h>
36 #include <sys/inline.h>
37 #include <sys/systm.h>
38 #include <sys/proc.h>
39 #include <sys/user.h>
40 #include <sys/var.h>
41 #include <sys/buf.h>
42 #include <sys/vfs.h>
43 #include <sys/cred.h>
44 #include <sys/kmem.h>
45 #include <sys/vnode.h>
46 #include <sys/swap.h>
47 #include <sys/vm.h>
48 #include <sys/debug.h>
49 #include <sys/cmn_err.h>
50 #include <sys/sysinfo.h>
51 #include <sys/callb.h>
52 #include <sys/reboot.h>
53 #include <sys/time.h>
54 #include <sys/fs/ufs_inode.h>
55 #include <sys/fs/ufs_bio.h>
56
57 #include <vm/hat.h>
58 #include <vm/page.h>
59 #include <vm/pvn.h>
60 #include <vm/seg_kmem.h>
61
62 volatile int doiflush = 1; /* non-zero to turn inode flushing on */
63 volatile int dopageflush = 1; /* non-zero to turn page flushing on */
64
65 /*
66 * To improve boot performance, don't run the inode flushing loop until
67 * the specified number of seconds after boot. To revert to the old
68 * behavior, set fsflush_iflush_delay to 0. We have not created any new
69 * filesystem danger that did not exist previously, since there is always a
70 * window in between when fsflush does the inode flush loop during which the
71 * system could crash, fail to sync the filesystem, and fsck will be needed
72 * to recover. We have, however, widened this window. Finally,
73 * we never delay inode flushing if we're booting into single user mode,
74 * where the administrator may be modifying files or using fsck. This
75 * modification avoids inode flushes during boot whose only purpose is to
76 * update atimes on files which have been accessed during boot.
77 */
78 int fsflush_iflush_delay = 60;
79
80 kcondvar_t fsflush_cv;
81 static kmutex_t fsflush_lock; /* just for the cv_wait */
82 ksema_t fsflush_sema; /* to serialize with reboot */
83
|