Re: [RFC 4/5] r5cache: write part of r5cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 01 2016, Song Liu wrote:
>>
>>It isn't at all clear to me why you need the extra page.  Could you
>>explain when and why the ->page and the ->orig_page would contain
>>different content and both of the content would be needed?
>>
>
> In prexor, we need read old data from the disk to perform the 
> substract-xor. In the meanwhile, we need a buffer for the new data. 
> When there is no write cache, the new data is in the page of bio. 
> With write cache, however, the bio might be already released. 
> Therefore, we will need an extra page here: orig_page for new 
> Cached data, while newly allocated page just hold old data for prexor. 
>

Ahh, I get it now - thanks.  The fact that you said "page" rather than
"pages" threw me.  I assumed it was a page for the parity block only,
which is wrong.
So I would write:

 For RMW, the code allocates an extra page for each data block being
 updated.  This is stored in r5dev->page and the old data is read into
 it.  Then the prexor calculation subtracts ->page from the parity
 block, and the reconstruct calculation adds the ->orig_page data back
 into the parity block.

Or something like that.

Thanks,
NeilBrown

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux