<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://openzfsonosx.org/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://openzfsonosx.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=77.58.71.175</id>
		<title>OpenZFS on OS X - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://openzfsonosx.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=77.58.71.175"/>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Special:Contributions/77.58.71.175"/>
		<updated>2026-05-09T17:25:48Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.22.3</generator>

	<entry>
		<id>https://openzfsonosx.org/wiki/Panic</id>
		<title>Panic</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Panic"/>
				<updated>2014-03-30T11:26:43Z</updated>
		
		<summary type="html">&lt;p&gt;77.58.71.175: /* Kernel panics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Kernel panics ==&lt;br /&gt;
&lt;br /&gt;
One of the most useful settings to assist with debugging is telling Darwin kernel to keep the symbols from kexts. This can&lt;br /&gt;
be set using the nvram command, and requires a reboot.&lt;br /&gt;
&lt;br /&gt;
First check to see if you have any special boot-args set and add the new keepsyms instruction.&lt;br /&gt;
 # nvram boot-args=&amp;quot;keepsyms=y debug=0x144&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and reboot the machine for it to take effect.&lt;br /&gt;
&lt;br /&gt;
[[https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/build/build.html#//apple_ref/doc/uid/TP30000905-CH221-BABCCIDH Table 20-1]] in Apple's Kernel Programming Guide has a summary of the meaning of the debug options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Panic decoding ===&lt;br /&gt;
&lt;br /&gt;
If you get a panic but you do not have symbols enabled, it can be decoded using the atos command.&lt;br /&gt;
&lt;br /&gt;
In a standard panic log, you will see something like:&lt;br /&gt;
&lt;br /&gt;
 # cd /Library/Logs/DiagnosticReports/&lt;br /&gt;
 # less Kernel_2014-03-13-093629_OSX109.panic&lt;br /&gt;
 Backtrace (CPU 0), Frame : Return Address&lt;br /&gt;
 0xffffff8088843b10 : 0xffffff7f85e25759  : '''0xffffff7f80dcf760''' &lt;br /&gt;
 0xffffff8088843b40 : 0xffffff7f85e25560  : '''0xffffff7f80dcf423''' &lt;br /&gt;
 0xffffff8088843be0 : 0xffffff7f85e08f27  : '''0xffffff7f80dc491a'''&lt;br /&gt;
 &lt;br /&gt;
       Kernel Extensions in backtrace:&lt;br /&gt;
         net.lundman.spl(1.0)[7F69C13B-C730-3475-99E9-53861AC6C54E]@0xffffff7f85d2a000-&amp;gt;0xffffff7f85d36fff&lt;br /&gt;
         net.lundman.zfs(1.0)[5637421D-EE17-33F1-ACB2-8FA38BC5A5A6]@'''0xffffff7f80d54000'''-&amp;gt;0xffffff7f85f38fff&lt;br /&gt;
&lt;br /&gt;
We can then run the command&lt;br /&gt;
&lt;br /&gt;
  # xcrun '''atos''' -arch '''x86_64''' -l '''0xffffff7f80d54000''' -o ../zfs/module/zfs/zfs.kext/Contents/MacOS/zfs   '''0xffffff7f80dcf760 0xffffff7f80dcf423 0xffffff7f80dc491a'''&lt;br /&gt;
 got symbolicator for ../zfs/module/zfs/zfs.kext/Contents/MacOS/zfs, base address 0&lt;br /&gt;
 spa_taskqs_init (in zfs) (spa.c:888)&lt;br /&gt;
 spa_create_zio_taskqs (in zfs) (spa.c:972)&lt;br /&gt;
 spa_activate (in zfs) (spa.c:1094)&lt;br /&gt;
&lt;br /&gt;
Which can be repeated for spl, and spl load address as well, if needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
https://developer.apple.com/library/mac/qa/qa1264/_index.html&lt;br /&gt;
&lt;br /&gt;
https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/build/build.html#//apple_ref/doc/uid/TP30000905-CH221-BABDGEGF&lt;br /&gt;
&lt;br /&gt;
https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/kext_logging.8.html&lt;/div&gt;</summary>
		<author><name>77.58.71.175</name></author>	</entry>

	<entry>
		<id>https://openzfsonosx.org/wiki/Development</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Development"/>
				<updated>2014-03-30T11:21:22Z</updated>
		
		<summary type="html">&lt;p&gt;77.58.71.175: /* kernel debug */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:O3X development]]&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
=== kernel ===&lt;br /&gt;
== kernel debug ==&lt;br /&gt;
&lt;br /&gt;
Dealing with [[Panic|panics]].&lt;br /&gt;
&lt;br /&gt;
Boot target VM with &amp;quot;-v keepsyms=y debug=0x144&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Make it panic.&lt;br /&gt;
&lt;br /&gt;
On your dev machine, you will need the kernelDebugKit from apple. Download it.&lt;br /&gt;
&lt;br /&gt;
gdb /Volumes/Kernelit/mach_kernel&lt;br /&gt;
source /Volumes/KernelDebugKit/kgmacros&lt;br /&gt;
target remote-kdp&lt;br /&gt;
&lt;br /&gt;
kdp-reattach  192.168.30.133   # obviously use the IP of your target / crashed VM&lt;br /&gt;
&lt;br /&gt;
showallkmods&lt;br /&gt;
(find &amp;quot;address&amp;quot; for zfs and spl modules)&lt;br /&gt;
^Z   # suspend gdb, or, use another terminal&lt;br /&gt;
&lt;br /&gt;
kextutil -s /tmp -n -k /Volumes/KernelDebugKit/mach_kernel -e -r /Volumes/KernelDebugKit module/zfs/zfs.kext/ ../spl/module/spl/spl.kext/&lt;br /&gt;
&lt;br /&gt;
fg # resume gdb, or go back to gdb terminal&lt;br /&gt;
set kext-symbol-file-path /tmp&lt;br /&gt;
&lt;br /&gt;
add-kext /tmp/spl.kext&lt;br /&gt;
add-kext /tmp/zfs.kext&lt;br /&gt;
&lt;br /&gt;
bt&lt;br /&gt;
=== Non-panic ===&lt;br /&gt;
&lt;br /&gt;
You can always panic a kernel with&lt;br /&gt;
&lt;br /&gt;
sudo dtrace -w -n &amp;quot;BEGIN{ panic();}&amp;quot;&lt;br /&gt;
If you prefer to work in gdb.&lt;br /&gt;
&lt;br /&gt;
But this was revealing;&lt;br /&gt;
&lt;br /&gt;
#  /usr/libexec/stackshot -i -f /tmp/stackshot.log &lt;br /&gt;
# symstacks.rb -f /tmp/stackshot.log -s -w /tmp/trace.txt&lt;br /&gt;
# less /tmp/trace.txt&lt;br /&gt;
Note that my hang is here;&lt;br /&gt;
&lt;br /&gt;
PID: 156&lt;br /&gt;
    Process: zpool&lt;br /&gt;
    Thread ID: 0x4e2&lt;br /&gt;
    Thread state: 0x9 == TH_WAIT |TH_UNINT &lt;br /&gt;
    Thread wait_event: 0xffffff8006608a6c&lt;br /&gt;
    Kernel stack: &lt;br /&gt;
    machine_switch_context (in mach_kernel) + 366 (0xffffff80002b3d3e)&lt;br /&gt;
      0xffffff800022e711 (in mach_kernel) + 1281 (0xffffff800022e711)&lt;br /&gt;
        thread_block_reason (in mach_kernel) + 300 (0xffffff800022d9dc)&lt;br /&gt;
          lck_mtx_sleep (in mach_kernel) + 78 (0xffffff80002265ce)&lt;br /&gt;
            0xffffff8000569ef6 (in mach_kernel) + 246 (0xffffff8000569ef6)&lt;br /&gt;
              msleep (in mach_kernel) + 116 (0xffffff800056a2e4)&lt;br /&gt;
                0xffffff7f80e52a76 (0xffffff7f80e52a76)&lt;br /&gt;
                  0xffffff7f80e53fae (0xffffff7f80e53fae)&lt;br /&gt;
                    0xffffff7f80e54173 (0xffffff7f80e54173)&lt;br /&gt;
                      0xffffff7f80f1a870 (0xffffff7f80f1a870)&lt;br /&gt;
                        0xffffff7f80f2bb4e (0xffffff7f80f2bb4e)&lt;br /&gt;
                          0xffffff7f80f1a9b7 (0xffffff7f80f1a9b7)&lt;br /&gt;
                            0xffffff7f80f1b65f (0xffffff7f80f1b65f)&lt;br /&gt;
                              0xffffff7f80f042ee (0xffffff7f80f042ee)&lt;br /&gt;
                                0xffffff7f80f45c5b (0xffffff7f80f45c5b)&lt;br /&gt;
                                  0xffffff7f80f4ce92 (0xffffff7f80f4ce92)&lt;br /&gt;
                                    spec_ioctl (in mach_kernel) + 157 (0xffffff8000320bfd)&lt;br /&gt;
                                      VNOP_IOCTL (in mach_kernel) + 244 (0xffffff8000311e84)&lt;br /&gt;
It is a little shame that it only shows the kernel symbols, and not inside SPL and ZFS. But we can ask it to load another sym file (alas, it can not handle multiple symbols files, fix this Apple)&lt;br /&gt;
&lt;br /&gt;
# kextstat&lt;br /&gt;
# Grab the addresses of spl and zfs again&lt;br /&gt;
# kextutil -s /tmp -n -k /Volumes/KernelDebugKit/mach_kernel -e -r /Volumes/KernelDebugKit module/zfs/zfs.kext/ ../spl/module/spl/spl.kext/ &lt;br /&gt;
&lt;br /&gt;
# symstacks.rb -f /tmp/stackshot.log -s -k /tmp/net.lundman.spl.sym&lt;br /&gt;
              0xffffff800056a2e4 (0xffffff800056a2e4)&lt;br /&gt;
                spl_cv_wait (in net.lundman.spl.sym) + 54 (0xffffff7f80e52a76)&lt;br /&gt;
                  taskq_wait (in net.lundman.spl.sym) + 78 (0xffffff7f80e53fae)&lt;br /&gt;
                    taskq_destroy (in net.lundman.spl.sym) + 35 (0xffffff7f80e54173)&lt;br /&gt;
                      0xffffff7f80f1a870 (0xffffff7f80f1a870)&lt;br /&gt;
&lt;br /&gt;
# symstacks.rb -f /tmp/stackshot.log -s -k /tmp/net.lundman.zfs.sym&lt;br /&gt;
                    0xffffff7f80e54173 (0xffffff7f80e54173)&lt;br /&gt;
                      vdev_open_children (in net.lundman.zfs.sym) + 336 (0xffffff7f80f1a870)&lt;br /&gt;
                        vdev_root_open (in net.lundman.zfs.sym) + 94 (0xffffff7f80f2bb4e)&lt;br /&gt;
                          vdev_open (in net.lundman.zfs.sym) + 311 (0xffffff7f80f1a9b7)&lt;br /&gt;
                            vdev_create (in net.lundman.zfs.sym) + 31 (0xffffff7f80f1b65f)&lt;br /&gt;
                              spa_create (in net.lundman.zfs.sym) + 878 (0xffffff7f80f042ee)&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
=== Memory Leaks ===&lt;br /&gt;
&lt;br /&gt;
If you suspect memory issues, for example from a panic like:&lt;br /&gt;
&lt;br /&gt;
panic(cpu 1 caller 0xffffff80002438d8): &amp;quot;zalloc: \&amp;quot;kalloc.1024\&amp;quot; (100535 elements) retry fail 3, kfree_nop_count: 0&amp;quot;@/SourceCache/xnu/xnu-2050.7.9/osfmk/kern/zalloc.c:1826&lt;br /&gt;
Attach gdb and use thezprint command;&lt;br /&gt;
&lt;br /&gt;
(gdb) zprint&lt;br /&gt;
ZONE                   COUNT   TOT_SZ   MAX_SZ   ELT_SZ ALLOC_SZ         TOT_ALLOC         TOT_FREE NAME&lt;br /&gt;
0xffffff8002a89250   1620133  18c1000  22a3599       16     1000         125203838        123583705 kalloc.16 CX&lt;br /&gt;
0xffffff8006306c50    110335   35f000   4ce300       32     1000          13634985         13524650 kalloc.32 CX&lt;br /&gt;
0xffffff8006306a00    133584   82a000   e6a900       64     1000          26510120         26376536 kalloc.64 CX&lt;br /&gt;
0xffffff80063067b0    610090  4a84000  614f4c0      128     1000          50524515         49914425 kalloc.128 CX&lt;br /&gt;
0xffffff8006306560   1070398 121a2000 1b5e4d60      256     1000          72534632         71464234 kalloc.256 CX&lt;br /&gt;
0xffffff8006306310    399302  d423000  daf26b0      512     1000          39231204         38831902 kalloc.512 CX&lt;br /&gt;
0xffffff80063060c0    100404  6231000  c29e980     1024     1000          22949693         22849289 kalloc.1024 CX&lt;br /&gt;
0xffffff8006305e70       292    9a000   200000     2048     1000          77633725         77633433 kalloc.2048 CX&lt;br /&gt;
In this case, kalloc.256 is suspect.&lt;br /&gt;
&lt;br /&gt;
Reboot kernel with zlog=kalloc.256 on the command line, then we can use&lt;br /&gt;
&lt;br /&gt;
(gdb) findoldest                                                                &lt;br /&gt;
oldest record is at log index 393:&lt;br /&gt;
&lt;br /&gt;
--------------- ALLOC  0xffffff803276ec00 : index 393  :  ztime 21643824 -------------&lt;br /&gt;
0xffffff800024352e &amp;lt;zalloc_canblock+78&amp;gt;:        mov    %eax,-0xcc(%rbp)&lt;br /&gt;
0xffffff80002245bd &amp;lt;get_zone_search+23&amp;gt;:        jmpq   0xffffff80002246d8 &amp;lt;KALLOC_ZINFO_SALLOC+35&amp;gt;&lt;br /&gt;
0xffffff8000224c39 &amp;lt;OSMalloc+89&amp;gt;:       mov    %rax,-0x18(%rbp)&lt;br /&gt;
0xffffff7f80e847df &amp;lt;zfs_kmem_alloc+15&amp;gt;: mov    %rax,%r15&lt;br /&gt;
0xffffff7f80e90649 &amp;lt;arc_buf_alloc+41&amp;gt;:  mov    %rax,-0x28(%rbp)&lt;br /&gt;
and indeed, list any index&lt;br /&gt;
&lt;br /&gt;
(gdb) zstack 394&lt;br /&gt;
&lt;br /&gt;
--------------- ALLOC  0xffffff8032d60700 : index 394  :  ztime 21648810 -------------&lt;br /&gt;
0xffffff800024352e &amp;lt;zalloc_canblock+78&amp;gt;:        mov    %eax,-0xcc(%rbp)&lt;br /&gt;
0xffffff80002245bd &amp;lt;get_zone_search+23&amp;gt;:        jmpq   0xffffff80002246d8 &amp;lt;KALLOC_ZINFO_SALLOC+35&amp;gt;&lt;br /&gt;
0xffffff8000224c39 &amp;lt;OSMalloc+89&amp;gt;:       mov    %rax,-0x18(%rbp)&lt;br /&gt;
0xffffff7f80e847df &amp;lt;zfs_kmem_alloc+15&amp;gt;: mov    %rax,%r15&lt;br /&gt;
0xffffff7f80e90649 &amp;lt;arc_buf_alloc+41&amp;gt;:  mov    %rax,-0x28(%rbp)&lt;br /&gt;
How many times was zfs_kmem_alloc involved in the leaked allocs?&lt;br /&gt;
&lt;br /&gt;
(gdb) countpcs 0xffffff7f80e847df&lt;br /&gt;
occurred 3999 times in log (100% of records)&lt;br /&gt;
At least we know it is our fault.&lt;br /&gt;
&lt;br /&gt;
How many times is it arc_buf_alloc?&lt;br /&gt;
&lt;br /&gt;
(gdb) countpcs 0xffffff7f80e90649&lt;br /&gt;
occurred 2390 times in log (59% of records)&lt;br /&gt;
&lt;br /&gt;
== lldb kernel debug ==&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;settings set target.load-script-from-symbol-file true&amp;quot; &amp;gt;&amp;gt; ~/.lldbinit&lt;br /&gt;
 lldb /Volumes/KernelDebugKit/mach_kernel&lt;br /&gt;
 kdp-remote  192.168.30.146&lt;br /&gt;
 showallkmods&lt;br /&gt;
 addkext -F /tmp/spl.kext/Contents/MacOS/spl 0xffffff7f8ebb0000   (Address from showallkmods)&lt;br /&gt;
 addkext -F /tmp/zfs.kext/Contents/MacOS/zfs 0xffffff7f8ebbf000&lt;br /&gt;
&lt;br /&gt;
 Then follow guide for GDB above&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flamegraphs ===&lt;br /&gt;
&lt;br /&gt;
Huge thanks to [http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html BrendanGregg] for so much of the dtrace magic.&lt;br /&gt;
&lt;br /&gt;
dtrace the kernel while running a command:&lt;br /&gt;
&lt;br /&gt;
 dtrace -x stackframes=100 -n 'profile-997 /arg0/ {&lt;br /&gt;
    @[stack()] = count(); } tick-60s { exit(0); }' -o out.stacks&lt;br /&gt;
&lt;br /&gt;
it will run for 60 seconds.&lt;br /&gt;
&lt;br /&gt;
Convert it to a flamegraph&lt;br /&gt;
&lt;br /&gt;
 ./stackcollapse.pl out.stacks &amp;gt; out.folded&lt;br /&gt;
 ./flamegraph.pl out.folded &amp;gt; out.svg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is '''rsync -ar /usr/ /BOOM/deletea/''' running;&lt;br /&gt;
&lt;br /&gt;
[[File:rsyncflamegraph.svg|thumb|rsync flamegraph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or running '''bonnie++''' in various stages;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot;&amp;gt;&lt;br /&gt;
File:create.svg|Create files in sequential order|alt=[[File:create.svg]]&lt;br /&gt;
File:stat.svg|Stat files in sequential order|alt=Stat files in sequential order&lt;br /&gt;
File:delete.svg|Delete files in sequential order|alt=Delete files in sequential order&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ZVOL block size ===&lt;br /&gt;
&lt;br /&gt;
At the moment, we can only handle block size of 512 and 4096 in ZFS. And 512 is handled poorly. To write a single 512 block, iokit layer will read in 8 blocks (to make up a PAGE_SIZE read) modify the buffer, then write 8 blocks. This makes ZFS think we wrote 8 blocks, and all stats are updated as such. This is undesirable since compression ratio etc can not be reported correctly.&lt;br /&gt;
&lt;br /&gt;
This limitation is in specfs, which is applied to any BLK device created in /dev. For usage with Apple and the GUI, there is not much we can do. But we are planning to create a secondary blk/chr nodes (maybe in /var/run/zfs/dsk/$POOL/$name or similar for compatibility) which will have our implementation attached as vnops. This will let us handle any block size required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== vnode_create thread ===&lt;br /&gt;
&lt;br /&gt;
Currently, we have to protect the call to vnode_create() due to the possibility that it calls several vnops (fsync, pageout, reclaim) and have a reclaim thread to deal with that. One issue is reclaim can both be called as a separate thread (periodic reclaims) and as the ''calling thread'' of vnode_create. This makes locking tricky.&lt;br /&gt;
&lt;br /&gt;
One idea is we create a vnode_create thread (with each dataset).  The in zfs_zget and zfs_znode_alloc, which calls vnode_create, we simply place the newly allocated zp on the vnode_create thread's ''request list'', and resume execution.  Once we have passed the &amp;quot;unlock&amp;quot; part of the functions, we can wait for the vnode_create thread to complete the request so we do not resume execution without the vp attached.&lt;br /&gt;
&lt;br /&gt;
In the vnode_create thread, we pop items off the list, call vnode_create (guaranteed as a separate thread now) and once completed, mark the node done, and signal the process which might be waiting.&lt;br /&gt;
&lt;br /&gt;
In theory this should let us handle reclaim, fsync, pageout as normal upstream ZFS. no special cases required. This should alleviate the current situation where the reclaim_list grows to very large numbers (230,000 nodes observed). &lt;br /&gt;
&lt;br /&gt;
It might mean we need to be careful in any function which might end up in zfs_znode_alloc, to make sure we have a vp attached before we resume. For example, zfs_lookup and zfs_create.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The branch '''vnode_thread''' is just this idea, it creates a vnode_create_thread per dataset, when we need to call ''vnode_create()'' it simply adds the '''zp''' to the list of requests, then signals the thread. The thread will call ''vnode_create()'' and upon completion, set '''zp-&amp;gt;z_vnode''' then signal back. The requester for '''zp''' will sit in ''zfs_znode_wait_vnode()'' waiting for the signal back.&lt;br /&gt;
&lt;br /&gt;
This means the ZFS code base is littered with calls to ''zfs_znode_wait_vnode()'' (46 to be exact) placed at the correct location. Ie, '''after''' all the locks are released, and ''zil_commit()'' has been called. It is possible that this number could be decreased, as the calls to ''zfs_zget()'' appear to not suffer the ''zil_commit()'' issue, and can probably just block at the end of ''zfs_zget()''. However the calls to ''zfs_mknode()'' is what causes the issue.&lt;br /&gt;
&lt;br /&gt;
'''sysctl zfs.vnode_create_list''' tracks the number of '''zp''' nodes in the list waiting for ''vnode_create()'' to complete. Typically, 0, or 1. Rarely higher.&lt;br /&gt;
&lt;br /&gt;
Appears to deadlock from time to time. &lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
The second branch '''vnode_threadX''' takes a slightly different approach. Instead of a permanent vnode_create_thread, it simply spawns a thread when ''zfs_znode_getvnode()'' is called. This new thread calls ''_zfs_znode_getvnode()'' which functions as above. Call ''vnode_create()'' then signal back. The same ''zfs_znode_wait_vnode()'' blockers exist.&lt;br /&gt;
&lt;br /&gt;
'''sysctl zfs.vnode_create_list''' tracks the number of '''vnode_create threads''' we have started. Interestingly, these remain 0, or 1. Rarely higher.&lt;br /&gt;
&lt;br /&gt;
Has not yet deadlocked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Conclusions;&lt;br /&gt;
&lt;br /&gt;
* It is undesirable that we have ''zfs_znode_wait_vnode()'' placed all over the source, and care needs to be taken for each one. Although it does not hurt to call it in excess, as no wait will happen if '''zp-&amp;gt;z_vnode''' is already set. &lt;br /&gt;
* It is unknown if it is OK to resume ZFS execution while '''z_vnode''' is still NULL, and only block (to wait for it to be filled in) once we are close to leaving the VNOP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* However, that '''vnop_reclaim''' are direct and can be cleaned up immediately is very desirable. We no longer need to check for the '''zp without vp''' case in ''zfs_zget()''. &lt;br /&gt;
* We no longer need to lock protect '''vnop_fsync''', '''vnop_pageout''' in case they are called from ''vnode_create()''.&lt;br /&gt;
* We don't have to throttle the '''reclaim thread''' due to the list being massive (populating the list is much faster than cleaning up a '''zp''' node - up to 250,000 nodes in the list has been observed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VX_create.svg|thumb|Create files in sequential order]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:iozone.svg|thumb|IOzone flamegraph]]&lt;br /&gt;
&lt;br /&gt;
[[File:iozoneX.svg|thumb|IOzone flamegraph (untrimmed)]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
=== iozone ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Quick peek at how they compare, just to see how much we should improve it by.&lt;br /&gt;
&lt;br /&gt;
HFS and ZFS were created on the same virtual disk in VM, yes this is not ideal testing specs, but should serve as an indicator. The &lt;br /&gt;
pool was created with&lt;br /&gt;
&lt;br /&gt;
 # zpool create -f -O atime=off -o ashift=12 -O casesensitivity=insensitive -O normalization=formD BOOM /dev/disk1&lt;br /&gt;
&lt;br /&gt;
and HFS created with standard OS X Disk Utility, with everything default. (Journaled).&lt;br /&gt;
&lt;br /&gt;
Iozone was run with standard automode, ie:&lt;br /&gt;
&lt;br /&gt;
 # iozone -a -b outfile.xls&lt;br /&gt;
&lt;br /&gt;
[[File:hfs2_read.png|thumb|HFS read]]&lt;br /&gt;
[[File:hfs2_write.png|thumb|HFS write]]&lt;br /&gt;
[[File:zfs2_read.png|thumb|ZFS read]]&lt;br /&gt;
[[File:zfs2_write.png|thumb|ZFS write]]&lt;br /&gt;
&lt;br /&gt;
At a guess, writes need to double, and reads need to triple.&lt;/div&gt;</summary>
		<author><name>77.58.71.175</name></author>	</entry>

	<entry>
		<id>https://openzfsonosx.org/wiki/Panic</id>
		<title>Panic</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Panic"/>
				<updated>2014-03-18T14:39:27Z</updated>
		
		<summary type="html">&lt;p&gt;77.58.71.175: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Kernel panics ==&lt;br /&gt;
&lt;br /&gt;
One of the most useful settings to assist with debugging is telling Darwin kernel to keep the symbols from kexts. This can&lt;br /&gt;
be set using the nvram command, and requires a reboot.&lt;br /&gt;
&lt;br /&gt;
First check to see if you have any special boot-args set and add the new keepsyms instruction.&lt;br /&gt;
 # nvram boot-args=&amp;quot;keepsyms=y&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and reboot the machine for it to take effect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Panic decoding ===&lt;br /&gt;
&lt;br /&gt;
If you get a panic but you do not have symbols enabled, it can be decoded using the atos command.&lt;br /&gt;
&lt;br /&gt;
In a standard panic log, you will see something like:&lt;br /&gt;
&lt;br /&gt;
 # cd /Library/Logs/DiagnosticReports/&lt;br /&gt;
 # less Kernel_2014-03-13-093629_OSX109.panic&lt;br /&gt;
 Backtrace (CPU 0), Frame : Return Address&lt;br /&gt;
 0xffffff8088843b10 : 0xffffff7f85e25759  : '''0xffffff7f80dcf760''' &lt;br /&gt;
 0xffffff8088843b40 : 0xffffff7f85e25560  : '''0xffffff7f80dcf423''' &lt;br /&gt;
 0xffffff8088843be0 : 0xffffff7f85e08f27  : '''0xffffff7f80dc491a'''&lt;br /&gt;
 &lt;br /&gt;
       Kernel Extensions in backtrace:&lt;br /&gt;
         net.lundman.spl(1.0)[7F69C13B-C730-3475-99E9-53861AC6C54E]@0xffffff7f85d2a000-&amp;gt;0xffffff7f85d36fff&lt;br /&gt;
         net.lundman.zfs(1.0)[5637421D-EE17-33F1-ACB2-8FA38BC5A5A6]@'''0xffffff7f80d54000'''-&amp;gt;0xffffff7f85f38fff&lt;br /&gt;
&lt;br /&gt;
We can then run the command&lt;br /&gt;
&lt;br /&gt;
  # xcrun '''atos''' -arch '''x86_64''' -l '''0xffffff7f80d54000''' -o ../zfs/module/zfs/zfs.kext/Contents/MacOS/zfs   '''0xffffff7f80dcf760 0xffffff7f80dcf423 0xffffff7f80dc491a'''&lt;br /&gt;
 got symbolicator for ../zfs/module/zfs/zfs.kext/Contents/MacOS/zfs, base address 0&lt;br /&gt;
 spa_taskqs_init (in zfs) (spa.c:888)&lt;br /&gt;
 spa_create_zio_taskqs (in zfs) (spa.c:972)&lt;br /&gt;
 spa_activate (in zfs) (spa.c:1094)&lt;br /&gt;
&lt;br /&gt;
Which can be repeated for spl, and spl load address as well, if needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
https://developer.apple.com/library/mac/qa/qa1264/_index.html&lt;br /&gt;
&lt;br /&gt;
https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/build/build.html#//apple_ref/doc/uid/TP30000905-CH221-BABDGEGF&lt;br /&gt;
&lt;br /&gt;
https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/kext_logging.8.html&lt;/div&gt;</summary>
		<author><name>77.58.71.175</name></author>	</entry>

	<entry>
		<id>https://openzfsonosx.org/wiki/Panic</id>
		<title>Panic</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Panic"/>
				<updated>2014-03-18T14:32:33Z</updated>
		
		<summary type="html">&lt;p&gt;77.58.71.175: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Kernel panics ==&lt;br /&gt;
&lt;br /&gt;
One of the most useful settings to assist with debugging is telling Darwin kernel to keep the symbols from kexts. This can&lt;br /&gt;
be set using the nvram command, and requires a reboot.&lt;br /&gt;
&lt;br /&gt;
First check to see if you have any special boot-args set and add the new keepsyms instruction.&lt;br /&gt;
 # nvram boot-args=&amp;quot;keepsyms=y&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and reboot the machine for it to take effect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Panic decoding ===&lt;br /&gt;
&lt;br /&gt;
If you get a panic but you do not have symbols enabled, it can be decoded using the atos command.&lt;br /&gt;
&lt;br /&gt;
In a standard panic log, you will see something like:&lt;br /&gt;
&lt;br /&gt;
 # cd /Library/Logs/DiagnosticReports/&lt;br /&gt;
 # less Kernel_2014-03-13-093629_OSX109.panic&lt;br /&gt;
 Backtrace (CPU 0), Frame : Return Address&lt;br /&gt;
 0xffffff8088843b10 : 0xffffff7f85e25759  : '''0xffffff7f80dcf760''' &lt;br /&gt;
 0xffffff8088843b40 : 0xffffff7f85e25560  : '''0xffffff7f80dcf423''' &lt;br /&gt;
 0xffffff8088843be0 : 0xffffff7f85e08f27  : '''0xffffff7f80dc491a'''&lt;br /&gt;
 &lt;br /&gt;
       Kernel Extensions in backtrace:&lt;br /&gt;
         net.lundman.spl(1.0)[7F69C13B-C730-3475-99E9-53861AC6C54E]@0xffffff7f85d2a000-&amp;gt;0xffffff7f85d36fff&lt;br /&gt;
         net.lundman.zfs(1.0)[5637421D-EE17-33F1-ACB2-8FA38BC5A5A6]@'''0xffffff7f80d54000'''-&amp;gt;0xffffff7f85f38fff&lt;br /&gt;
&lt;br /&gt;
We can then run the command&lt;br /&gt;
&lt;br /&gt;
  # xcrun '''atos''' -arch '''x86_64''' -l '''0xffffff7f80d54000''' -o ../zfs/module/zfs/zfs.kext/Contents/MacOS/zfs   '''0xffffff7f80dcf760 0xffffff7f80dcf423 0xffffff7f80dc491a'''&lt;br /&gt;
 got symbolicator for ../zfs/module/zfs/zfs.kext/Contents/MacOS/zfs, base address 0&lt;br /&gt;
 spa_taskqs_init (in zfs) (spa.c:888)&lt;br /&gt;
 spa_create_zio_taskqs (in zfs) (spa.c:972)&lt;br /&gt;
 spa_activate (in zfs) (spa.c:1094)&lt;br /&gt;
&lt;br /&gt;
Which can be repeated for spl, and spl load address as well, if needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
https://developer.apple.com/library/mac/qa/qa1264/_index.html&lt;br /&gt;
&lt;br /&gt;
https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/build/build.html#//apple_ref/doc/uid/TP30000905-CH221-BABDGEGF&lt;/div&gt;</summary>
		<author><name>77.58.71.175</name></author>	</entry>

	</feed>