linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Checkpointing fixes
@ 2011-03-11 11:59 Adam Kwolek
  2011-03-11 11:59 ` [PATCH 1/2] FIX: Last_checkpoint has to be initialized in per disk units Adam Kwolek
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Adam Kwolek @ 2011-03-11 11:59 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] FIX: Last_checkpoint has to be initialized in per disk units
  2011-03-11 11:59 [PATCH 0/2] Checkpointing fixes Adam Kwolek
@ 2011-03-11 11:59 ` Adam Kwolek
  2011-03-11 11:59 ` [PATCH 2/2] imsm: FIX: Store checkpoint " Adam Kwolek
  2011-03-14  7:22 ` [PATCH 0/2] Checkpointing fixes NeilBrown
  2 siblings, 0 replies; 4+ messages in thread
From: Adam Kwolek @ 2011-03-11 11:59 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

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 <adam.kwolek@intel.com>
---

 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);


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] imsm: FIX: Store checkpoint in per disk units
  2011-03-11 11:59 [PATCH 0/2] Checkpointing fixes Adam Kwolek
  2011-03-11 11:59 ` [PATCH 1/2] FIX: Last_checkpoint has to be initialized in per disk units Adam Kwolek
@ 2011-03-11 11:59 ` Adam Kwolek
  2011-03-14  7:22 ` [PATCH 0/2] Checkpointing fixes NeilBrown
  2 siblings, 0 replies; 4+ messages in thread
From: Adam Kwolek @ 2011-03-11 11:59 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

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 <adam.kwolek@intel.com>
---

 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);


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Checkpointing fixes
  2011-03-11 11:59 [PATCH 0/2] Checkpointing fixes Adam Kwolek
  2011-03-11 11:59 ` [PATCH 1/2] FIX: Last_checkpoint has to be initialized in per disk units Adam Kwolek
  2011-03-11 11:59 ` [PATCH 2/2] imsm: FIX: Store checkpoint " Adam Kwolek
@ 2011-03-14  7:22 ` NeilBrown
  2 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2011-03-14  7:22 UTC (permalink / raw)
  To: Adam Kwolek
  Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

On Fri, 11 Mar 2011 12:59:04 +0100 Adam Kwolek <adam.kwolek@intel.com> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-14  7:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-11 11:59 [PATCH 0/2] Checkpointing fixes Adam Kwolek
2011-03-11 11:59 ` [PATCH 1/2] FIX: Last_checkpoint has to be initialized in per disk units Adam Kwolek
2011-03-11 11:59 ` [PATCH 2/2] imsm: FIX: Store checkpoint " Adam Kwolek
2011-03-14  7:22 ` [PATCH 0/2] Checkpointing fixes NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).