Received: by 10.192.165.148 with SMTP id m20csp525661imm; Wed, 25 Apr 2018 03:40:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+B/uKMrjGUDLQbS6oghG+uj4tGjM09ymxWvbTzdFldDhfOnyTJqt/eYRUWqPDeuWLd+2AE X-Received: by 10.98.8.133 with SMTP id 5mr27797994pfi.154.1524652829257; Wed, 25 Apr 2018 03:40:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524652829; cv=none; d=google.com; s=arc-20160816; b=V4FTh1RSt7nLR/DDQ7YTD1yRcBQH421WVZwYOS6vL5Q8zd1IUgyDRYMl0Xz5IpRcg0 pe1m/RF5MUsBx19Tf5bhkJ83pFpv4qr/soxi54Rr0/zO+Tij0GO7Vb8tIJ0T94GyxOFW mjt8elqYFVe/nyCeXPk9vBbXPYNrMilRrqIaG9XnpMaEZDKrI73yqkxDw6hbk5OsJRDH u13CctlVciFI0/POxBs3l7w3DycPiTiE7LLGDfVI2Sbo27FcUB49Z/5fi1oYkBb5psVj mA3GQQYnUCdgdD4Ic8et3kDuqcgJaxWdA1z8M/1u42pgvg6bCRwthuWX/Ss7og0oOk/n KCwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=og0TpxR1x/UTlATeGxD/kf0Q4SVM17ci7gdjuXVp7GQ=; b=ZqCtrkjdy2Bjd4aMJ/5BQejTqFMwD8QZZLg7CelTDm/uvo1/MPeJ8ozw6aIwrsVTeJ KbTNPsnIDGtv3lYepchJOhvABIkkHhAvUmUMlPAkZ8/qEuOjuM67R4UQ3cn2/d7PRFSX jvKnGyedpoo/9PpchcDQLeRLnKv5oJh9nEAeA6N9IYMPAfYQpznRJCUUkFVIRoTyC8Hs loFlVCH157k80WPYI8w9F0S9s87O7VYd110evInDr+KLxyz/p+CV5Tme/w10BgmRNvya 1lstT5bv0LAbucWJIQAvDEE942KbONBtzNKVGoliMYG2XIRV6F30F2u9k4FVU4v2yVv7 jzag== ARC-Authentication-Results: i=1; mx.google.com; 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 66si15771500pfm.167.2018.04.25.03.40.14; Wed, 25 Apr 2018 03:40:29 -0700 (PDT) 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; 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 S1753508AbeDYKiy (ORCPT + 99 others); Wed, 25 Apr 2018 06:38:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51644 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752806AbeDYKis (ORCPT ); Wed, 25 Apr 2018 06:38:48 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 81A6636; Wed, 25 Apr 2018 10:38:47 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ming Lei , Mike Snitzer , Sasha Levin Subject: [PATCH 4.14 047/183] dm mpath: return DM_MAPIO_REQUEUE on blk-mq rq allocation failure Date: Wed, 25 Apr 2018 12:34:27 +0200 Message-Id: <20180425103244.450168940@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ming Lei [ Upstream commit 050af08ffb1b62af69196d61c22a0755f9a3cdbd ] blk-mq will rerun queue via RESTART or dispatch wake after one request is completed, so not necessary to wait random time for requeuing, we should trust blk-mq to do it. More importantly, we need to return BLK_STS_RESOURCE to blk-mq so that dequeuing from the I/O scheduler can be stopped, this results in improved I/O merging. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-mpath.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -502,8 +502,20 @@ static int multipath_clone_and_map(struc if (queue_dying) { atomic_inc(&m->pg_init_in_progress); activate_or_offline_path(pgpath); + return DM_MAPIO_DELAY_REQUEUE; } - return DM_MAPIO_DELAY_REQUEUE; + + /* + * blk-mq's SCHED_RESTART can cover this requeue, so we + * needn't deal with it by DELAY_REQUEUE. More importantly, + * we have to return DM_MAPIO_REQUEUE so that blk-mq can + * get the queue busy feedback (via BLK_STS_RESOURCE), + * otherwise I/O merging can suffer. + */ + if (q->mq_ops) + return DM_MAPIO_REQUEUE; + else + return DM_MAPIO_DELAY_REQUEUE; } clone->bio = clone->biotail = NULL; clone->rq_disk = bdev->bd_disk;