[dm-devel] [RFC] dm-raid1: not to add newly-allocated RH_CLEAN region to clean_regions
Jun'ichi Nomura
j-nomura at ce.jp.nec.com
Tue Jan 10 23:11:40 UTC 2006
Hi,
I would like to know whether the attached patch is something
acceptable or not.
In dm-raid1.c, 'clean_regions' in region hash is a list used
to link regions which are clean AND no longer interested (freeable).
So I think it's safe not to add newly-allocated RH_CLEAN entry
to the list because someone who allocates it has interest
on the region.
In the current code, rh_alloc()/rh_find() is called from:
- rh_inc(), which makes the state RH_DIRTY if it's RH_CLEAN
- __rh_recovery_prepare(), which makes the state RH_RECOVERING
- rh_delay(), which is called when the region is RH_RECOVERING
So none uses the newly allocated RH_CLEAN region as-is.
RH_DIRTY region is changed back to RH_CLEAN and then connected
to clean_regions when pending I/O completes.
RH_RECOVERING region is reclaimed when the recovery on the
region completes.
If this patch is acceptable, we can also merge RH_CLEAN and
RH_DIRTY into one state.
Comments are welcome.
Thanks,
Jun'ichi "Nick" Nomura
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dm-mirror-dont-add-clean.patch
Type: text/x-patch
Size: 1208 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20060110/f9ba27a9/attachment.bin>
More information about the dm-devel
mailing list