Received: by 10.192.165.148 with SMTP id m20csp4001262imm; Mon, 30 Apr 2018 09:58:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrsTBETu85jXjWe7ZrgoOrJFcnWNCmrU3dgL6VsKFLjpv9PdgZKZL/RdicVo6IuG0iOZlv7 X-Received: by 10.98.218.23 with SMTP id c23mr4829579pfh.128.1525107519020; Mon, 30 Apr 2018 09:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525107518; cv=none; d=google.com; s=arc-20160816; b=GLNqg/F+jNrOhUBxHS3T7N+vakC4XtsUlzH7kit3Sp+RxUMa2zzsA1l0tHZsBHZenf nJb78n5QgBf1kcfhULloAyc/AWs7VoJyI+6S69A37ZKi5TT2UN97sJ4YK1XYug3UCytT YfFfj/l6tw+h1C4SGeE7Gl7Tvwr/+1XVtoKlxznlTRTRa2Dj/CUUgPN+B4tV8VsB9yse fnq8JVoxZc6Xo0hPqjEkgqs7V+D1UBRsaneSzXQot4sHTPlpYP1CyrSEPvlTZtEbjVTQ 1epz/qY+CQ8BJdB3RLR3kPCAhjA0+LjlenAdJOy1uMnIVFobHZ4ioykF0b1OEulme3OX Jazg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=VqGuATfvirf5x0wlFy5LrOpJFVJjR/o7WkkIXA5cKgU=; b=FDG2v69geYF8ynrTQuQBtqsA1hxF+F8FtONIOyRgoHjb7SbHx3+iszwSKVc4R/J72v N20XB/mWI3/Icg9E6wUvZJkH4Y+CDkzyIfqxOBzAxIRdKbwQlUNCAME4HcEd2s4DTs1u mdl3qbBc8t6PtTJ1gNdQ7vmlyagfZ+jEeE9prkhqHcONBMpcQvDXyTFIivQ6ZX4DIVxM sT9vm4AXO9NgE//dyOUMgKYv2f+PSWP4wDJanvigt5525akz/0eFBHiCUDdRNBpNWv+G wX7mEGfmQGxp20oljs1e26jUIya8ROJe+aUCc+ZUz2L52nc8CwRK2vNShvS+RfA/DlXv gcFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=IMoONvMc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l188si8219461pfc.266.2018.04.30.09.58.24; Mon, 30 Apr 2018 09:58:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=IMoONvMc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755168AbeD3Q6C (ORCPT + 99 others); Mon, 30 Apr 2018 12:58:02 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:20729 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755107AbeD3Q56 (ORCPT ); Mon, 30 Apr 2018 12:57:58 -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=1525107683; x=1556643683; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=OiKVJK7yMH87rfYVbFa8QHZ9Fzaf6dmfVlokFKIwPdk=; b=IMoONvMcbjQ85pavKLokfsxyzUTfDYnOta/ytzC100Gisaj5YRNW9naz pZCjgtyCzP0SxwQDrljI186HYsrxH33OiE0CCeLYF/xs2hbzMvfiPCdIy LUs7s9nxAILju0G3GO1effRDOOO/gu1HL+s7zq+QKxy6aa6z25jTEfFFA xBUx8MkBSMz+QtmTlkbJ4Gu0wYSIOxRX2FXaNzAyX5PAU3YX3kUmfLSXw S0WilMGGO9XBLLE6+dMgoPRDxfeav4kNafYKW/J7x+fWoz+50ASB7CsU/ UIVUmaQWpyhCd0oAaZrhM7VE98Kba5oOdu+9ONCLO9SVqJgE173RD+yO4 g==; X-IronPort-AV: E=Sophos;i="5.49,346,1520870400"; d="scan'208";a="173714670" 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; 01 May 2018 01:01:22 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 30 Apr 2018 09:49:18 -0700 Received: from penguito-adamm.sdcorp.global.sandisk.com ([10.11.47.13]) by uls-op-cesaip02.wdc.com with ESMTP; 30 Apr 2018 09:57:58 -0700 From: adam.manzanares@wdc.com To: viro@zeniv.linux.org.uk, bcrl@kvack.org Cc: linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-abi-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Adam Manzanares Subject: [PATCH 2/2] fs: Add aio priority support for block_dev Date: Mon, 30 Apr 2018 09:57:40 -0700 Message-Id: <20180430165740.2842-3-adam.manzanares@wdc.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180430165740.2842-1-adam.manzanares@wdc.com> References: <20180430165740.2842-1-adam.manzanares@wdc.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adam Manzanares When the IOCB_IOPRIO flag is set because the user supplied iocb has the RWF_IOPRIO flag is set then we set the priority value of the kiocb from the iocb. When a bio is created for an aio request by the block dev we set the priority value of the bio to the user supplied value. Signed-off-by: Adam Manzanares --- fs/aio.c | 9 +++++++++ fs/block_dev.c | 1 + 2 files changed, 10 insertions(+) diff --git a/fs/aio.c b/fs/aio.c index 88d7927ffbc6..47591f9e7ba3 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1603,6 +1603,15 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, goto out_put_req; } + if (req->common.ki_flags & IOCB_IOPRIO) + /* + * The IOCB_IOPRIO flag is set when the user supplied iocb + * aio_rw_flag field has the RWF_IOPRIO flag set. If so, + * aio_reqprio is interpreted as a I/O scheduling class and + * priority. + */ + req->common.ki_ioprio = iocb->aio_reqprio; + ret = put_user(KIOCB_KEY, &user_iocb->aio_key); if (unlikely(ret)) { pr_debug("EFAULT: aio_key\n"); diff --git a/fs/block_dev.c b/fs/block_dev.c index 7ec920e27065..da1e94d2bb75 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -355,6 +355,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) bio->bi_write_hint = iocb->ki_hint; bio->bi_private = dio; bio->bi_end_io = blkdev_bio_end_io; + bio->bi_ioprio = iocb->ki_ioprio; ret = bio_iov_iter_get_pages(bio, iter); if (unlikely(ret)) { -- 2.15.1