From patchwork Wed Feb 28 00:32:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10246431 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 A8CD96055B for ; Wed, 28 Feb 2018 00:32:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 983A2288E8 for ; Wed, 28 Feb 2018 00:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CD2028B26; Wed, 28 Feb 2018 00:32:18 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 1A60B288E8 for ; Wed, 28 Feb 2018 00:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751563AbeB1AcR (ORCPT ); Tue, 27 Feb 2018 19:32:17 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:25730 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbeB1AcQ (ORCPT ); Tue, 27 Feb 2018 19:32:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1519777936; x=1551313936; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ZsPGxMjZAkGtn62h0G6ZCaez5EDQGbTAHuxEY/i2k7Y=; b=l7tfOGzmqV+lO45bs+1vEaCQdEYDxxWx6PlSnMPXOgVGACHXQ1HZ8iB5 +LG4BAb0m+1YVWawlOEDGpmnlNqO9MwQqHTmy4cKZjh9Bi2ovaa1+th1b 6kJMHFO0UB+TWm6VgEIpoVex7mJL+b/q/plBe6UiTWBmUYjObV4B1Lcu8 natDDVGrRFD9YgxoamM99qI2o3sPdpyGJjNLu5uJ+n5lHMGUOo8R6A3QM cLA4ptQlbDWaLBtvHXixMrV6Hy1SL0VLvkB8uDq1Lg8csVSZVV7zFdMfV 3bvq1eDaB640419JUyaP1Q4z32mH7Ltrsu0BpEoodCjj5LhSgbjfq3QgN A==; X-IronPort-AV: E=Sophos;i="5.47,403,1515427200"; d="scan'208";a="72500822" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Feb 2018 08:32:15 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 27 Feb 2018 16:25:41 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.46.240]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Feb 2018 16:32:15 -0800 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Damien Le Moal , Bart Van Assche , Omar Sandoval , Ming Lei , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH 2/2] blk-mq-debugfs: Show zone locking information Date: Tue, 27 Feb 2018 16:32:14 -0800 Message-Id: <20180228003214.3194-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180228003214.3194-1-bart.vanassche@wdc.com> References: <20180228003214.3194-1-bart.vanassche@wdc.com> 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 When debugging the ZBC code in the mq-deadline scheduler it is very important to know which zones are locked and which zones are not locked. Hence this patch that exports the zone locking information through debugfs. Signed-off-by: Bart Van Assche Cc: Omar Sandoval Cc: Damien Le Moal Cc: Ming Lei Cc: Hannes Reinecke Cc: Johannes Thumshirn Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal --- block/blk-mq-debugfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index eaf282e239b0..1be2116e09b5 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -206,11 +206,27 @@ static ssize_t queue_write_hint_store(void *data, const char __user *buf, return count; } +static int queue_zone_wlock_show(void *data, struct seq_file *m) +{ + struct request_queue *q = data; + unsigned int i; + + if (!q->seq_zones_wlock) + return 0; + + for (i = 0; i < blk_queue_nr_zones(q); i++) + if (test_bit(i, q->seq_zones_wlock)) + seq_printf(m, "%u\n", i); + + return 0; +} + static const struct blk_mq_debugfs_attr blk_mq_debugfs_queue_attrs[] = { { "poll_stat", 0400, queue_poll_stat_show }, { "requeue_list", 0400, .seq_ops = &queue_requeue_list_seq_ops }, { "state", 0600, queue_state_show, queue_state_write }, { "write_hints", 0600, queue_write_hint_show, queue_write_hint_store }, + { "zone_wlock", 0400, queue_zone_wlock_show, NULL }, { }, };