[PATCH 0/2] Checkpointing fixes

[PATCH 0/2] Checkpointing fixes

am 11.03.2011 12:59:04 von adam.kwolek

The following series implements fixes for checkpointing.
I've observe that restart from checkpoint occurs too far in array (it skipped some area).
It happen due to wrong initialization of last_checkpoint field. It has to be done in per disk units,
but setting it to reshape_position value causes initialization in per array units (multiplied by number of data disks)
First patch fixes this.
To keep checkpoint calculation consistent, I've decided to do similar thing for imsm (2'nd patch) and keep checkpoints
per disk. During reshape_progress initialization it is recalculated in to reshape position.

This patches has to be applied on my yesterdays fixes.

BR
Adam


---

Adam Kwolek (2):
imsm: FIX: Store checkpoint in per disk units
FIX: Last_checkpoint has to be initialized in per disk units


managemon.c | 9 +++++++++
super-intel.c | 8 ++++++--
2 files changed, 15 insertions(+), 2 deletions(-)

--
Signature
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 1/2] FIX: Last_checkpoint has to be initialized in per disk

am 11.03.2011 12:59:12 von adam.kwolek

last_checkpoint is variable that tracks sync_complete sysfs entry.
sync_complete is per disk counter, so initializing during starting from checkpoint
has to have this in mind and convert reshape position properly.

Signed-off-by: Adam Kwolek
---

managemon.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/managemon.c b/managemon.c
index 1362a0e..87fdd1d 100644
--- a/managemon.c
+++ b/managemon.c
@@ -667,6 +667,15 @@ static void manage_new(struct mdstat_ent *mdstat,
if (sysfs_get_ll(mdi, NULL, "reshape_position",
&new->last_checkpoint) != 0)
new->last_checkpoint = 0;
+ else {
+ int data_disks = mdi->array.raid_disks;
+ if (mdi->array.level == 5)
+ data_disks--;
+ if (mdi->array.level == 6)
+ data_disks -= 2;
+
+ new->last_checkpoint /= data_disks;
+ }
dprintf("mdmon: New monitored array is under reshape.\n"
" Last checkpoint is: %llu\n",
new->last_checkpoint);

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 2/2] imsm: FIX: Store checkpoint in per disk units

am 11.03.2011 12:59:20 von adam.kwolek

While last_checkpoint is counter in per disk units, checkpoints
should be stored in the same manner.
Restoring from checkpoint should should recalculate checkpoint in to
array position (reshape_progress).

Signed-off-by: Adam Kwolek
---

super-intel.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 5b4a38d..f18f16c 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -1702,8 +1702,6 @@ static __u64 blocks_per_migr_unit(struct imsm_dev *dev)
migr_chunk = migr_strip_blocks_resync(dev);
disks = imsm_num_data_members(dev, 0);
blocks_per_unit = stripes_per_unit * migr_chunk * disks;
- if (migr_type(dev) == MIGR_GEN_MIGR)
- return blocks_per_unit;
stripe = __le32_to_cpu(map->blocks_per_strip) * disks;
segment = blocks_per_unit / stripe;
block_rel = blocks_per_unit - segment * stripe;
@@ -1854,6 +1852,12 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
int used_disks;

info->reshape_progress = blocks_per_unit * units;
+
+ /* checkpoint is written per disks unit
+ * recalculate it to reshape position
+ */
+ used_disks = imsm_num_data_members(dev, 0);
+ info->reshape_progress *= used_disks;
dprintf("IMSM: General Migration checkpoint : %llu "
"(%llu) -> read reshape progress : %llu\n",
units, blocks_per_unit, info->reshape_progress);

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 0/2] Checkpointing fixes

am 14.03.2011 08:22:11 von NeilBrown

On Fri, 11 Mar 2011 12:59:04 +0100 Adam Kwolek wrote:

> The following series implements fixes for checkpointing.
> I've observe that restart from checkpoint occurs too far in array (it skipped some area).
> It happen due to wrong initialization of last_checkpoint field. It has to be done in per disk units,
> but setting it to reshape_position value causes initialization in per array units (multiplied by number of data disks)
> First patch fixes this.
> To keep checkpoint calculation consistent, I've decided to do similar thing for imsm (2'nd patch) and keep checkpoints
> per disk. During reshape_progress initialization it is recalculated in to reshape position.
>
> This patches has to be applied on my yesterdays fixes.
>
> BR
> Adam
>
>
> ---
>
> Adam Kwolek (2):
> imsm: FIX: Store checkpoint in per disk units
> FIX: Last_checkpoint has to be initialized in per disk units
>
>
> managemon.c | 9 +++++++++
> super-intel.c | 8 ++++++--
> 2 files changed, 15 insertions(+), 2 deletions(-)
>


Thanks - I've applied these and the other two you sent.

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html