The patch looks correct, but I wonder what the performance implications of flushing the AIL every 30 seconds are. Did you benchmark the patchset to see what it does to performance numbers for metadata intensive workloads?