On Tuesday October 3, jochen.oekonomopulos@xxxxxxxxxxxxxxx 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 - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html