Re: question about raid5 parity calculations
From: Neil Brown <hidden>
Date: 2006-10-05 10:01:55
On Tuesday October 3, jochen.oekonomopulos@uni-konstanz.de wrote:
Hello Neil, Ingo and [insert your name here], I try to understand the raid5 and md code and I have a question concerning the cache. There are two ways of calculating the parity: read-modify-write and reconstruct-write. In my understanding, the code only checks how many buffers it has to read for each method (rmw or rcw) without considering the cache. But what if there was relevant data in the cache? How would the raid code know it so it can build a decision on top of this knowledge?
Close. It checks how many buffers it has to read for each method *with* consideration of the cache. Note the "!test_bit(R5_UPTODATE, &dev->flags)" tests in handle_stripe5 in the section where 'rcw' and 'rwm' are being calculated. It only counts buffers that are not uptodate. i.e. those that do not already exist in the stripe cache. NeilBrown