git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'zil-performance'
[zfs.git]
/
module
/
zfs
/
vdev.c
diff --git
a/module/zfs/vdev.c
b/module/zfs/vdev.c
index
0c8ce1b
..
7d6d527
100644
(file)
--- a/
module/zfs/vdev.c
+++ b/
module/zfs/vdev.c
@@
-22,7
+22,7
@@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 201
1
by Delphix. All rights reserved.
+ * Copyright (c) 201
2
by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
*/
#include <sys/zfs_context.h>
@@
-109,7
+109,7
@@
vdev_get_min_asize(vdev_t *vd)
vdev_t *pvd = vd->vdev_parent;
/*
vdev_t *pvd = vd->vdev_parent;
/*
- *
The
our parent is NULL (inactive spare or cache) or is the root,
+ *
If
our parent is NULL (inactive spare or cache) or is the root,
* just return our own asize.
*/
if (pvd == NULL)
* just return our own asize.
*/
if (pvd == NULL)
@@
-195,7
+195,7
@@
vdev_add_child(vdev_t *pvd, vdev_t *cvd)
pvd->vdev_children = MAX(pvd->vdev_children, id + 1);
newsize = pvd->vdev_children * sizeof (vdev_t *);
pvd->vdev_children = MAX(pvd->vdev_children, id + 1);
newsize = pvd->vdev_children * sizeof (vdev_t *);
- newchild = kmem_zalloc(newsize, KM_
SLEEP
);
+ newchild = kmem_zalloc(newsize, KM_
PUSHPAGE
);
if (pvd->vdev_child != NULL) {
bcopy(pvd->vdev_child, newchild, oldsize);
kmem_free(pvd->vdev_child, oldsize);
if (pvd->vdev_child != NULL) {
bcopy(pvd->vdev_child, newchild, oldsize);
kmem_free(pvd->vdev_child, oldsize);
@@
-265,7
+265,7
@@
vdev_compact_children(vdev_t *pvd)
if (pvd->vdev_child[c])
newc++;
if (pvd->vdev_child[c])
newc++;
- newchild = kmem_alloc(newc * sizeof (vdev_t *), KM_
SLEEP
);
+ newchild = kmem_alloc(newc * sizeof (vdev_t *), KM_
PUSHPAGE
);
for (c = newc = 0; c < oldc; c++) {
if ((cvd = pvd->vdev_child[c]) != NULL) {
for (c = newc = 0; c < oldc; c++) {
if ((cvd = pvd->vdev_child[c]) != NULL) {
@@
-288,7
+288,7
@@
vdev_alloc_common(spa_t *spa, uint_t id, uint64_t guid, vdev_ops_t *ops)
vdev_t *vd;
int t;
vdev_t *vd;
int t;
- vd = kmem_zalloc(sizeof (vdev_t), KM_
SLEEP
);
+ vd = kmem_zalloc(sizeof (vdev_t), KM_
PUSHPAGE
);
if (spa->spa_root_vdev == NULL) {
ASSERT(ops == &vdev_root_ops);
if (spa->spa_root_vdev == NULL) {
ASSERT(ops == &vdev_root_ops);
@@
-747,6
+747,7
@@
vdev_add_parent(vdev_t *cvd, vdev_ops_t *ops)
mvd->vdev_asize = cvd->vdev_asize;
mvd->vdev_min_asize = cvd->vdev_min_asize;
mvd->vdev_asize = cvd->vdev_asize;
mvd->vdev_min_asize = cvd->vdev_min_asize;
+ mvd->vdev_max_asize = cvd->vdev_max_asize;
mvd->vdev_ashift = cvd->vdev_ashift;
mvd->vdev_state = cvd->vdev_state;
mvd->vdev_crtxg = cvd->vdev_crtxg;
mvd->vdev_ashift = cvd->vdev_ashift;
mvd->vdev_state = cvd->vdev_state;
mvd->vdev_crtxg = cvd->vdev_crtxg;
@@
-838,7
+839,7
@@
vdev_metaslab_init(vdev_t *vd, uint64_t txg)
ASSERT(oldc <= newc);
ASSERT(oldc <= newc);
- mspp = kmem_zalloc(newc * sizeof (*mspp), KM_
SLEEP
| KM_NODEBUG);
+ mspp = kmem_zalloc(newc * sizeof (*mspp), KM_
PUSHPAGE
| KM_NODEBUG);
if (oldc != 0) {
bcopy(vd->vdev_ms, mspp, oldc * sizeof (*mspp));
if (oldc != 0) {
bcopy(vd->vdev_ms, mspp, oldc * sizeof (*mspp));
@@
-903,6
+904,8
@@
vdev_metaslab_fini(vdev_t *vd)
kmem_free(vd->vdev_ms, count * sizeof (metaslab_t *));
vd->vdev_ms = NULL;
}
kmem_free(vd->vdev_ms, count * sizeof (metaslab_t *));
vd->vdev_ms = NULL;
}
+
+ ASSERT3U(vd->vdev_pending_fastwrite, ==, 0);
}
typedef struct vdev_probe_stats {
}
typedef struct vdev_probe_stats {
@@
-993,7
+996,7
@@
vdev_probe(vdev_t *vd, zio_t *zio)
mutex_enter(&vd->vdev_probe_lock);
if ((pio = vd->vdev_probe_zio) == NULL) {
mutex_enter(&vd->vdev_probe_lock);
if ((pio = vd->vdev_probe_zio) == NULL) {
- vps = kmem_zalloc(sizeof (*vps), KM_
SLEEP
);
+ vps = kmem_zalloc(sizeof (*vps), KM_
PUSHPAGE
);
vps->vps_flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_PROBE |
ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_AGGREGATE |
vps->vps_flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_PROBE |
ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_AGGREGATE |
@@
-1132,7
+1135,8
@@
vdev_open(vdev_t *vd)
spa_t *spa = vd->vdev_spa;
int error;
uint64_t osize = 0;
spa_t *spa = vd->vdev_spa;
int error;
uint64_t osize = 0;
- uint64_t asize, psize;
+ uint64_t max_osize = 0;
+ uint64_t asize, max_asize, psize;
uint64_t ashift = 0;
int c;
uint64_t ashift = 0;
int c;
@@
-1164,7
+1168,7
@@
vdev_open(vdev_t *vd)
return (ENXIO);
}
return (ENXIO);
}
- error = vd->vdev_ops->vdev_op_open(vd, &osize, &ashift);
+ error = vd->vdev_ops->vdev_op_open(vd, &osize, &
max_osize, &
ashift);
/*
* Reset the vdev_reopening flag so that we actually close
/*
* Reset the vdev_reopening flag so that we actually close
@@
-1222,6
+1226,7
@@
vdev_open(vdev_t *vd)
}
osize = P2ALIGN(osize, (uint64_t)sizeof (vdev_label_t));
}
osize = P2ALIGN(osize, (uint64_t)sizeof (vdev_label_t));
+ max_osize = P2ALIGN(max_osize, (uint64_t)sizeof (vdev_label_t));
if (vd->vdev_children == 0) {
if (osize < SPA_MINDEVSIZE) {
if (vd->vdev_children == 0) {
if (osize < SPA_MINDEVSIZE) {
@@
-1231,6
+1236,8
@@
vdev_open(vdev_t *vd)
}
psize = osize;
asize = osize - (VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE);
}
psize = osize;
asize = osize - (VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE);
+ max_asize = max_osize - (VDEV_LABEL_START_SIZE +
+ VDEV_LABEL_END_SIZE);
} else {
if (vd->vdev_parent != NULL && osize < SPA_MINDEVSIZE -
(VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE)) {
} else {
if (vd->vdev_parent != NULL && osize < SPA_MINDEVSIZE -
(VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE)) {
@@
-1240,6
+1247,7
@@
vdev_open(vdev_t *vd)
}
psize = 0;
asize = osize;
}
psize = 0;
asize = osize;
+ max_asize = max_osize;
}
vd->vdev_psize = psize;
}
vd->vdev_psize = psize;
@@
-1259,6
+1267,7
@@
vdev_open(vdev_t *vd)
* For testing purposes, a higher ashift can be requested.
*/
vd->vdev_asize = asize;
* For testing purposes, a higher ashift can be requested.
*/
vd->vdev_asize = asize;
+ vd->vdev_max_asize = max_asize;
vd->vdev_ashift = MAX(ashift, vd->vdev_ashift);
} else {
/*
vd->vdev_ashift = MAX(ashift, vd->vdev_ashift);
} else {
/*
@@
-1269,6
+1278,7
@@
vdev_open(vdev_t *vd)
VDEV_AUX_BAD_LABEL);
return (EINVAL);
}
VDEV_AUX_BAD_LABEL);
return (EINVAL);
}
+ vd->vdev_max_asize = max_asize;
}
/*
}
/*
@@
-2499,6
+2509,7
@@
vdev_get_stats(vdev_t *vd, vdev_stat_t *vs)
vs->vs_rsize = vdev_get_min_asize(vd);
if (vd->vdev_ops->vdev_op_leaf)
vs->vs_rsize += VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE;
vs->vs_rsize = vdev_get_min_asize(vd);
if (vd->vdev_ops->vdev_op_leaf)
vs->vs_rsize += VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE;
+ vs->vs_esize = vd->vdev_max_asize - vd->vdev_asize;
mutex_exit(&vd->vdev_stat_lock);
/*
mutex_exit(&vd->vdev_stat_lock);
/*