From patchwork Wed Aug 13 18:53:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 4720451 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 362D69F375 for ; Wed, 13 Aug 2014 18:59:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74BE6201BF for ; Wed, 13 Aug 2014 18:59:25 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mail.kernel.org (Postfix) with ESMTP id 73FA62018B for ; Wed, 13 Aug 2014 18:59:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s7DIrqWO030104; Wed, 13 Aug 2014 14:53:53 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s7DIrpEE027167 for ; Wed, 13 Aug 2014 14:53:51 -0400 Received: from dhcp80-209.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7DIroTt009515 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 13 Aug 2014 14:53:50 -0400 Received: from dhcp80-209.msp.redhat.com (localhost [127.0.0.1]) by dhcp80-209.msp.redhat.com (8.14.7/8.14.7) with ESMTP id s7DIrnGi032407; Wed, 13 Aug 2014 13:53:49 -0500 Received: (from bmarzins@localhost) by dhcp80-209.msp.redhat.com (8.14.7/8.14.7/Submit) id s7DIrmjI032406; Wed, 13 Aug 2014 13:53:48 -0500 From: Benjamin Marzinski To: device-mapper development Date: Wed, 13 Aug 2014 13:53:42 -0500 Message-Id: <1407956023-32372-2-git-send-email-bmarzins@redhat.com> In-Reply-To: <1407956023-32372-1-git-send-email-bmarzins@redhat.com> References: <1407956023-32372-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: dm-devel@redhat.com Cc: Junichi Nomura Subject: [dm-devel] [PATCH 1/2] dm-multipath: cleanup IO queueing after table load X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit e809917735ebf1b9a56c24e877ce0d320baee2ec changed the code in multipath_busy that checked if a multipath device was initializing a path. It returned busy if queue_io was set on the device. However queue_io is set when the table is loaded, and as long as the device was busy, multipath_map wouldn't run to clear it upon receiving requsts. multipath_ioctl and reinstate_path were still able to clear queue_io. But if no paths were reinstated and the multipath device received no ioctls after the table reload, all requests to it would simply queue. This patch switches the multipath_busy code to check for a pending or in progress path initialization, without using queue_io. This means incoming requests will allow multipath_map to initialize paths and clear queue_io. This patch also changes __choose_pgpath to make it clear queue_io if there are no valid paths, since there are obviously no paths that can be initialized. Signed-off-by: Benjamin Marzinski --- drivers/md/dm-mpath.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 3f6fd9d..a0b83cb 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -317,8 +317,10 @@ static void __choose_pgpath(struct multipath *m, size_t nr_bytes) struct priority_group *pg; unsigned bypassed = 1; - if (!m->nr_valid_paths) + if (!m->nr_valid_paths) { + m->queue_io = 0; goto failed; + } /* Were we instructed to switch PG? */ if (m->next_pg) { @@ -1612,7 +1614,7 @@ static int multipath_busy(struct dm_target *ti) spin_lock_irqsave(&m->lock, flags); /* pg_init in progress, requeue until done */ - if (!pg_ready(m)) { + if (m->pg_init_required || m->pg_init_in_progress) { busy = 1; goto out; }