From patchwork Wed Sep 26 12:35:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 10615891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CAEDE180E for ; Wed, 26 Sep 2018 12:36:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE4592AC1B for ; Wed, 26 Sep 2018 12:36:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B28052ACD6; Wed, 26 Sep 2018 12:36:01 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 674CD2ACAD for ; Wed, 26 Sep 2018 12:36:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726768AbeIZSss (ORCPT ); Wed, 26 Sep 2018 14:48:48 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46082 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726315AbeIZSss (ORCPT ); Wed, 26 Sep 2018 14:48:48 -0400 Received: by mail-wr1-f67.google.com with SMTP id z3-v6so15010377wrr.13 for ; Wed, 26 Sep 2018 05:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=9TXLJNBKl5FWJOeOLyru9xaSjO/jg/yjFT33Scpdemo=; b=R5/Wj6wSAYoMEd+ZZu6QrnPBHaMn6Rlqv8i9D+jD72W+fqdPmIo6ZltSQluhvGw9U9 xgQcbDfr50h7eNwz9Bff20/vJ6d+0mNxrgKiU2cfXf+Cpu4r6E57KUPBnLdkvtTeRrxj hibXVv7kyC3fU1NZnf+buSyMZEmILtzgDvkjZa9t+8bAxO4ipyYrQs8ljTcnw2LThajY SbAGYVz1H5zwOcp2Op6+eYyzvoz/oX0LO8/W1I+ldT/ILyTzi8ijbt5QM+5GrexMMqdn sY/9eWajAo/rPLTpt32FU1At9CSYOipiuY0u4YkSqWgS03mY6oGsMdNHYwB2reI+v2LQ SO5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9TXLJNBKl5FWJOeOLyru9xaSjO/jg/yjFT33Scpdemo=; b=ib85cjb15KIlntRgWJ5l+dxHEXbcr52G3GuF1R+TI4z4dECciwtENyutZdezp82wN6 ldWhk9QjwqeLuf3j3vASS+lb59JYKs4MPZlqFd1l/4p2ieCvJIS0UBVb6r7shLa0n3kL ax7ouvgxWUtBlg5akYL8eQaV2isTpz80oYQN7i2bdB3j9hmt7v/vJxtTO7b/jXizMbyw 9j3cw7gSiFhtAe+UkoLpjvEsG5lPAVqkZYVNhON/ZQHIlAxJCNZJ17+PxtUgllph3IW3 O5ZHKn+ZPtVFeeLwdBN+fTTYWSLp5L6y2zwA08TLz/Imzm6Z/fjEt7JT1yBuGFbD3Q2v cenA== X-Gm-Message-State: ABuFfoi7k84dDnpseeoz5tSm4jrvbPP9Bg3wzeRxgnMpWJmEvcePpfl2 JO+ko07TtS/dnjFVQL3B5MDJrU8C X-Google-Smtp-Source: ACcGV60wFChhCTkG+BFzFp+fRYWfrcosNk5BWkRUW4gMQCHvcrRWbtFJWPi5N7xIDzqKXK48lmcveg== X-Received: by 2002:adf:f7c8:: with SMTP id a8-v6mr5067150wrq.86.1537965358716; Wed, 26 Sep 2018 05:35:58 -0700 (PDT) Received: from orange.redhat.com ([213.175.37.12]) by smtp.gmail.com with ESMTPSA id t13-v6sm1936212wrn.54.2018.09.26.05.35.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 05:35:58 -0700 (PDT) From: Ilya Dryomov To: linux-block@vger.kernel.org Cc: Jens Axboe , Bart Van Assche , Omar Sandoval Subject: [PATCH] blk-mq: I/O and timer unplugs are inverted in blktrace Date: Wed, 26 Sep 2018 14:35:50 +0200 Message-Id: <20180926123550.16311-1-idryomov@gmail.com> X-Mailer: git-send-email 2.14.4 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 trace_block_unplug() takes true for explicit unplugs and false for implicit unplugs. schedule() unplugs are implicit and should be reported as timer unplugs. While correct in the legacy code, this has been inverted in blk-mq since 4.11. Cc: stable@vger.kernel.org Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO schedulers") Signed-off-by: Ilya Dryomov Reviewed-by: Omar Sandoval --- block/blk-mq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 85a1c1a59c72..e3c39ea8e17b 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1628,7 +1628,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule) BUG_ON(!rq->q); if (rq->mq_ctx != this_ctx) { if (this_ctx) { - trace_block_unplug(this_q, depth, from_schedule); + trace_block_unplug(this_q, depth, !from_schedule); blk_mq_sched_insert_requests(this_q, this_ctx, &ctx_list, from_schedule); @@ -1648,7 +1648,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule) * on 'ctx_list'. Do those. */ if (this_ctx) { - trace_block_unplug(this_q, depth, from_schedule); + trace_block_unplug(this_q, depth, !from_schedule); blk_mq_sched_insert_requests(this_q, this_ctx, &ctx_list, from_schedule); }