From patchwork Thu Jan 18 10:30:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Kusiak X-Patchwork-Id: 13522681 X-Patchwork-Delegate: mariusz.tkaczyk@linux.intel.com Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8E60EA5 for ; Thu, 18 Jan 2024 10:30:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=134.134.136.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573839; cv=none; b=QmzQuArxxh9IzreeA9bGsjAUjVGCcbgHb2fi43H5zJK+hxQGcyeBUd8DMJTUfU+Vr0warX5OIj+rZJlrubQqNNAkCDq6oyNgcNj+QNfcUjCzUoO55cczyXgvZnMJKTqBsJ4xZERDh7oMFr4iKe1x72cVo5NyJM7PINbVRCpMWao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573839; c=relaxed/simple; bh=DKnwUS+L9eXjPzconwL6Yc+EhI/8wQ1SrQSU9hTCXS0=; h=DKIM-Signature:X-IronPort-AV:X-IronPort-AV:Received:X-ExtLoop1: X-IronPort-AV:X-IronPort-AV:Received:From:To:Cc:Subject:Date: Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=cF0UM9JiPbFIZg22Fc4M2NmWJTlfYw1a/VZbF0af6kHtXxjj1VVu67LUvR2Wjk3rlt+53xLmY8gZWV5oMV9PNba/fO1X7TiSDsCPS3oBcSYNmG8ko5ARktMnMLUf8rqS+ZuqOwEZQg0Hpt661RZ9NWvr3FGumbrAkWG+Pb8pZRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NkwJoii7; arc=none smtp.client-ip=134.134.136.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NkwJoii7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705573837; x=1737109837; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DKnwUS+L9eXjPzconwL6Yc+EhI/8wQ1SrQSU9hTCXS0=; b=NkwJoii7rf1Sr67UnwJ+rtJC2+hNPWtGOckkFn1kiuSO1+xebcvy7WFx 065dFxbe+EAtd65jBjRtK5W6j8fWhuv91SKHPLZ1QgR51K65MAUlf41ts EIaR3bHgI9z5zox1WWRt2d/vywB8RsTWiEVXHRzAsCCqzY2om8IomzEar EcpZwmtG03vtqE/5suoh3aQcC5Ixu9umvXUSVQcaysHMxPy1qBlHOi2EW /WKtzY/VaCvOaCVqDjZNIc06rflqdOvYUWGFwR/TNxWgAY3u9HC1IGtmV VBPcO8jZIImKBXic9S2fjCp/EMT/wEPTyNry5inz92jozQlFBUHwDtoNI Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="390858535" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="390858535" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2024 02:30:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="1115926965" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="1115926965" Received: from patodeveloperka.igk.intel.com ([10.102.109.29]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2024 02:30:35 -0800 From: Mateusz Kusiak To: linux-raid@vger.kernel.org Cc: jes@trained-monkey.org, mariusz.tkaczyk@linux.intel.com Subject: [PATCH v2 1/5] Remove hardcoded checkpoint interval checking Date: Thu, 18 Jan 2024 11:30:15 +0100 Message-Id: <20240118103019.12385-2-mateusz.kusiak@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240118103019.12385-1-mateusz.kusiak@intel.com> References: <20240118103019.12385-1-mateusz.kusiak@intel.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Mdmon assumes that kernel marks checkpoint every 1/16 of the volume size and that the checkpoints are equal in size. This is not true, kernel may mark checkpoints more frequently depending on several factors, including sync speed. This results in checkpoints reported by mdadm --examine falling behind the one reported by kernel. Remove hardcoded checkpoint interval checking. Signed-off-by: Mateusz Kusiak --- monitor.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/monitor.c b/monitor.c index 4acec6783e6e..b8d9e8810b17 100644 --- a/monitor.c +++ b/monitor.c @@ -564,22 +564,10 @@ static int read_and_act(struct active_array *a, fd_set *fds) } } - /* Check for recovery checkpoint notifications. We need to be a - * minimum distance away from the last checkpoint to prevent - * over checkpointing. Note reshape checkpointing is handled - * in the second branch. + /* Handle reshape checkpointing */ - if (sync_completed > a->last_checkpoint && - sync_completed - a->last_checkpoint > a->info.component_size >> 4 && - a->curr_action > reshape) { - /* A (non-reshape) sync_action has reached a checkpoint. - * Record the updated position in the metadata - */ - a->last_checkpoint = sync_completed; - a->container->ss->set_array_state(a, a->curr_state <= clean); - } else if ((a->curr_action == idle && a->prev_action == reshape) || - (a->curr_action == reshape && - sync_completed > a->last_checkpoint)) { + if ((a->curr_action == idle && a->prev_action == reshape) || + (a->curr_action == reshape && sync_completed > a->last_checkpoint)) { /* Reshape has progressed or completed so we need to * update the array state - and possibly the array size */ @@ -607,8 +595,10 @@ static int read_and_act(struct active_array *a, fd_set *fds) a->last_checkpoint = sync_completed; } - if (sync_completed > a->last_checkpoint) + if (sync_completed > a->last_checkpoint) { a->last_checkpoint = sync_completed; + a->container->ss->set_array_state(a, a->curr_state <= clean); + } if (sync_completed >= a->info.component_size) a->last_checkpoint = 0; From patchwork Thu Jan 18 10:30:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Kusiak X-Patchwork-Id: 13522682 X-Patchwork-Delegate: mariusz.tkaczyk@linux.intel.com Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A077728F2 for ; Thu, 18 Jan 2024 10:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=134.134.136.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573847; cv=none; b=Bt+57GHJkP8685Ar4R66wIrZdB998alagFhYyNLx7rY+bxO+XE5jrwkRM5qrcXUd9KdmFXAmZvRDlujCxneyXyhAGdbZWDQLdaiA1bAHKGCmL3M7rKtTCf/lwxU2t0A2ygbdIpsFjg2xmq4OLtEWh6Ws13wT11PP/6JaXe/0Omc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573847; c=relaxed/simple; bh=+TXPfOz+kf8ZbFh9gmhB/Q6LaX3NqxfvCBcjwy5ZBZc=; h=DKIM-Signature:X-IronPort-AV:X-IronPort-AV:Received:X-ExtLoop1: X-IronPort-AV:X-IronPort-AV:Received:From:To:Cc:Subject:Date: Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=lVWINP11s2vUnFP/M9ZOUvLPiUa8TZtZGdBXqaKhxHHuo9weyEI9rY5oq1K5ldHZN1Rt1/ET8Z0CL8s66qcIRGsWVclKvyUvb34aOrLZKqbneyIKxgKYJvygzNRxRY8iJwA5GiasF5hAqhJixNux7eQlCDldXSMX3INB1tiSrUY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LHKcNfAr; arc=none smtp.client-ip=134.134.136.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LHKcNfAr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705573845; x=1737109845; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+TXPfOz+kf8ZbFh9gmhB/Q6LaX3NqxfvCBcjwy5ZBZc=; b=LHKcNfArSHytARqBIX+CN6W/IVLf1VAl4F+SEINFZ28pk/SGjLbQwlky 8GQXqhD3imC0Xz03rAdUsX9Y/r0vrOUNpS2GDA8JAH4YLNr28OJ5UFUCH ATRPlrR0pSLpyzpHZM18xFRnd+FDNqYsKg4TmaYpxPiOKrvfGXFqPZRVP krKm6RKko7+53Wj3fr2/ACO3R8GU0vji55vdSHUsIwYORZspeAFLePQu1 2M85fwxzP+N0RB10l+siM+jsOKpp4/YY6lx+1WsX73oPriUjzQXGxvSu0 l1v9dcA4J7A2+hOll8MwPQ65WDASTVOrv5db3+NYXrXEG7x+Lj46L2VBQ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="390858558" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="390858558" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2024 02:30:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="1115926993" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="1115926993" Received: from patodeveloperka.igk.intel.com ([10.102.109.29]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2024 02:30:43 -0800 From: Mateusz Kusiak To: linux-raid@vger.kernel.org Cc: jes@trained-monkey.org, mariusz.tkaczyk@linux.intel.com Subject: [PATCH v2 2/5] monitor: refactor checkpoint update Date: Thu, 18 Jan 2024 11:30:16 +0100 Message-Id: <20240118103019.12385-3-mateusz.kusiak@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240118103019.12385-1-mateusz.kusiak@intel.com> References: <20240118103019.12385-1-mateusz.kusiak@intel.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 "if" statements of checkpoint updates have too many responsibilties. This results in unclear code flow and duplicated code. Refactor checkpoint update code and simplify "if" statements. Signed-off-by: Mateusz Kusiak --- monitor.c | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/monitor.c b/monitor.c index b8d9e8810b17..be0bec785080 100644 --- a/monitor.c +++ b/monitor.c @@ -412,6 +412,7 @@ static int read_and_act(struct active_array *a, fd_set *fds) int ret = 0; int count = 0; struct timeval tv; + bool write_checkpoint = false; a->next_state = bad_word; a->next_action = bad_action; @@ -564,40 +565,38 @@ static int read_and_act(struct active_array *a, fd_set *fds) } } - /* Handle reshape checkpointing - */ - if ((a->curr_action == idle && a->prev_action == reshape) || - (a->curr_action == reshape && sync_completed > a->last_checkpoint)) { - /* Reshape has progressed or completed so we need to - * update the array state - and possibly the array size - */ + /* Update reshape checkpoint, depending if it finished or progressed */ + if (a->curr_action == idle && a->prev_action == reshape) { + char buf[SYSFS_MAX_BUF_SIZE]; + if (sync_completed != 0) a->last_checkpoint = sync_completed; - /* We might need to update last_checkpoint depending on - * the reason that reshape finished. - * if array reshape is really finished: - * set check point to the end, this allows - * set_array_state() to finalize reshape in metadata - * if reshape if broken: do not set checkpoint to the end - * this allows for reshape restart from checkpoint + + /* + * If reshape really finished, set checkpoint to the end to finalize it. + * Do not set checkpoint if reshape is broken. + * Reshape will restart from last checkpoint. */ - if ((a->curr_action != reshape) && - (a->prev_action == reshape)) { - char buf[SYSFS_MAX_BUF_SIZE]; - if ((sysfs_get_str(&a->info, NULL, - "reshape_position", - buf, - sizeof(buf)) >= 0) && - str_is_none(buf) == true) + if (sysfs_get_str(&a->info, NULL, "reshape_position", buf, sizeof(buf)) >= 0) + if (str_is_none(buf) == true) a->last_checkpoint = a->info.component_size; - } - a->container->ss->set_array_state(a, a->curr_state <= clean); - a->last_checkpoint = sync_completed; + + write_checkpoint = true; } - if (sync_completed > a->last_checkpoint) { + if (a->curr_action >= reshape && sync_completed > a->last_checkpoint) { + /* Update checkpoint if neither reshape nor idle action */ a->last_checkpoint = sync_completed; + + write_checkpoint = true; + } + + /* Save checkpoint */ + if (write_checkpoint) { a->container->ss->set_array_state(a, a->curr_state <= clean); + + if (a->curr_action <= reshape) + a->last_checkpoint = sync_completed; } if (sync_completed >= a->info.component_size) From patchwork Thu Jan 18 10:30:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Kusiak X-Patchwork-Id: 13522683 X-Patchwork-Delegate: mariusz.tkaczyk@linux.intel.com Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28B55A42 for ; Thu, 18 Jan 2024 10:30:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=134.134.136.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573856; cv=none; b=Fv6lSscW7NtDPdplm4jOAh2uATDVj1l3zfZq3ZmUzme1GLGyXX/EDaes9pe4X+WboFUUcDbj0cz1ipbUAApNJU9YaBk3DgWZUf0RPxKR4zTihGK+qII5st3G1RfmjnpLkCLOszGaUo5M7IVs2BMoRdQjbUuYMI/KGLljbxkGHz0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573856; c=relaxed/simple; bh=Oyz++gXu86lZR46CWuAnPcCf+JC4oYux74InBvpIY48=; h=DKIM-Signature:X-IronPort-AV:X-IronPort-AV:Received:X-ExtLoop1: X-IronPort-AV:X-IronPort-AV:Received:From:To:Cc:Subject:Date: Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=f0eV8N4z8Uxm1YvPlAXTJHY696Jii9hIuuu9zObU41EGjMirAhoYFH6PygwTfn2Qnqz6Gmszh+SsOEzzro9Cqmtf/vDiA2t6XyUTM6Mi5aWjeHUYrXqrnqFhPs9N5SefqPas9s+4+v7ghs5FWhSh2rNmFQypmOrbKqwhVviPpD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=bM9CZnsM; arc=none smtp.client-ip=134.134.136.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bM9CZnsM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705573855; x=1737109855; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oyz++gXu86lZR46CWuAnPcCf+JC4oYux74InBvpIY48=; b=bM9CZnsMrWODPf8ZnOOMQSloEwehHChJR6x3A4gft4InaVSTOyI36SnZ rkbR1TdxEyJBlqi/2af9pQjej3d2FL6o4hxiC7ws9fPDpNvsDod4Kqeet i7A3NVv5Yn0/nFet6Ij048L6tBnelAwnJBN7b3/36WPevu6QIfzF7LC0B SEc0ZNaIKpnOvAoyMBoc532dxeNbOLv9W62uEcfdodsasc8N216NV8dfw 0cziTSYvEHdKzxqlpaHXIH5UiIJs7aVH5M38nylBYmqvQvHlDCSUea3Pp MjpbkbJ3+Q4h3gErRHRYBPylaabG5LqpxMnJaS33HcXzCrcMHde5Bf7jO g==; X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="390858564" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="390858564" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2024 02:30:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="1115927039" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="1115927039" Received: from patodeveloperka.igk.intel.com ([10.102.109.29]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2024 02:30:53 -0800 From: Mateusz Kusiak To: linux-raid@vger.kernel.org Cc: jes@trained-monkey.org, mariusz.tkaczyk@linux.intel.com Subject: [PATCH v2 3/5] Super-intel: Fix first checkpoint restart Date: Thu, 18 Jan 2024 11:30:17 +0100 Message-Id: <20240118103019.12385-4-mateusz.kusiak@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240118103019.12385-1-mateusz.kusiak@intel.com> References: <20240118103019.12385-1-mateusz.kusiak@intel.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When imsm based array is stopped after reaching first checkpoint and then assembled, first checkpoint is reported as 0. This behaviour is valid only for initial checkpoint, if the array was stopped while performing some action. Last checkpoint value is not taken from metadata but always starts with 0 and it's incremented when sync_completed in sysfs changes. In simplification, read_and_act() is responsible for checkpoint updates and is executed each time sysfs checkpoint update happens. For first checkpoint it is executed twice and due to marking checkpoint before triggering any action on the array, it is impossible to read sync_completed from sysfs in just two iterations. The workaround to this is not marking any checkpoint for first sysfs checkpoint after RAID assembly, to preserve checkpoint value stored in metadata. Signed-off-by: Mateusz Kusiak --- super-intel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/super-intel.c b/super-intel.c index 6a664a2e58d3..ebf43209e75d 100644 --- a/super-intel.c +++ b/super-intel.c @@ -8741,6 +8741,9 @@ static int imsm_set_array_state(struct active_array *a, int consistent) super->updates_pending++; } + if (a->prev_action == idle) + goto skip_mark_checkpoint; + mark_checkpoint: /* skip checkpointing for general migration, * it is controlled in mdadm From patchwork Thu Jan 18 10:30:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Kusiak X-Patchwork-Id: 13522684 X-Patchwork-Delegate: mariusz.tkaczyk@linux.intel.com Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C30A8EA5 for ; Thu, 18 Jan 2024 10:31:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=134.134.136.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573866; cv=none; b=bjn1/RLVFzccbcRUGqJliBLlRpFCi00Ip9TxslkESy3iwMz9SqEh9RIjw+G+4ZwGTUlb9I9n2mHRb4QhajOevDLNU6OU7s2tz+vO520M7xv6W8WpT1U1vzAWYSL03DJw2eCVWik1PqMn8cLa/JXgf9y/WRTMdmGIBx6L+l68KdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573866; c=relaxed/simple; bh=bPqdCBNCtFJ6rYiCOTKYqNDBlaXmmDRJ76b5eSdNank=; h=DKIM-Signature:X-IronPort-AV:X-IronPort-AV:Received:X-ExtLoop1: X-IronPort-AV:X-IronPort-AV:Received:From:To:Cc:Subject:Date: Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=qVV9ct0onWDBl5oZABsJQ2tBmzycgAdlxyyB/foEqHpL5WHU7ccvjf5VRwgJ8q2mTLiG3eKcEgd76XQ/wAZWVspIpqYnqdDvZXVosjjabq1AWRYWA9C2EtC5Gs/b1NtJ4eOpRVJeujQW/BwkiGVINSi2lEEgtgCB2lY18NwHMBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=abWeP8rU; arc=none smtp.client-ip=134.134.136.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="abWeP8rU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705573864; x=1737109864; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bPqdCBNCtFJ6rYiCOTKYqNDBlaXmmDRJ76b5eSdNank=; b=abWeP8rUe2g6TurQSCOrpqp06pmpWaSIfU81rZokHjiVDT1Nihve6hjf /UyOhbGumINfmQk6roW13b4HcG7Hn5B+k76NAPQnIpiDfvrUEfSVsj2Jb fEk7lZ9QsrhZyyUBcj9DmErFCqhzwJ3LANjyDVFXXWqmf0n8gABLokJKN Ms45oHQLFzR5t68GjfpdsByA8jbg2uEgERd0L3oVuZruVGly4o1tKAFBZ X0xaKG0js9Ibxgnwm+FBq6TLgkMOrspjIE13u8tVU5WlJbiZUjksJChgj bEK8yN2Hu7OW4xNAP7hszTA5CpVPwOutJc1rLpv6YjzpBtnmJ7TYjhIml Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="390858574" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="390858574" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2024 02:31:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="1115927098" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="1115927098" Received: from patodeveloperka.igk.intel.com ([10.102.109.29]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2024 02:31:02 -0800 From: Mateusz Kusiak To: linux-raid@vger.kernel.org Cc: jes@trained-monkey.org, mariusz.tkaczyk@linux.intel.com Subject: [PATCH v2 4/5] Grow: Move update_tail assign to Grow_reshape() Date: Thu, 18 Jan 2024 11:30:18 +0100 Message-Id: <20240118103019.12385-5-mateusz.kusiak@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240118103019.12385-1-mateusz.kusiak@intel.com> References: <20240118103019.12385-1-mateusz.kusiak@intel.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Due to e919fb0af245 ("FIX: Enable metadata updates for raid0") code can't enter super-intel.c:3415, resulting in checkpoint not being saved to metadata for second volume in matrix raid array. This results in checkpoint being stuck at last value for the first volume. Move st->update_tail to Grow_reshape() so it is assigned for each volume. Signed-off-by: Mateusz Kusiak --- Grow.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Grow.c b/Grow.c index f95dae82ef0d..5498e54fec11 100644 --- a/Grow.c +++ b/Grow.c @@ -2085,9 +2085,10 @@ int Grow_reshape(char *devname, int fd, if (!mdmon_running(st->container_devnm)) start_mdmon(st->container_devnm); ping_monitor(container); - if (mdmon_running(st->container_devnm) && - st->update_tail == NULL) - st->update_tail = &st->updates; + if (mdmon_running(st->container_devnm) == false) { + pr_err("No mdmon found. Grow cannot continue.\n"); + goto release; + } } if (s->size == MAX_SIZE) @@ -3048,6 +3049,8 @@ static int reshape_array(char *container, int fd, char *devname, dprintf("Cannot get array information.\n"); goto release; } + if (st->update_tail == NULL) + st->update_tail = &st->updates; if (array.level == 0 && info->component_size == 0) { get_dev_size(fd, NULL, &array_size); info->component_size = array_size / array.raid_disks; @@ -5152,9 +5155,7 @@ int Grow_continue_command(char *devname, int fd, start_mdmon(container); ping_monitor(container); - if (mdmon_running(container)) - st->update_tail = &st->updates; - else { + if (mdmon_running(container) == false) { pr_err("No mdmon found. Grow cannot continue.\n"); ret_val = 1; goto Grow_continue_command_exit; From patchwork Thu Jan 18 10:30:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Kusiak X-Patchwork-Id: 13522685 X-Patchwork-Delegate: mariusz.tkaczyk@linux.intel.com Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5307BA42 for ; Thu, 18 Jan 2024 10:31:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=134.134.136.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573874; cv=none; b=l7vdECezo+d2ozec1R0Ly6dYPss4d2QZfLzZX1m60gkAFyy6yh69SUjCsp0fJobKiZF8UajCcMz2Y0jjF274Bozbc18F28l1zjuNFWavavjZLgsIfNSB5pSIh1/v87nVIQugmOvlbtG7GN6TIY8fgdo0S1uC8y7iDWNuWRKQolk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705573874; c=relaxed/simple; bh=TsOnc7GNV0SObV+4PfgwOMJXy/qUy2Pz9QqDtlNX+m8=; h=DKIM-Signature:X-IronPort-AV:X-IronPort-AV:Received:X-ExtLoop1: X-IronPort-AV:X-IronPort-AV:Received:From:To:Cc:Subject:Date: Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=PRhHq0Pgh/QWK0Wh5Lk6NW6RkRzSn1jbTOQcxAW7eVAH3RX/OPTFHkn/Nz0vAIDBISFQDg+EfNAs9VKX7lCvM6ux/k82W5qcaGINxRYr7D4Pe+RhSPfT4K5jdDyPYGC8O+saHr6EB3fvlmy4ksHzIYIRW6WwpFqAhXsiyILPckg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HVql9Ky9; arc=none smtp.client-ip=134.134.136.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HVql9Ky9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705573873; x=1737109873; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TsOnc7GNV0SObV+4PfgwOMJXy/qUy2Pz9QqDtlNX+m8=; b=HVql9Ky9y7VUkdMCBgeWSRegNVfKXRyYt6aN7TFVrvs9SnalRRghuiFN ZciBOh+urBHo1Oac5cNSbNEOkh9YY59ZHHbU+A5GPVpv+Jt+D7rCuLI2n VR6JKiPiEJoERsF1GMG+I/6GuVPZOoGIblDLLfQJY7zzll6WMepjl4WDF heSLr8AF6iD+ZpfjkPFiaLKcgRufKdqpZT11bjkgjducmXC7m4YBJ0s9p CHobKHC2IEMu8vj6FhLLbITpg6pznSqEX/q1Nw6U69+BO/AN5xDSZFpSs PEsMAiVFtI76l1OMYDgMU+m8XLuPXJKIhy+9JRlUI2MwblZ2pG3vlzFgz A==; X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="390858579" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="390858579" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2024 02:31:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="1115927105" X-IronPort-AV: E=Sophos;i="6.05,201,1701158400"; d="scan'208";a="1115927105" Received: from patodeveloperka.igk.intel.com ([10.102.109.29]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2024 02:31:11 -0800 From: Mateusz Kusiak To: linux-raid@vger.kernel.org Cc: jes@trained-monkey.org, mariusz.tkaczyk@linux.intel.com Subject: [PATCH v2 5/5] Add understanding output section in man Date: Thu, 18 Jan 2024 11:30:19 +0100 Message-Id: <20240118103019.12385-6-mateusz.kusiak@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240118103019.12385-1-mateusz.kusiak@intel.com> References: <20240118103019.12385-1-mateusz.kusiak@intel.com> Precedence: bulk X-Mailing-List: linux-raid@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add new section in man for explaining mdadm outputs. Describe checkpoint entry. Signed-off-by: Mateusz Kusiak --- mdadm.8.in | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/mdadm.8.in b/mdadm.8.in index 3142436f728c..e3033a957bb3 100644 --- a/mdadm.8.in +++ b/mdadm.8.in @@ -3179,7 +3179,7 @@ environment. This can be useful for testing or for disaster recovery. You should be aware that interoperability may be compromised by setting this value. -These change can also be suppressed by adding +These change can also be suppressed by adding .B mdadm.imsm.test=1 to the kernel command line. This makes it easy to test IMSM code in a virtual machine that doesn't have IMSM virtual hardware. @@ -3454,6 +3454,25 @@ is any string. These names are supported by since version 3.3 provided they are enabled in .IR mdadm.conf . +.SH UNDERSTANDING OUTPUT + +.TP +EXAMINE + +.TP +.B checkpoint +Checkpoint value is reported when array is performing some action including +resync, recovery or reshape. Checkpoints allow resuming action from certain +point if it was interrupted. + +Checkpoint is reported as combination of two values: current migration unit +and number of blocks per unit. By multiplying those values and dividing by +array size checkpoint progress percentage can be obtained in relation to +current progress reported in /proc/mdstat. Checkpoint is also related to (and +sometimes based on) sysfs entry sync_completed but depending on action units +may differ. Even if units are the same, it should not be expected that +checkpoint and sync_completed will be exact match nor updated simultaneously. + .SH NOTE .I mdadm was previously known as