From patchwork Mon Apr 15 05:57:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10900129 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 CC2141390 for ; Mon, 15 Apr 2019 05:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5E612882F for ; Mon, 15 Apr 2019 05:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA0E828831; Mon, 15 Apr 2019 05:57:23 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 538DF2882F for ; Mon, 15 Apr 2019 05:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725796AbfDOF5W (ORCPT ); Mon, 15 Apr 2019 01:57:22 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:5613 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbfDOF5W (ORCPT ); Mon, 15 Apr 2019 01:57:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1555307843; x=1586843843; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Z3pmJnVNPpm7Vi7lyJ7ODoQa9EmWnw00Z4B16s/OUF4=; b=gDuJ9OM/jubjZpCMUY7Ld5AnLjOPcQBPVXZZ/9XAoHPAzaHao7lqD6T3 nirX2dXTsSG5wbacumn9ysJFeajMMEgBdYRu1vGCLcVd6XuJ/5naYEA6q CrXI67GW/k9InBMBz3rcUr6G8pKnSjR24/dCwGtH2PcQpBPXKz1NHWOnV kVEYamjSo3NFxJmYycFgyKRfPnBBfzULkq1wHlMuwVZ8fYwtfo5g4qPKG 1pITtVNPDtHcQ0UcaWqeowEKuEyW4Oz2C7C8yB5D4ekQFriJOZkPFkouw hw1niJBbqEVrMBBahkAujlYFK647hi3fWB0GGTvQTejFooQoOK7KS+Bri g==; X-IronPort-AV: E=Sophos;i="5.60,352,1549900800"; d="scan'208";a="107710666" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 15 Apr 2019 13:57:23 +0800 IronPort-SDR: lKqPYoz+NN8WZUt1VS5AGgiozszCf1IZi22ZCAgMl5JeEES6j7axuh5bYIZB9oAOG05rCqvGHp yRELk/+2JVadBV3ZOQ8YrjYd8ndsnth9WsM/BtXpf+aGMGBZpaZKVr8o13ynp6UDUAbxMuVA1q 33ssFOGJNdI0c8EavvSByEpLRP6Cp87Vm4u13HLjb0HFS0b8ehOwMPvy7w/0G6OUMv7c4tsARB HT70ljvPp018O6VWBN9BBkc8dOyLdrJZ1aPvf+viWDh8sSy13qTKKz0Lc1dn/azhzhMyhKvh6q PaMKNg/tYAD8v6pkIijniErl Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 14 Apr 2019 22:34:09 -0700 IronPort-SDR: ZMbPDnYqZsxOJphnSpe3Y6t8UfUPbRyOqAwC31Cu+JCjtaKSIOjgbfucUHLIi8h5OUq2ELU0Gb eAtCu2jcnxmjBe2wkUz3cYmoHN7JqGyM+1XFjYY8bzpfRUGWkMs70nJx+Hap9+4ZJvwlQK/HBq DNQEZ1NHB5sT7wiS+gIW/k601F3WJxfousTo2r25MercRk4oDWNODHWV2mkLVRzt9sjDqC9+LO adG54Zy+oe+cVQ6xla44y1rCpRvQ9FQIMKEViQ2RonBWRowba7gtoQb045BlHuYdb77gZPdiX4 UtI= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip02.wdc.com with ESMTP; 14 Apr 2019 22:57:22 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: Chaitanya Kulkarni Subject: [PATCH 2/2] block: add task priority to init bio iopriority Date: Sun, 14 Apr 2019 22:57:03 -0700 Message-Id: <20190415055703.5512-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190415055703.5512-1-chaitanya.kulkarni@wdc.com> References: <20190415055703.5512-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 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 This uses the current process's ioprioty and initializes the bios issued in the discard, write-zeroes and write-same operations. Signed-off-by: Chaitanya Kulkarni --- block/blk-lib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block/blk-lib.c b/block/blk-lib.c index 5f2c429d4378..12c340e7637c 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "blk.h" @@ -64,6 +65,7 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, bio->bi_iter.bi_sector = sector; bio_set_dev(bio, bdev); bio_set_op_attrs(bio, op, 0); + bio_set_prio(bio, get_task_ioprio(current)); bio->bi_iter.bi_size = req_sects << 9; sector += req_sects; @@ -162,6 +164,7 @@ static int __blkdev_issue_write_same(struct block_device *bdev, sector_t sector, bio->bi_io_vec->bv_offset = 0; bio->bi_io_vec->bv_len = bdev_logical_block_size(bdev); bio_set_op_attrs(bio, REQ_OP_WRITE_SAME, 0); + bio_set_prio(bio, get_task_ioprio(current)); if (nr_sects > max_write_same_sectors) { bio->bi_iter.bi_size = max_write_same_sectors << 9; @@ -234,6 +237,8 @@ static int __blkdev_issue_write_zeroes(struct block_device *bdev, bio->bi_iter.bi_sector = sector; bio_set_dev(bio, bdev); bio->bi_opf = REQ_OP_WRITE_ZEROES; + bio_set_prio(bio, get_task_ioprio(current)); + if (flags & BLKDEV_ZERO_NOUNMAP) bio->bi_opf |= REQ_NOUNMAP; @@ -286,6 +291,7 @@ static int __blkdev_issue_zero_pages(struct block_device *bdev, bio->bi_iter.bi_sector = sector; bio_set_dev(bio, bdev); bio_set_op_attrs(bio, REQ_OP_WRITE, 0); + bio_set_prio(bio, get_task_ioprio(current)); while (nr_sects != 0) { sz = min((sector_t) PAGE_SIZE, nr_sects << 9);