Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2283039ybl; Thu, 19 Dec 2019 10:59:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxHBAtH8mgerDl2fRRq0r551izhEBDlYFOaTm94jyRyw+hRsda1OTzgANcyZ6a8jVvQiq0t X-Received: by 2002:a05:6830:2154:: with SMTP id r20mr10447968otd.66.1576781968418; Thu, 19 Dec 2019 10:59:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781968; cv=none; d=google.com; s=arc-20160816; b=potVb/2pqe+JrBmu2nirbAyGKzvcFZ78vszAit5r2s/spC3sbz/r0qUvyN0WUiuzQp MlkMl5jXL1jnRs+y+sZYCCTgH1o7jKjdAoNn4WbQClua9KLL3q5S7SZ04Ih2L9OoTO/F 62+AmxXzUi7G4KXejtVgpL0m1VyuGicdYDPI10cS1MGRGUvXwwQQcK7LaKosk3AGGD66 VslDU977YSn3257E4yI1b7bOWw2Bd0fpqiV+YdnuGO9moU2hceg+4HuyUEME6wTqaU1o CL+tlkkBhaj1fI4sXsYAhlbMp6JJcKKc2aIvX3TY7SZZbeqHxrfO6ynLYlHgDmDNEScM X44A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ei5FHaGA0eoqCkt5xRhr6KZ04dCQQrB9w+zcfWn6sH8=; b=jDdJ1uGKyI+REWvJXqf6/sc3BD+7ZknoXyKkhGOzBDJ/ifz//L2aTO7X1ZjmMqf2Cp k+xyiiRtj0aRvNbsz2ekrC7t84GPGfPVZHm95Q/OlH7V6whmYDjpc7ejis63ld6FIKAP mJYEynYz0Up5OKlFOrOUq0IfqC2Av5FJQk3iDDzk8MAuQM9vWpArXcW6QDZKobPv+2Te gZaE+ASSkHaZv7SIcznqEsNgUM+UFM1Xm4sG0ymGGB4SDEDFwmrxFlxT2G4rjROrgdqW fu1+7AGRLYv+JQtbzw4CHoSrOeT+9qFfntzJvhY5Y+Eso8w+je/DAtBUKZtab/pWw7VO Z5fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Okc2/OAN"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si4601267otn.319.2019.12.19.10.59.17; Thu, 19 Dec 2019 10:59:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Okc2/OAN"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729639AbfLSS6K (ORCPT + 99 others); Thu, 19 Dec 2019 13:58:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:51120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730628AbfLSSzO (ORCPT ); Thu, 19 Dec 2019 13:55:14 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5CC9C206EC; Thu, 19 Dec 2019 18:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781713; bh=5st4cU/3+nJwVjU3ZZLpWcpG5MzT9cAPUeSwz37zL3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Okc2/OANmQV7CmJS0wY//uJKAhaZ93uWpyo0QTVWT5AMAx78AIr+XT+DlJMfNWbrV ay06rJtSbDedeEbKAS/rlqoRD6o4LAAKmttiEzOIRcGIRh0XHuLxpFtoluHOvFGDyO LTljE84o8D9rggxOFruqYQEsL6rNwocDAtUPVmQc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Drew Hastings , Martin Wilck , Mike Snitzer Subject: [PATCH 5.4 51/80] dm mpath: remove harmful bio-based optimization Date: Thu, 19 Dec 2019 19:34:43 +0100 Message-Id: <20191219183122.215929134@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183031.278083125@linuxfoundation.org> References: <20191219183031.278083125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Snitzer commit dbaf971c9cdf10843071a60dcafc1aaab3162354 upstream. Removes the branching for edge-case where no SCSI device handler exists. The __map_bio_fast() method was far too limited, by only selecting a new pathgroup or path IFF there was a path failure, fix this be eliminating it in favor of __map_bio(). __map_bio()'s extra SCSI device handler specific MPATHF_PG_INIT_REQUIRED test is not in the fast path anyway. This change restores full path selector functionality for bio-based configurations that don't haave a SCSI device handler. But it should be noted that the path selectors do have an impact on performance for certain networks that are extremely fast (and don't require frequent switching). Fixes: 8d47e65948dd ("dm mpath: remove unnecessary NVMe branching in favor of scsi_dh checks") Cc: stable@vger.kernel.org Reported-by: Drew Hastings Suggested-by: Martin Wilck Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-mpath.c | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -599,45 +599,10 @@ static struct pgpath *__map_bio(struct m return pgpath; } -static struct pgpath *__map_bio_fast(struct multipath *m, struct bio *bio) -{ - struct pgpath *pgpath; - unsigned long flags; - - /* Do we need to select a new pgpath? */ - /* - * FIXME: currently only switching path if no path (due to failure, etc) - * - which negates the point of using a path selector - */ - pgpath = READ_ONCE(m->current_pgpath); - if (!pgpath) - pgpath = choose_pgpath(m, bio->bi_iter.bi_size); - - if (!pgpath) { - if (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) { - /* Queue for the daemon to resubmit */ - spin_lock_irqsave(&m->lock, flags); - bio_list_add(&m->queued_bios, bio); - spin_unlock_irqrestore(&m->lock, flags); - queue_work(kmultipathd, &m->process_queued_bios); - - return ERR_PTR(-EAGAIN); - } - return NULL; - } - - return pgpath; -} - static int __multipath_map_bio(struct multipath *m, struct bio *bio, struct dm_mpath_io *mpio) { - struct pgpath *pgpath; - - if (!m->hw_handler_name) - pgpath = __map_bio_fast(m, bio); - else - pgpath = __map_bio(m, bio); + struct pgpath *pgpath = __map_bio(m, bio); if (IS_ERR(pgpath)) return DM_MAPIO_SUBMITTED;