From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E074C433F5 for ; Tue, 4 Oct 2022 06:11:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oGSHM0hWuwViZnggZRbXJsFebI7RBTt4DJusTo9/TUc=; b=GyfVa1AAKmn19nXfZTOpzXuD9m 0JE9ibnH4zsWyWSDg0sUsriNfKFZZl/a6ABvOYumZ2AIfftqp5AMFXd85hEuadoS1dEHxi0yuz2yW ewCbv3kZuZ6zF4aqeQKDqpT7DdPqBlLq5b8LahMy5BbMI1S6PYi1Dwxw1AxRyTW5fPTrchgcQpOCh B7PtYT2a+c/Saly3xEuyQTg7TWShWNt0TqMUYXUFf6BzxDqcNxzEq49ObtqTwk7ZOHbLn/3ioi+HR axbDO7oeOYAyhNI1F0dB9mTry9TGyaASCvTnmz6TWAayZIxxnPJibst+LALvkzPl0telLVaqoSz6e vzIddB1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofb9d-008d09-1L; Tue, 04 Oct 2022 06:11:45 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofb9X-008cyy-7L for linux-nvme@lists.infradead.org; Tue, 04 Oct 2022 06:11:43 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 97E881F907; Tue, 4 Oct 2022 06:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664863895; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oGSHM0hWuwViZnggZRbXJsFebI7RBTt4DJusTo9/TUc=; b=c284Wlhp64CzT2OAccHeFgp7MMiAd8krIB/fW3XhSNTAn1cKcq52Q+T1hApwV7lTKmvVi3 pmA7t4XbWUGDn5x8iYl1d06KocMQQopZYNfnAmdFY86nXdn97ZKb2MBtJI00+/5HTLJKuf 7z/qPS2JXEuHQ4xyjfv/kOYIe1zC8/k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664863895; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oGSHM0hWuwViZnggZRbXJsFebI7RBTt4DJusTo9/TUc=; b=Cag48y1TPu0pD2ZKc+3f2T9Swl1kvdjl2TJLMm52tF2Nc3EXmNGj4pIlK6X1NulGMypfI9 Jy2R1gAS18E8+SCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6834F139EF; Tue, 4 Oct 2022 06:11:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id lajRGJfOO2PJFQAAMHmgww (envelope-from ); Tue, 04 Oct 2022 06:11:35 +0000 Message-ID: <9db5d7eb-bd84-85e6-c30a-da057f1b2b69@suse.de> Date: Tue, 4 Oct 2022 08:11:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v2 2/2] nvme: support io stats on the mpath device Content-Language: en-US To: Sagi Grimberg , linux-nvme@lists.infradead.org Cc: Christoph Hellwig , Jens Axboe , Keith Busch , Chaitanya Kulkarni , linux-block@vger.kernel.org References: <20221003094344.242593-1-sagi@grimberg.me> <20221003094344.242593-3-sagi@grimberg.me> From: Hannes Reinecke In-Reply-To: <20221003094344.242593-3-sagi@grimberg.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221003_231141_800986_3202530E X-CRM114-Status: GOOD ( 21.16 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On 10/3/22 11:43, Sagi Grimberg wrote: > Our mpath stack device is just a shim that selects a bottom namespace > and submits the bio to it without any fancy splitting. This also means > that we don't clone the bio or have any context to the bio beyond > submission. However it really sucks that we don't see the mpath device > io stats. > > Given that the mpath device can't do that without adding some context > to it, we let the bottom device do it on its behalf (somewhat similar > to the approach taken in nvme_trace_bio_complete). > > When the IO starts, we account the request for multipath IO stats using > REQ_NVME_MPATH_IO_STATS nvme_request flag to avoid queue io stats disable > in the middle of the request. > > Signed-off-by: Sagi Grimberg > --- > drivers/nvme/host/core.c | 4 ++++ > drivers/nvme/host/multipath.c | 25 +++++++++++++++++++++++++ > drivers/nvme/host/nvme.h | 12 ++++++++++++ > 3 files changed, 41 insertions(+) > > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index 64fd772de817..d5a54ddf73f2 100644 > --- a/drivers/nvme/host/core.c > +++ b/drivers/nvme/host/core.c > @@ -384,6 +384,8 @@ static inline void nvme_end_req(struct request *req) > nvme_log_error(req); > nvme_end_req_zoned(req); > nvme_trace_bio_complete(req); > + if (req->cmd_flags & REQ_NVME_MPATH) > + nvme_mpath_end_request(req); > blk_mq_end_request(req, status); > } > > @@ -421,6 +423,8 @@ EXPORT_SYMBOL_GPL(nvme_complete_rq); > > void nvme_start_request(struct request *rq) > { > + if (rq->cmd_flags & REQ_NVME_MPATH) > + nvme_mpath_start_request(rq); > blk_mq_start_request(rq); > } > EXPORT_SYMBOL_GPL(nvme_start_request); Why don't you move the check for REQ_NVME_MPATH into nvme_mpath_{start,end}_request? Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman