Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp62861imu; Thu, 6 Dec 2018 19:17:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/VL7ftBEHYpK0lUaR5uIKlQDb3WHEaZidPjlLbLTtY/vIB8aEIdcHM3h4w0+eYD0ywHikfh X-Received: by 2002:a17:902:7443:: with SMTP id e3mr586731plt.304.1544152660267; Thu, 06 Dec 2018 19:17:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544152660; cv=none; d=google.com; s=arc-20160816; b=T5Ymbh9rt2O+qj8vc7QJOjZD2NiBQiWCBZQYeh75fBWveuQBK3kGGVGIXDlBpW1tuD WbFbqrW6tZxcjK6fvGdpw0DaY5KLsgrJikyZSzU+v+gtue5HqflbuR6vVMD3f1GUs3vv vS2JHfxpSMwyg6Ed08EeAxKAv9R0mtEUNUOLnlqcmoQkcY8252zxCSWC6yd8nwgJBsLW rMmvXTwsVrFWzejHdNNXdwnWuVB5cHQjvmP7etMdPLAWqNUaXgMDGTkSPeFcgZ0GrhvU J55uSKPnN5XAM2QKoI0kyGU2g0qSK4iUfoZfHrCraU0V2t6UgUFS3tYRiUr1VAWeIXS/ y+zg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=iXPuQLIRIMo49oR4Lcg42MfzuXEOLwmMR2b0MMMIYuI=; b=gi9okKsB3W5Hy85zkTSHPgXAzDsiqF0U0XQx90v1TX0GIHw9Ga4sxy2e7ACLUS+lOq 2dJKgqIVl9iw0Lu59FxJraYLtyx5Nk+HfrVrz3F1hSGNKqzkPPoGgec9jkv6/wRZkLM5 Dbxft6QKSoSOd0DarE2NRNKfNQTmhCuTZ/FYeq+oIsTr5wNsG+LTetLEMZfh1EMJyc1s Qqfr373mE+XWJPjRMsrS9epxPNzg1dEmCqvEmXvmoinGNo3YdLhYrSKkX0bNCKliuD8/ AN8BOlZ186OlRhtbdmESlfgyqmZTTQUtQpo/q+bHwVtWijo6Gbl1c4ammSy/d5Aj4c/B 47tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=lNU9qXuj; 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 d92si1962170pld.45.2018.12.06.19.17.23; Thu, 06 Dec 2018 19:17:40 -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-dk.20150623.gappssmtp.com header.s=20150623 header.b=lNU9qXuj; 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 S1725939AbeLGDQZ (ORCPT + 99 others); Thu, 6 Dec 2018 22:16:25 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45132 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbeLGDQY (ORCPT ); Thu, 6 Dec 2018 22:16:24 -0500 Received: by mail-pl1-f193.google.com with SMTP id a14so1130097plm.12 for ; Thu, 06 Dec 2018 19:16:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=iXPuQLIRIMo49oR4Lcg42MfzuXEOLwmMR2b0MMMIYuI=; b=lNU9qXujj9ioxLW1pQsdTZYwxFRuYm9J5sIea6sbAdfvfyEQrMDp1Gy4DLBAxwGFen o/MVvm/cGBUpKkopSt2yQX81v6AkQ48EX1V/ufhrpdLGVZTzw4JIx0B09wXMVGHPH0GH /Js7edLaubItHS1YnaXMBCoPQh6ArrbFYHXMZWfnm7l5kevUMU5YrpnGlTNA82NYNkbP Eji0uloSpdGcB4Xmn2WczSriut+AAejTV0cVvwEiL7n8uzfVnkv3p/EOxE5Xs1Ew5Yqx KwzqPgiXsIjaP52nc3HWz/mAY9II2edp7nUfbEWfI4RGzMwSoE81YioNYWsZ769d73gt FjAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iXPuQLIRIMo49oR4Lcg42MfzuXEOLwmMR2b0MMMIYuI=; b=TgYzr7fjrQBBFrlpdmCF0Bu1pJt/Cej9IhVe82oWG2bEszGCjnBm9ewCnPUNwdczi8 Gyg80V2LoUJGGMrC5GKP0HrR7SgXHIIIy84q43UuM1rg0RK3YwSDAEp4AvuzgCt9S63Q lrbSZSX2cLntWHUjgG7cPUcWfHcoYeqnf7tz+ZD/X0b6SxZt3qBYWi9QMTkkfujCYtgZ RgknRGklWYrpZKMFwhTD/GmD4HrzDhMoRM2+8ZU5Gvvp5XNl87y731SDukVHPX1BblTu bwWYDBng5rmA4PCzkkZVgQlilVZEeeup3A5qHqN5m0o5tqtGSbPtB/2EE7c7NfyNvqVQ NfxQ== X-Gm-Message-State: AA+aEWYaGfrGoGPKyKK3ZzPTRYhXTJ41Ite6rSNbPsB38ssOJel316n4 QZ1tG2kRFd6/NwEuaII1h/aolYgIgjE= X-Received: by 2002:a17:902:7481:: with SMTP id h1mr551505pll.341.1544152583501; Thu, 06 Dec 2018 19:16:23 -0800 (PST) Received: from [192.168.1.121] (66.29.188.166.static.utbb.net. [66.29.188.166]) by smtp.gmail.com with ESMTPSA id p7sm2872275pfa.22.2018.12.06.19.16.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 19:16:22 -0800 (PST) Subject: Re: [PATCH V11 0/4] blk-mq: refactor code of issue directly To: Jianchao Wang Cc: ming.lei@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1544152185-32667-1-git-send-email-jianchao.w.wang@oracle.com> From: Jens Axboe Message-ID: Date: Thu, 6 Dec 2018 20:16:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1544152185-32667-1-git-send-email-jianchao.w.wang@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/6/18 8:09 PM, Jianchao Wang wrote: > Hi Jens > > Please consider this patchset for 4.21. > > It refactors the code of issue request directly to unify the interface > and make the code clearer and more readable. > > This patch set is rebased on the recent for-4.21/block and add the 1st > patch which inserts the non-read-write request to hctx dispatch > list to avoid to involve merge and io scheduler when bypass_insert > is true, otherwise, inserting is ignored, BLK_STS_RESOURCE is returned > and the caller will fail forever. > > The 2nd patch refactors the code of issue request directly to unify the > helper interface which could handle all the cases. > > The 3rd patch make blk_mq_sched_insert_requests issue requests directly > with 'bypass' false, then it needn't to handle the non-issued requests > any more. > > The 4th patch replace and kill the blk_mq_request_issue_directly. Sorry to keep iterating on this, but let's default to inserting to the dispatch list if we ever see busy from a direct dispatch. I'm fine with doing that for 4.21, as suggested by Ming, I just didn't want to fiddle with it for 4.20. This will prevent any merging on the request going forward, which I think is a much safer default. You do this already for some cases. Let's do it unconditionally for a request that was ever subjected to ->queue_rq() and we didn't either error or finish after the fact. -- Jens Axboe