From patchwork Thu Nov 8 15:42:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10674539 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 6FFEF1709 for ; Thu, 8 Nov 2018 15:42:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F5A62E030 for ; Thu, 8 Nov 2018 15:42:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D93D2E022; Thu, 8 Nov 2018 15:42:22 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 F3C2A2E02A for ; Thu, 8 Nov 2018 15:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726933AbeKIBSZ (ORCPT ); Thu, 8 Nov 2018 20:18:25 -0500 Received: from mail-io1-f46.google.com ([209.85.166.46]:42643 "EHLO mail-io1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726417AbeKIBSY (ORCPT ); Thu, 8 Nov 2018 20:18:24 -0500 Received: by mail-io1-f46.google.com with SMTP id h19-v6so14918679iog.9 for ; Thu, 08 Nov 2018 07:42:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=IveFjZEJ+DY6tacz3vz9hl2whb9EifONMGHnThozspM=; b=yz9BHOxTnFiDTFZplEu7hchO0dKfE1jRJyx5Ph3gbrQzP0Ecl0Y3eRsg8wT3hX5baF uqGWTGkRzbW1gaiWRmVXbudKOEAVohYk5eQlHH9/t15IN7Ic/LN6Fva1stL2/tCluVl1 2lKXwZYkVXH3bEQyUiQ+YGU33HMYx34Ao7xpqdDRL9yPE2mQjhP+NP0+GunVhuKDDEXO 0dhnKAHz645AHB+arnVFFPox7p9wE7HeKbqH7+l6iqzYn6ZsJT/sdonOqTTTdq8qygTP lALLhIAO4aM/hfR9t1xcvudO6SYcRcDgqDHbeXa56vCtyXWPFzrZvpzjDtYp3t9y/TBn EH2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=IveFjZEJ+DY6tacz3vz9hl2whb9EifONMGHnThozspM=; b=U8RsBOJFZfjfzzFxdJY7Ogy8MqZuTvbcCwANxsWW9OH+DZAfGr3oT9iR6DHnwtMIS2 PIhGqpZ3ZLh1DLxiNZaUzRO9NU3DealRIM5VFLpSGM+WPJ4yN4cvq1teJqFpUPEZ+ZuV 0D1RL6ivVeL9lpcyXYfU6SfLgpQLtuhDH+TpzkTXBEustOIlVu5QwlVDht12rfqYkoSH R4hPhKgenjy7HEMS/VpT1zHMhCh20XtjuIBvUTuAi6IzjjIwXVyoi6lwopdyCNWIrtYY O81yQeE05zjD+Dzg+qUZs7zaC3NIbrY7/dbekGZVkcgPAu0Z4LgACmuRZAS+5L9oXQi6 U3Pg== X-Gm-Message-State: AGRZ1gJJKRosgV7PbcmdouTFO1o0ivjepetTwahXkzlamSDwyYYfT2RN a73dF6atZ9n5OONsK20XLBrks0h3t1o= X-Google-Smtp-Source: AJdET5eedBDrnjTA4jlqrQLz/AWRyzyfSMbZaSrFv+l7pImxyxdgyzAdUnqTSUCwA0uUYbHEUwoMLg== X-Received: by 2002:a6b:4f14:: with SMTP id d20-v6mr4299105iob.68.1541691739949; Thu, 08 Nov 2018 07:42:19 -0800 (PST) Received: from x1.thefacebook.com ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id i8-v6sm1391185iom.47.2018.11.08.07.42.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 07:42:19 -0800 (PST) From: Jens Axboe To: linux-block@vger.kernel.org Subject: [PATCHSET 0/2] Add queue_is_busy helper Date: Thu, 8 Nov 2018 08:42:14 -0700 Message-Id: <20181108154216.23853-1-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 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 DM currently uses atomic inc/dec to maintain a busy count of IO on a given device. For the dm-mq path, we can replace this with helper that just checks the state of the tags on the device. First patch is a prep patch that allows the iteration helpers to return true/false, like we support internally in sbitmap. For a busy check we don't care about how many requests are busy, just if some are or not. Hence we can stop iterating tags as soon as we find one that is allocated. block/blk-mq-debugfs.c | 4 +++- block/blk-mq-tag.c | 4 ++-- block/blk-mq.c | 38 +++++++++++++++++++++++++++++++++----- include/linux/blk-mq.h | 6 ++++-- 4 files changed, 42 insertions(+), 10 deletions(-)