]> git.proxmox.com Git - mirror_zfs-debian.git/blobdiff - module/zfs/txg.c
Wrap smp_processor_id in kpreempt_[dis|en]able
[mirror_zfs-debian.git] / module / zfs / txg.c
index 6e64adf9376e5c97a8cfb823caf796c0c9cb6b8f..1cb3cb61c43abbc7cde92383d444303b66d5d7a8 100644 (file)
@@ -218,9 +218,19 @@ uint64_t
 txg_hold_open(dsl_pool_t *dp, txg_handle_t *th)
 {
        tx_state_t *tx = &dp->dp_tx;
-       tx_cpu_t *tc = &tx->tx_cpu[CPU_SEQID];
+       tx_cpu_t *tc;
        uint64_t txg;
 
+       /*
+        * It appears the processor id is simply used as a "random"
+        * number to index into the array, and there isn't any other
+        * significance to the chosen tx_cpu. Because.. Why not use
+        * the current cpu to index into the array?
+        */
+       kpreempt_disable();
+       tc = &tx->tx_cpu[CPU_SEQID];
+       kpreempt_enable();
+
        mutex_enter(&tc->tc_lock);
 
        txg = tx->tx_open_txg;