From patchwork Thu Apr 20 20:53:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9691281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B06D460383 for ; Thu, 20 Apr 2017 20:53:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9ED5F1FFAD for ; Thu, 20 Apr 2017 20:53:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 901941FE76; Thu, 20 Apr 2017 20:53:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 149811FE76 for ; Thu, 20 Apr 2017 20:53:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034113AbdDTUxM (ORCPT ); Thu, 20 Apr 2017 16:53:12 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:33166 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034112AbdDTUxL (ORCPT ); Thu, 20 Apr 2017 16:53:11 -0400 Received: by mail-io0-f181.google.com with SMTP id k87so86715488ioi.0 for ; Thu, 20 Apr 2017 13:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=cmXC8QDHV95UQqqjM/IC8qrchv/h0LpQhTdjd7/W3Vk=; b=HDhwLU3ppXQNjEHEnBMs8K13buDKXfCMH0A1R9yR3M6oAYuyuEvI8NevxradzODymf D5s5xzTE9Lni+zfSei0YvcpRye2xqQnnYO8vChZDpLifYExRaKHWSj/gBS+KpaTq9JR9 JZFrVdKzdapVtE+TZzTd/VXe7V8Kc8I421iyaB+BCAAj82jzszaeAQy/vG2sJOZM8y39 pN9xqbNFH7u4ZxQAzKs11bVsBkTizj9mPDq9GlVV5GhKymyRndERcjfyS6Ucl6qG4eDe j9WGvTLJwDK3HTnqDaW4ZND8qZspv5iYbVV0B2o9ldT0p7eBApiCtXdJ81tzrCzfUk6G 9CjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=cmXC8QDHV95UQqqjM/IC8qrchv/h0LpQhTdjd7/W3Vk=; b=G3wA7RgneAMeq0/P3EjC/bhCx54x7Q/zjTjPR0qV5DeIcHVjRBekscjRx6WEaIu9RD MqVRtNKF4CFplEpyVU5SDJrflzp9FnZfSXa1wF32pPvNwubHWuc372F9WBFLTjqTfk9N S90ocG+c70TgOMyUgr7uwYSx1iiPxg/Lv1DM3U5nD5N8WR0qwwP5Kx6pRUSvPSl0Yj8h 34KyQIDCEb5JfZohep4vjshv18cXP/8b4triFjj4JuuCOKMTBVNZ3yUm6tLZGKnmA+iL 6Z8OUFdEkDhxWagSvyobgkA68JybS5rOPyEm/ovQcWR+tFzp5itrNOHQ0sxMY4kmRs2N 5ZzA== X-Gm-Message-State: AN3rC/7RJNxbmXDE/hqd2eYpzR9Bl5y6m5skNZKtmubf29Y3KpOgHzxF j6YVInNNaHAk7w== X-Received: by 10.107.59.1 with SMTP id i1mr12077541ioa.18.1492721590072; Thu, 20 Apr 2017 13:53:10 -0700 (PDT) Received: from [192.168.1.154] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id m1sm154816iti.21.2017.04.20.13.53.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Apr 2017 13:53:09 -0700 (PDT) Subject: Re: [PATCH v3 2/2] blk-mq: Add a polling specific stats function To: Stephen Bates , Omar Sandoval References: <1491567843-26190-1-git-send-email-sbates@raithlin.com> <1491567843-26190-3-git-send-email-sbates@raithlin.com> <20170420200706.GA24823@vader.DHCP.thefacebook.com> <20170420202039.GB24823@vader.DHCP.thefacebook.com> <808e7f83-9f55-29cf-7472-c09daea665bd@kernel.dk> <0E9E52B3-977A-4159-83B3-758564FF67AD@raithlin.com> <6617fde7-4866-4a2d-6cf5-dc8b2c678186@kernel.dk> Cc: "linux-block@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "Damien.LeMoal@wdc.com" , "sagi@grimberg.me" From: Jens Axboe Message-ID: Date: Thu, 20 Apr 2017 14:53:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 04/20/2017 02:47 PM, Stephen Bates wrote: > >> I agree, it's fine as-is. We should queue it up for 4.12. > > Great. I will get something based on Omar’s latest comments asap. > >>> However right now I am stuck as I am seeing the kernel oops I reported >>> before in testing of my latest patchset [1]. I will try and find some >>> time to bisect that but it looks like it was introduced when the >>> support for mq schedulers was added (on or around bd166ef18). > >> Just replied to that one, let me know if the suggestion works. > > That suggestion worked. Do you want me to send a patch for it? Is the patch going to be different than the one I sent? Here it is, with a comment added. Can I add you tested-by? Tested-By: Stephen Bates diff --git a/block/blk-mq.c b/block/blk-mq.c index 572966f49596..c7836a1ded97 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2928,8 +2928,17 @@ bool blk_mq_poll(struct request_queue *q, blk_qc_t cookie) hctx = q->queue_hw_ctx[blk_qc_t_to_queue_num(cookie)]; if (!blk_qc_t_is_internal(cookie)) rq = blk_mq_tag_to_rq(hctx->tags, blk_qc_t_to_tag(cookie)); - else + else { rq = blk_mq_tag_to_rq(hctx->sched_tags, blk_qc_t_to_tag(cookie)); + /* + * With scheduling, if the request has completed, we'll + * get a NULL return here, as we clear the sched tag when + * that happens. The request still remains valid, like always, + * so we should be safe with just the NULL check. + */ + if (!rq) + return false; + } return __blk_mq_poll(hctx, rq); }