annotate usr/src/uts/intel/zfs/spa_boot.c @ 13869:921a99998bb4

3246 ZFS I/O deadman thread Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com> Reviewed by: Eric Schrock <eric.schrock@delphix.com> Reviewed by: Christopher Siden <chris.siden@delphix.com> Approved by: Garrett D'Amore <garrett@damore.org>
author George.Wilson <george.wilson@delphix.com>
date Mon, 29 Oct 2012 12:08:09 -0500
parents e2081f502306
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
1 /*
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
2 * CDDL HEADER START
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
3 *
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
4 * The contents of this file are subject to the terms of the
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
5 * Common Development and Distribution License (the "License").
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
6 * You may not use this file except in compliance with the License.
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
7 *
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
9 * or http://www.opensolaris.org/os/licensing.
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
10 * See the License for the specific language governing permissions
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
11 * and limitations under the License.
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
12 *
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
13 * When distributing Covered Code, include this CDDL HEADER in each
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
15 * If applicable, add the following below this CDDL HEADER, with the
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
16 * fields enclosed by brackets "[]" replaced with your own identifying
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
17 * information: Portions Copyright [yyyy] [name of copyright owner]
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
18 *
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
19 * CDDL HEADER END
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
20 */
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
21
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
22 /*
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 7147
diff changeset
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
24 * Use is subject to license terms.
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
25 */
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
26
13869
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
27 /*
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
28 * Copyright (c) 2012 by Delphix. All rights reserved.
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
29 */
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
30
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 7147
diff changeset
31 #include <sys/zio.h>
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
32 #include <sys/spa.h>
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
33 #include <sys/sunddi.h>
13869
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
34 #include <sys/x86_archext.h>
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
35
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
36 extern int zfs_deadman_enabled;
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
37
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
38 char *
7147
1e1d75c88283 6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents: 6423
diff changeset
39 spa_get_bootprop(char *propname)
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
40 {
7147
1e1d75c88283 6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents: 6423
diff changeset
41 char *value;
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
42
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
43 if (ddi_prop_lookup_string(DDI_DEV_T_ANY, ddi_root_node(),
7147
1e1d75c88283 6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents: 6423
diff changeset
44 DDI_PROP_DONTPASS, propname, &value) != DDI_SUCCESS)
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
45 return (NULL);
7147
1e1d75c88283 6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents: 6423
diff changeset
46 return (value);
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
47 }
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
48
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
49 void
7147
1e1d75c88283 6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents: 6423
diff changeset
50 spa_free_bootprop(char *value)
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
51 {
7147
1e1d75c88283 6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents: 6423
diff changeset
52 ddi_prop_free(value);
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents:
diff changeset
53 }
13869
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
54
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
55 void
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
56 spa_arch_init(void)
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
57 {
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
58 /*
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
59 * Configure the default settings for the zfs deadman unless
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
60 * overriden by /etc/system.
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
61 */
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
62 if (zfs_deadman_enabled == -1) {
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
63 /*
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
64 * Disable the zfs deadman logic on VMware deployments.
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
65 */
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
66 if (get_hwenv() == HW_VMWARE)
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
67 zfs_deadman_enabled = 0;
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
68 else
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
69 zfs_deadman_enabled = 1;
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
70 }
921a99998bb4 3246 ZFS I/O deadman thread
George.Wilson <george.wilson@delphix.com>
parents: 10922
diff changeset
71 }