[dm-devel] dm-cache bug when using the cleaner?

Darrick J. Wong darrick.wong at oracle.com
Tue Mar 5 01:40:48 UTC 2013


Hi there,

I've been playing around with writeback mode in dmcache with my shiny new
3.9-rc1 kernel.

# dmsetup table moocache
0 67108864 cache 253:0 253:1 8:0 512 1 writeback default 4 random_threshold 8 sequential_threshold 512
# dmsetup status moocache
0 67108864 cache 14/2048 3967 54586 263549 190982 0 0 2000 51 0 2 migration_threshold 204800 4 random_threshold 8 sequential_threshold 512

I think this means there are 51 dirty cache blocks?  I'd like to flush them out
to the spinny disk:

# dmsetup suspend moocache
# echo '0 67108864 cache 253:0 253:1 8:0 512 0 cleaner 0' | dmsetup reload moocache
# dmsetup resume moocache

Ok, now let's wait for it to finish...

# dmsetup wait moocache
# dmsetup status moocache
0 67108864 cache 14/2048 3967 54586 263583 190982 0 0 2000 0 0 2 migration_threshold 204800 0

Now that dirty field goes from 51 back to 0, like I'd expected.  However, if I
then put the old policy back:

# dmsetup suspend moocache
# echo '0 67108864 cache 253:0 253:1 8:0 512 1 writeback default 4 random_threshold 8 sequential_threshold 512' | dmsetup reload moocache
# dmsetup resume moocache

# dmsetup status moocache
0 67108864 cache 14/2048 3967 54586 263553 190982 0 0 2000 51 0 2 migration_threshold 204800 4 random_threshold 8 sequential_threshold 512

That's odd, there are still 51 dirty cache blocks?  Am I missing something?  Is
there something about suspend/resume that causes something to get reset?  Do I
even need the suspend/resume pair?  (I'm pretty sure I do; the table doesn't
change if I don't.)  I get the same dirtyblocks==51 results even if I remove
and (re)create moocache.

--D




More information about the dm-devel mailing list