diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/fs/zfs/metaslab.c | 47 | ||||
-rw-r--r-- | usr/src/uts/common/fs/zfs/sys/metaslab_impl.h | 3 | ||||
-rw-r--r-- | usr/src/uts/common/fs/zfs/zio.c | 8 | ||||
-rw-r--r-- | usr/src/uts/intel/dtrace/dtrace_isa.c | 16 | ||||
-rw-r--r-- | usr/src/uts/intel/dtrace/sdt.c | 14 | ||||
-rw-r--r-- | usr/src/uts/intel/ia32/ml/exception.s | 4 |
6 files changed, 27 insertions, 65 deletions
diff --git a/usr/src/uts/common/fs/zfs/metaslab.c b/usr/src/uts/common/fs/zfs/metaslab.c index eee734dbbf..6229bfced4 100644 --- a/usr/src/uts/common/fs/zfs/metaslab.c +++ b/usr/src/uts/common/fs/zfs/metaslab.c @@ -38,7 +38,7 @@ * avoid having to load lots of space_maps in a given txg. There are, * however, some cases where we want to avoid "fast" ganging and instead * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang, zil, or dump device related allocations + * Currently we don't allow any gang, slog, or dump device related allocations * to "fast" gang. */ #define CAN_FASTGANG(flags) \ @@ -67,14 +67,6 @@ int zfs_condense_pct = 200; int zfs_condense_never = 0; /* - * This value defines the number of allowed allocation failures per vdev. - * If a device reaches this threshold in a given txg then we consider skipping - * allocations on that device. The value of zfs_mg_alloc_failures is computed - * in zio_init() unless it has been overridden in /etc/system. - */ -int zfs_mg_alloc_failures = 0; - -/* * The zfs_mg_noalloc_threshold defines which metaslab groups should * be eligible for allocation. The value is defined as a percentage of * a free space. Metaslab groups that have more free space than @@ -1619,10 +1611,7 @@ metaslab_sync_done(metaslab_t *msp, uint64_t txg) void metaslab_sync_reassess(metaslab_group_t *mg) { - int64_t failures = mg->mg_alloc_failures; - metaslab_group_alloc_update(mg); - atomic_add_64(&mg->mg_alloc_failures, -failures); /* * Preload the next potential metaslabs @@ -1649,7 +1638,7 @@ metaslab_distance(metaslab_t *msp, dva_t *dva) static uint64_t metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize, - uint64_t txg, uint64_t min_distance, dva_t *dva, int d, int flags) + uint64_t txg, uint64_t min_distance, dva_t *dva, int d) { spa_t *spa = mg->mg_vd->vdev_spa; metaslab_t *msp = NULL; @@ -1676,10 +1665,9 @@ metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize, spa_dbgmsg(spa, "%s: failed to meet weight " "requirement: vdev %llu, txg %llu, mg %p, " "msp %p, psize %llu, asize %llu, " - "failures %llu, weight %llu", - spa_name(spa), mg->mg_vd->vdev_id, txg, - mg, msp, psize, asize, - mg->mg_alloc_failures, msp->ms_weight); + "weight %llu", spa_name(spa), + mg->mg_vd->vdev_id, txg, + mg, msp, psize, asize, msp->ms_weight); mutex_exit(&mg->mg_lock); return (-1ULL); } @@ -1712,27 +1700,6 @@ metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize, mutex_enter(&msp->ms_lock); /* - * If we've already reached the allowable number of failed - * allocation attempts on this metaslab group then we - * consider skipping it. We skip it only if we're allowed - * to "fast" gang, the physical size is larger than - * a gang block, and we're attempting to allocate from - * the primary metaslab. - */ - if (mg->mg_alloc_failures > zfs_mg_alloc_failures && - CAN_FASTGANG(flags) && psize > SPA_GANGBLOCKSIZE && - activation_weight == METASLAB_WEIGHT_PRIMARY) { - spa_dbgmsg(spa, "%s: skipping metaslab group: " - "vdev %llu, txg %llu, mg %p, msp[%llu] %p, " - "psize %llu, asize %llu, failures %llu", - spa_name(spa), mg->mg_vd->vdev_id, txg, mg, - msp->ms_id, msp, psize, asize, - mg->mg_alloc_failures); - mutex_exit(&msp->ms_lock); - return (-1ULL); - } - - /* * Ensure that the metaslab we have selected is still * capable of handling our request. It's possible that * another thread may have changed the weight while we @@ -1771,8 +1738,6 @@ metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize, if ((offset = metaslab_block_alloc(msp, asize)) != -1ULL) break; - atomic_inc_64(&mg->mg_alloc_failures); - metaslab_passivate(msp, metaslab_block_maxsize(msp)); mutex_exit(&msp->ms_lock); } @@ -1927,7 +1892,7 @@ top: ASSERT(P2PHASE(asize, 1ULL << vd->vdev_ashift) == 0); offset = metaslab_group_alloc(mg, psize, asize, txg, distance, - dva, d, flags); + dva, d); if (offset != -1ULL) { /* * If we've just selected this metaslab group, diff --git a/usr/src/uts/common/fs/zfs/sys/metaslab_impl.h b/usr/src/uts/common/fs/zfs/sys/metaslab_impl.h index 24b8ada3ba..08e4de4710 100644 --- a/usr/src/uts/common/fs/zfs/sys/metaslab_impl.h +++ b/usr/src/uts/common/fs/zfs/sys/metaslab_impl.h @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H @@ -57,7 +57,6 @@ struct metaslab_group { kmutex_t mg_lock; avl_tree_t mg_metaslab_tree; uint64_t mg_aliquot; - uint64_t mg_alloc_failures; boolean_t mg_allocatable; /* can we allocate? */ uint64_t mg_free_capacity; /* percentage free */ int64_t mg_bias; diff --git a/usr/src/uts/common/fs/zfs/zio.c b/usr/src/uts/common/fs/zfs/zio.c index bf12b6411c..d283576fc8 100644 --- a/usr/src/uts/common/fs/zfs/zio.c +++ b/usr/src/uts/common/fs/zfs/zio.c @@ -63,7 +63,6 @@ kmem_cache_t *zio_data_buf_cache[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT]; #ifdef _KERNEL extern vmem_t *zio_alloc_arena; #endif -extern int zfs_mg_alloc_failures; /* * The following actions directly effect the spa's sync-to-convergence logic. @@ -170,13 +169,6 @@ zio_init(void) zio_data_buf_cache[c - 1] = zio_data_buf_cache[c]; } - /* - * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs - * to fail 3 times per txg or 8 failures, whichever is greater. - */ - if (zfs_mg_alloc_failures == 0) - zfs_mg_alloc_failures = MAX((3 * max_ncpus / 2), 8); - zio_inject_init(); } diff --git a/usr/src/uts/intel/dtrace/dtrace_isa.c b/usr/src/uts/intel/dtrace/dtrace_isa.c index 6b5a4e1bd1..f649473dfb 100644 --- a/usr/src/uts/intel/dtrace/dtrace_isa.c +++ b/usr/src/uts/intel/dtrace/dtrace_isa.c @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + */ #include <sys/dtrace_impl.h> #include <sys/stack.h> @@ -433,7 +435,7 @@ dtrace_getarg(int arg, int aframes) * use the pointer that it passed to the stack as the * second argument to dtrace_invop() as the pointer to * the stack. When using this stack, we must step - * beyond the EIP/RIP that was pushed when the trap was + * beyond the EIP that was pushed when the trap was * taken -- hence the "+ 1" below. */ stack = ((uintptr_t **)&fp[1])[1] + 1; @@ -442,17 +444,17 @@ dtrace_getarg(int arg, int aframes) * In the case of amd64, we will use the pointer to the * regs structure that was pushed when we took the * trap. To get this structure, we must increment - * beyond the frame structure, and then again beyond - * the calling RIP stored in dtrace_invop(). If the - * argument that we're seeking is passed on the stack, - * we'll pull the true stack pointer out of the saved + * beyond the frame structure, the calling RIP, and + * padding stored in dtrace_invop(). If the argument + * that we're seeking is passed on the stack, we'll + * pull the true stack pointer out of the saved * registers and decrement our argument by the number * of arguments passed in registers; if the argument * we're seeking is passed in regsiters, we can just * load it directly. */ struct regs *rp = (struct regs *)((uintptr_t)&fp[1] + - sizeof (uintptr_t)); + sizeof (uintptr_t) * 2); if (arg <= inreg) { stack = (uintptr_t *)&rp->r_rdi; diff --git a/usr/src/uts/intel/dtrace/sdt.c b/usr/src/uts/intel/dtrace/sdt.c index 27cb19e06c..e98f6a30c0 100644 --- a/usr/src/uts/intel/dtrace/sdt.c +++ b/usr/src/uts/intel/dtrace/sdt.c @@ -25,6 +25,7 @@ /* * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ #include <sys/modctl.h> @@ -329,16 +330,17 @@ sdt_getarg(void *arg, dtrace_id_t id, void *parg, int argno, int aframes) * In the case of amd64, we will use the pointer to the * regs structure that was pushed when we took the * trap. To get this structure, we must increment - * beyond the frame structure. If the argument that - * we're seeking is passed on the stack, we'll pull - * the true stack pointer out of the saved registers - * and decrement our argument by the number of - * arguments passed in registers; if the argument + * beyond the frame structure, the calling RIP, and + * padding stored in dtrace_invop(). If the argument + * that we're seeking is passed on the stack, we'll + * pull the true stack pointer out of the saved + * registers and decrement our argument by the number + * of arguments passed in registers; if the argument * we're seeking is passed in regsiters, we can just * load it directly. */ struct regs *rp = (struct regs *)((uintptr_t)&fp[1] + - sizeof (uintptr_t)); + sizeof (uintptr_t) * 2); if (argno <= inreg) { stack = (uintptr_t *)&rp->r_rdi; diff --git a/usr/src/uts/intel/ia32/ml/exception.s b/usr/src/uts/intel/ia32/ml/exception.s index ab24e46548..33832749ca 100644 --- a/usr/src/uts/intel/ia32/ml/exception.s +++ b/usr/src/uts/intel/ia32/ml/exception.s @@ -1,5 +1,6 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ /* @@ -394,9 +395,10 @@ ud_kernel: movq REGOFF_RAX(%rsp), %rdx pushq (%rsi) movq %rsp, %rsi + subq $8, %rsp call dtrace_invop ALTENTRY(dtrace_invop_callsite) - addq $8, %rsp + addq $16, %rsp cmpl $DTRACE_INVOP_PUSHL_EBP, %eax je ud_push cmpl $DTRACE_INVOP_LEAVE, %eax |