zfsonlinux/spl — pull request #196 by stevenj (2012-12-03 08:19:28+00:00)
Title: Fix race condition in the linux:shrinker splat test.

The Linux Shrinker splat test has a race condition.
There is no guarantee that when the call to write "2" to /proc/sys/vm/drop_caches returns that the kernel has called the shrinker which has been defined.
The patch puts a wait event on this so that either the shrinker is run OR a 1 second timeout occurs.
If the timeout occurs then there is some sort of error cause it shouldn't take 1 second for the kernel to run through the shrinker callback.
Once the shrinker has run and shrunk down to 0, then the main test resumes and the race condition is fixed.
The only issue with this fix I can think of is if it is feasible for it to take longer than 1 second to execute, but I don't think that is likely.
This fixes issues:
https://github.com/zfsonlinux/spl/issues/182
https://github.com/zfsonlinux/spl/issues/96