All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] dm-multipath: delay retry of bypassed pg
@ 2012-04-17  5:46 michaelc
  2012-04-27 19:39 ` Mike Snitzer
  0 siblings, 1 reply; 2+ messages in thread
From: michaelc @ 2012-04-17  5:46 UTC (permalink / raw)
  To: dm-devel; +Cc: Mike Christie

From: Mike Christie <michaelc@cs.wisc.edu>

If there are only bypassed PGs available then we do not want
to retry right away. If for example the controller was getting
reset or there was a fw upgrade going on and that was the reason
for the bypass, then retrying right away is going to cause a flood of
log messages and retries for what could be a longish time (more than
a couple seconds and possible up to several minutes).

For the case where the only PGs are ones that are bypassed this
patch will have dm-multipath delay the pg init by setting the
pg_init_delay_retry flag.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/md/dm-mpath.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 801d92d..65e0d26 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -307,14 +307,18 @@ static void __choose_pgpath(struct multipath *m, size_t nr_bytes)
 	/*
 	 * Loop through priority groups until we find a valid path.
 	 * First time we skip PGs marked 'bypassed'.
-	 * Second time we only try the ones we skipped.
+	 * Second time we only try the ones we skipped, but will set
+	 * pg_init_delay_retry so we do not hammer controllers.
 	 */
 	do {
 		list_for_each_entry(pg, &m->priority_groups, list) {
 			if (pg->bypassed == bypassed)
 				continue;
-			if (!__choose_path_in_pg(m, pg, nr_bytes))
+			if (!__choose_path_in_pg(m, pg, nr_bytes)) {
+				if (!bypassed)
+					m->pg_init_delay_retry = 1;
 				return;
+			}
 		}
 	} while (bypassed--);
 
-- 
1.7.7.6

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

* Re: [PATCH 1/1] dm-multipath: delay retry of bypassed pg
  2012-04-17  5:46 [PATCH 1/1] dm-multipath: delay retry of bypassed pg michaelc
@ 2012-04-27 19:39 ` Mike Snitzer
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Snitzer @ 2012-04-27 19:39 UTC (permalink / raw)
  To: device-mapper development; +Cc: Mike Christie

On Tue, Apr 17 2012 at  1:46am -0400,
michaelc@cs.wisc.edu <michaelc@cs.wisc.edu> wrote:

> From: Mike Christie <michaelc@cs.wisc.edu>
> 
> If there are only bypassed PGs available then we do not want
> to retry right away. If for example the controller was getting
> reset or there was a fw upgrade going on and that was the reason
> for the bypass, then retrying right away is going to cause a flood of
> log messages and retries for what could be a longish time (more than
> a couple seconds and possible up to several minutes).
> 
> For the case where the only PGs are ones that are bypassed this
> patch will have dm-multipath delay the pg init by setting the
> pg_init_delay_retry flag.
> 
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>

Acked-by: Mike Snitzer <snitzer@redhat.com>

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

end of thread, other threads:[~2012-04-27 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-17  5:46 [PATCH 1/1] dm-multipath: delay retry of bypassed pg michaelc
2012-04-27 19:39 ` Mike Snitzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.