summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2020-12-16 10:10:41 -0500
committerDan McDonald <danmcd@joyent.com>2020-12-16 10:10:44 -0500
commit32187eecd8e0d7104da3064c113e615d34459ad5 (patch)
treeb8dfe2d510ecb70dcc935114635a0389f50131af
parentcf2c299a48b4aaf532e5c9b94bedeef718b88e99 (diff)
parent3714f7be8e09c39a0ea7ce7ef44cb495ce250913 (diff)
downloadillumos-joyent-32187eecd8e0d7104da3064c113e615d34459ad5.tar.gz
[illumos-gate merge]
commit 3714f7be8e09c39a0ea7ce7ef44cb495ce250913 13218 "Stack smashing detected" panic when creating vnic over aggr with 4 mlxcx links 13222 Increase maximum number of fanout CPUs from 128 to 256 commit cc37296fa5ddc1ddd4012e040f797164c2a5cf5d 13358 dmu_objset_upgrade_stop() needs to wait 12397 12254 broke the zfs test suite for older python versions Conflicts: usr/src/uts/common/sys/mac_flow.h
-rw-r--r--usr/src/test/test-runner/cmd/run2
-rw-r--r--usr/src/uts/common/fs/zfs/dmu_objset.c16
-rw-r--r--usr/src/uts/common/io/mac/mac_datapath_setup.c51
-rw-r--r--usr/src/uts/common/sys/mac_flow.h13
4 files changed, 45 insertions, 37 deletions
diff --git a/usr/src/test/test-runner/cmd/run b/usr/src/test/test-runner/cmd/run
index fe0af912f6..127de5c35e 100644
--- a/usr/src/test/test-runner/cmd/run
+++ b/usr/src/test/test-runner/cmd/run
@@ -156,7 +156,7 @@ class Output(object):
for easy sorting/merging later.
"""
fd = self.fileno()
- buf = os.read(fd, 4096).decode('utf-8')
+ buf = os.read(fd, 4096).decode('utf-8', errors='ignore')
if not buf:
return None
if '\n' not in buf:
diff --git a/usr/src/uts/common/fs/zfs/dmu_objset.c b/usr/src/uts/common/fs/zfs/dmu_objset.c
index 6e12454ba5..884f0b36bb 100644
--- a/usr/src/uts/common/fs/zfs/dmu_objset.c
+++ b/usr/src/uts/common/fs/zfs/dmu_objset.c
@@ -854,7 +854,7 @@ dmu_objset_refresh_ownership(dsl_dataset_t *ds, dsl_dataset_t **newds,
dp = ds->ds_dir->dd_pool;
dsl_pool_config_enter(dp, FTAG);
- dsl_dataset_disown(ds, 0, tag);
+ dsl_dataset_disown(ds, decrypt, tag);
VERIFY0(dsl_dataset_own(dp, name,
(decrypt) ? DS_HOLD_FLAG_DECRYPT : 0, tag, newds));
dsl_pool_config_exit(dp, FTAG);
@@ -983,6 +983,7 @@ dmu_objset_evict_done(objset_t *os)
mutex_destroy(&os->os_userused_lock);
mutex_destroy(&os->os_obj_lock);
mutex_destroy(&os->os_user_ptr_lock);
+ mutex_destroy(&os->os_upgrade_lock);
for (int i = 0; i < TXG_SIZE; i++) {
multilist_destroy(os->os_dirty_dnodes[i]);
}
@@ -1479,10 +1480,15 @@ dmu_objset_upgrade_task_cb(void *data)
mutex_enter(&os->os_upgrade_lock);
os->os_upgrade_status = EINTR;
if (!os->os_upgrade_exit) {
+ int status;
+
mutex_exit(&os->os_upgrade_lock);
- os->os_upgrade_status = os->os_upgrade_cb(os);
+ status = os->os_upgrade_cb(os);
+
mutex_enter(&os->os_upgrade_lock);
+
+ os->os_upgrade_status = status;
}
os->os_upgrade_exit = B_TRUE;
os->os_upgrade_id = 0;
@@ -1510,6 +1516,8 @@ dmu_objset_upgrade(objset_t *os, dmu_objset_upgrade_cb_t cb)
dsl_dataset_long_rele(dmu_objset_ds(os), upgrade_tag);
os->os_upgrade_status = ENOMEM;
}
+ } else {
+ dsl_dataset_long_rele(dmu_objset_ds(os), upgrade_tag);
}
mutex_exit(&os->os_upgrade_lock);
}
@@ -1522,10 +1530,10 @@ dmu_objset_upgrade_stop(objset_t *os)
if (os->os_upgrade_id != 0) {
taskqid_t tid = os->os_upgrade_id;
- os->os_upgrade_id = 0;
mutex_exit(&os->os_upgrade_lock);
taskq_wait_id(os->os_spa->spa_upgrade_taskq, tid);
+ txg_wait_synced(os->os_spa->spa_dsl_pool, 0);
} else {
mutex_exit(&os->os_upgrade_lock);
}
@@ -2226,7 +2234,7 @@ dmu_objset_userquota_get_ids(dnode_t *dn, boolean_t before, dmu_tx_t *tx)
if (flags & DN_ID_OLD_EXIST) {
dn->dn_newuid = dn->dn_olduid;
dn->dn_newgid = dn->dn_oldgid;
- dn->dn_newgid = dn->dn_oldprojid;
+ dn->dn_newprojid = dn->dn_oldprojid;
} else {
dn->dn_newuid = 0;
dn->dn_newgid = 0;
diff --git a/usr/src/uts/common/io/mac/mac_datapath_setup.c b/usr/src/uts/common/io/mac/mac_datapath_setup.c
index e1dbf9a953..4819cd86df 100644
--- a/usr/src/uts/common/io/mac/mac_datapath_setup.c
+++ b/usr/src/uts/common/io/mac/mac_datapath_setup.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2018 Joyent, Inc.
+ * Copyright 2020 RackTop Systems.
*/
#include <sys/types.h>
@@ -1083,10 +1084,9 @@ mac_flow_cpu_init(flow_entry_t *flent, cpupart_t *cpupart)
{
mac_soft_ring_set_t *rx_srs;
processorid_t cpuid;
- int i, j, k, srs_cnt, nscpus, maxcpus, soft_ring_cnt = 0;
+ int i, j, k, srs_cnt, maxcpus, soft_ring_cnt = 0;
mac_cpus_t *srs_cpu;
mac_resource_props_t *emrp = &flent->fe_effective_props;
- uint32_t cpus[MRP_NCPUS];
/*
* The maximum number of CPUs available can either be
@@ -1094,6 +1094,12 @@ mac_flow_cpu_init(flow_entry_t *flent, cpupart_t *cpupart)
* in the system.
*/
maxcpus = (cpupart != NULL) ? cpupart->cp_ncpus : ncpus;
+ /*
+ * We cannot exceed the hard limit imposed by data structures.
+ * Leave space for polling CPU and the SRS worker thread when
+ * "mac_latency_optimize" is not set.
+ */
+ maxcpus = MIN(maxcpus, MRP_NCPUS - 2);
/*
* Compute the number of soft rings needed on top for each Rx
@@ -1113,7 +1119,10 @@ mac_flow_cpu_init(flow_entry_t *flent, cpupart_t *cpupart)
*/
soft_ring_cnt = 1;
}
- for (srs_cnt = 0; srs_cnt < flent->fe_rx_srs_cnt; srs_cnt++) {
+
+ emrp->mrp_ncpus = 0;
+ for (srs_cnt = 0; srs_cnt < flent->fe_rx_srs_cnt &&
+ emrp->mrp_ncpus < MRP_NCPUS; srs_cnt++) {
rx_srs = flent->fe_rx_srs[srs_cnt];
srs_cpu = &rx_srs->srs_cpu;
if (rx_srs->srs_fanout_state == SRS_FANOUT_INIT)
@@ -1140,32 +1149,22 @@ mac_flow_cpu_init(flow_entry_t *flent, cpupart_t *cpupart)
}
srs_cpu->mc_rx_workerid = cpuid;
mutex_exit(&cpu_lock);
- }
-
- nscpus = 0;
- for (srs_cnt = 0; srs_cnt < flent->fe_rx_srs_cnt; srs_cnt++) {
- rx_srs = flent->fe_rx_srs[srs_cnt];
- srs_cpu = &rx_srs->srs_cpu;
- for (j = 0; j < srs_cpu->mc_ncpus; j++) {
- cpus[nscpus++] = srs_cpu->mc_cpus[j];
- }
- }
-
- /*
- * Copy cpu list to fe_effective_props
- * without duplicates.
- */
- k = 0;
- for (i = 0; i < nscpus; i++) {
- for (j = 0; j < k; j++) {
- if (emrp->mrp_cpu[j] == cpus[i])
- break;
+ /*
+ * Copy fanout CPUs to fe_effective_props without duplicates.
+ */
+ for (i = 0; i < srs_cpu->mc_ncpus &&
+ emrp->mrp_ncpus < MRP_NCPUS; i++) {
+ for (j = 0; j < emrp->mrp_ncpus; j++) {
+ if (emrp->mrp_cpu[j] == srs_cpu->mc_cpus[i])
+ break;
+ }
+ if (j == emrp->mrp_ncpus) {
+ emrp->mrp_cpu[emrp->mrp_ncpus++] =
+ srs_cpu->mc_cpus[i];
+ }
}
- if (j == k)
- emrp->mrp_cpu[k++] = cpus[i];
}
- emrp->mrp_ncpus = k;
mac_tx_cpu_init(flent, NULL, cpupart);
}
diff --git a/usr/src/uts/common/sys/mac_flow.h b/usr/src/uts/common/sys/mac_flow.h
index d37752ec23..a9a2a5f61e 100644
--- a/usr/src/uts/common/sys/mac_flow.h
+++ b/usr/src/uts/common/sys/mac_flow.h
@@ -23,6 +23,7 @@
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2017 Joyent, Inc. All rights reserved.
+ * Copyright 2020 RackTop Systems, Inc.
*/
#ifndef _MAC_FLOW_H
@@ -92,7 +93,7 @@ typedef struct flow_desc_s {
uint8_t fd_dsfield_mask;
} flow_desc_t;
-#define MRP_NCPUS 128
+#define MRP_NCPUS 256
/*
* In MCM_CPUS mode, cpu bindings is user specified. In MCM_FANOUT mode,
@@ -118,7 +119,7 @@ typedef struct mac_tx_intr_cpus_s {
typedef struct mac_cpus_props_s {
uint32_t mc_ncpus; /* num of cpus */
- uint32_t mc_cpus[MRP_NCPUS]; /* cpu list */
+ uint32_t mc_cpus[MRP_NCPUS]; /* cpu list */
uint32_t mc_rx_fanout_cnt; /* soft ring cpu cnt */
uint32_t mc_rx_fanout_cpus[MRP_NCPUS]; /* SR cpu list */
uint32_t mc_rx_pollid; /* poll thr binding */
@@ -198,10 +199,10 @@ typedef struct mac_protect_s {
/* The default priority for flows */
#define MPL_SUBFLOW_DEFAULT MPL_MEDIUM
-#define MRP_MAXBW 0x00000001 /* Limit set */
-#define MRP_CPUS 0x00000002 /* CPU/fanout set */
-#define MRP_CPUS_USERSPEC 0x00000004 /* CPU/fanout from user */
-#define MRP_PRIORITY 0x00000008 /* Priority set */
+#define MRP_MAXBW 0x00000001 /* Limit set */
+#define MRP_CPUS 0x00000002 /* CPU/fanout set */
+#define MRP_CPUS_USERSPEC 0x00000004 /* CPU/fanout from user */
+#define MRP_PRIORITY 0x00000008 /* Priority set */
#define MRP_PROTECT 0x00000010 /* Protection set */
#define MRP_RX_RINGS 0x00000020 /* Rx rings */
#define MRP_TX_RINGS 0x00000040 /* Tx rings */