Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1710139imm; Tue, 22 May 2018 08:10:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr3vmTXPaBDhLZD4cdWDuH8JAgm1Ug3bMzjJkisojihBtOgyu13ugbCUGTapK+znyS00C35 X-Received: by 2002:a63:56:: with SMTP id 83-v6mr18848641pga.29.1527001843916; Tue, 22 May 2018 08:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527001843; cv=none; d=google.com; s=arc-20160816; b=CMtEYZfbd1ZCsPsRS9bE/EU2ZdtEcIR/cwE3kZmmZ64Q+CyGyp3/+8my2wV0oBpAGK mtgTnUprX2ELzoTpDBmrnC3y3qnLacer17TRF5YHywxSGlvQFQj0IL9ARXhTfMqRvRWW O7ALfZ0o7A2jUdNRVCpVYPZR67dK1v+laL0janYEa8WW3EQ0udei33yFH6epj26W19// V/P4hxQniLYOlfKCR32I45y48NtUfFY902H84YltNgXnAaawwYrSQ3P29keWDusDwclU SrvQk9HrdC9M6nYzXDbGbzAUocEhcyuhu/OyWEtyLyCwgM6r2TW+nMEY6W6IKitqb2Ny +9TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=piLesZdvpcC03w+jj91QbxC6EXlF5X/9Tl4PNoCRZkw=; b=AAxGmmCb7jJtsYmVDiYDNCHzH6GU/pz74ala9pcMCTlH5tYTEIDX6kYYNhfFTbUwxj bgseyUO3ef+awPG9flPiW4plnvQp0PWVZMQY17WaNXqGqymXZkjGjfgdrYBbx68Pj+RU usT2PBpUfsj9ysEN6gH/zPa8rG8zpuhM2OvaHZhYYbL6I6rXYjY3BqwV14e9S1DnIAm0 kjbtaU9WGncTqEHL+hiSuYSmX1yh0hAbG/IhIttbm7y/ZUFm1kztDUvxE7FYsJXGIr8j vwub7yLPUX8qGf4MPdmYMZcln6I8c/uTCCPcBrHkA5RG+B2rWJlltiiuZZ6YLI887eIW pzHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=DlM5Ggb8; 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 e2-v6si17047840pfm.220.2018.05.22.08.10.25; Tue, 22 May 2018 08:10:43 -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=DlM5Ggb8; 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 S1752358AbeEVPIB (ORCPT + 99 others); Tue, 22 May 2018 11:08:01 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:23233 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751597AbeEVPHy (ORCPT ); Tue, 22 May 2018 11:07:54 -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=1527001675; x=1558537675; h=from:to:cc:subject:date:message-id; bh=9+DWbXQRXLA7H1zPUUmM8xaJP/IWt3QVUR7XzX8r3Pw=; b=DlM5Ggb8JKYg22y5WQHy8wxaIKn4XwL1z64JvLTl1nRJYnQz0OPhVYzn 8CyZLII/S5A1gQZM78Y+fANgPKtx9QK/Vjn9m5+IkB1Vo5KKSOk0ZfdLm ZFZSJXMGA2lG+HzMQx/wAABM5zjW4lVXHTms8eC7uKVJujgghlJW3d9wd FH/gk1DTA4Dp8CAOB22WGlufXhmPbv6O6gKC8fCqNSO/1IpsbJrwt+A45 26/TeEh30Yp11EpIoBEWMfIw5n/sbgJgaH4DAVH1NifYsOuonxS5Pried AsVVAJiM0cxEzx/cactJz669zmxcCsp7IENkIrkaxGlC8Dzokj0X8Dphn Q==; X-IronPort-AV: E=Sophos;i="5.49,430,1520870400"; d="scan'208";a="79548761" 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; 22 May 2018 23:07:53 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 22 May 2018 07:58:48 -0700 Received: from penguito-adamm.sdcorp.global.sandisk.com ([10.11.47.13]) by uls-op-cesaip02.wdc.com with ESMTP; 22 May 2018 08:07:53 -0700 From: adam.manzanares@wdc.com To: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, axboe@kernel.dk, bcrl@kvack.org Cc: tglx@linutronix.de, mingo@kernel.org, pombredanne@nexb.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, bigeasy@linutronix.de, jack@suse.cz, darrick.wong@oracle.com, rgoldwyn@suse.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aio@kvack.org, linux-api@vger.kernel.org, hch@infradread.org, jmoyer@redhat.com, Adam Manzanares Subject: [PATCH v6 0/5] AIO add per-command iopriority Date: Tue, 22 May 2018 08:07:32 -0700 Message-Id: <20180522150737.9893-1-adam.manzanares@wdc.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adam Manzanares This is the per-I/O equivalent of the ioprio_set system call. See the following link for performance implications on a SATA HDD: https://lkml.org/lkml/2016/12/6/495 First patch factors ioprio_check_cap function out of ioprio_set system call to also be used by the aio ioprio interface. Second patch converts kiocb ki_hint field to a u16 to avoid kiocb bloat. Third patch passes ioprio hint from aio iocb to kiocb and initializes kiocb ioprio value appropriately when it is not explicitly set. Fourth patch enables the feature for blkdev. Fifth patch enables the feature for iomap direct IO Note: this work is based on top of linux-vfs/for-next v2: merge patches use IOCB_FLAG_IOPRIO validate intended use with IOCB_IOPRIO add linux-api and linux-block to cc v3: add ioprio_check_cap function convert kiocb ki_hint to u16 use ioprio_check_cap when adding ioprio to kiocb in aio.c v4: handle IOCB_IOPRIO in aio_prep_rw note patch 3 depends on patch 1 in commit msg v5: rename ki_hint_valid -> ki_hint_validate remove ki_hint_validate comment and whitespace remove IOCB_IOPRIO flag initialize kiocb to have no priority v6: add __blkdev_direct_IO_simple ioprio support Adam Manzanares (5): block: add ioprio_check_cap function fs: Convert kiocb rw_hint from enum to u16 fs: Add aio iopriority support fs: blkdev set bio prio from kiocb prio fs: iomap dio set bio prio from kiocb prio block/ioprio.c | 22 ++++++++++++++++------ drivers/block/loop.c | 3 +++ fs/aio.c | 16 ++++++++++++++++ fs/block_dev.c | 2 ++ fs/iomap.c | 1 + include/linux/fs.h | 16 ++++++++++++++-- include/linux/ioprio.h | 2 ++ include/uapi/linux/aio_abi.h | 1 + 8 files changed, 55 insertions(+), 8 deletions(-) -- 2.15.1