Switch KM_SLEEP to KM_PUSHPAGE
[zfs.git] / module / zfs / fm.c
index e4ecfea..b91516e 100644 (file)
@@ -672,7 +672,7 @@ zfs_zevent_destroy(zfs_zevent_t *ze)
 static void *
 i_fm_alloc(nv_alloc_t *nva, size_t size)
 {
-       return (kmem_zalloc(size, KM_SLEEP));
+       return (kmem_zalloc(size, KM_PUSHPAGE));
 }
 
 /* ARGSUSED */
@@ -740,7 +740,7 @@ fm_nvlist_create(nv_alloc_t *nva)
        nv_alloc_t *nvhdl;
 
        if (nva == NULL) {
-               nvhdl = kmem_zalloc(sizeof (nv_alloc_t), KM_SLEEP);
+               nvhdl = kmem_zalloc(sizeof (nv_alloc_t), KM_PUSHPAGE);
 
                if (nv_alloc_init(nvhdl, &fm_mem_alloc_ops, NULL, 0) != 0) {
                        kmem_free(nvhdl, sizeof (nv_alloc_t));
@@ -1413,7 +1413,13 @@ fm_ena_generate_cpu(uint64_t timestamp, processorid_t cpuid, uchar_t format)
 uint64_t
 fm_ena_generate(uint64_t timestamp, uchar_t format)
 {
-       return (fm_ena_generate_cpu(timestamp, getcpuid(), format));
+       uint64_t ena;
+
+       kpreempt_disable();
+       ena = fm_ena_generate_cpu(timestamp, getcpuid(), format);
+       kpreempt_enable();
+
+       return (ena);
 }
 
 uint64_t