From: Christoph Hellwig Subject: [PATCH 5/6] direct-io: only use block polling if explicitly requested Date: Thu, 24 Dec 2015 15:14:23 +0100 Message-ID: <1450966464-6847-6-git-send-email-hch@lst.de> References: <1450966464-6847-1-git-send-email-hch@lst.de> Return-path: In-Reply-To: <1450966464-6847-1-git-send-email-hch@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org To: viro@zeniv.linux.org.uk, axboe@fb.com Cc: milosz@adfin.com, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-api@vger.kernel.org List-Id: linux-api@vger.kernel.org Signed-off-by: Christoph Hellwig --- fs/direct-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/direct-io.c b/fs/direct-io.c index cb5337d..904ff7f 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -445,7 +445,8 @@ static struct bio *dio_await_one(struct dio *dio) __set_current_state(TASK_UNINTERRUPTIBLE); dio->waiter = current; spin_unlock_irqrestore(&dio->bio_lock, flags); - if (!blk_poll(bdev_get_queue(dio->bio_bdev), dio->bio_cookie)) + if (!(dio->iocb->ki_flags & IOCB_HIPRI) || + !blk_poll(bdev_get_queue(dio->bio_bdev), dio->bio_cookie)) io_schedule(); /* wake up sets us TASK_RUNNING */ spin_lock_irqsave(&dio->bio_lock, flags); -- 1.9.1