Go figure it'd cause panics for other people.
I wasn't using zfs at all but it panicked anyhow once (my amd64 VM only,
not my i386 test server, surprisingly). I wish I'd gotten the panic but I
walked away to get a glass of water, and there wasn't a core dump because
the VM shut down completely instead of restarting. Heh.
My virtual machine died around 90k on the first trial though. I'll be sure
to reduce the amount and see what happens, and I'll put nanosleeps or
usleeps between the read and write ops to see if that alleviates the race
condition seen, but I'll keep the problem code around for reference later
in case I've stimulated some sort of weird bug in FreeBSD, or otherwise.
Both my VM and test server run almost no programs though other than samba
and rsync, so you'll probably see the panic faster / more frequently than I
will if you run a lot more programs resident in memory.
Just curious, what scheduler are you using on CURRENT, what processor do
you have, and what are your memory specs?
this is just my desktop where is running only Xorg, fluxbox, few aterms and
firefox. But i can get the panic on console too, shortly after booting. I'm
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ (2205.01-MHz K8-class
Origin = "AuthenticAMD" Id = 0x20f32 Stepping = 2
Cores per package: 2
usable memory = 3211718656 (3062 MB)
avail memory = 3105570816 (2961 MB)
For the record, it crashes few times before it hit 100k iterations, before i
debug printf in your code and increase MAX_ITERATIONS to 1m. And as far as I
can tell, I had pretty much the same results as you've measured.