diff mbox series

[04/22] block: use REQ_HIPRI_ASYNC for non-sync polled IO

Message ID 20181221192236.12866-5-axboe@kernel.dk (mailing list archive)
State New, archived
Headers show
Series [01/22] fs: add an iopoll method to struct file_operations | expand

Commit Message

Jens Axboe Dec. 21, 2018, 7:22 p.m. UTC
Tell the block layer if it's a sync or async polled request, so it can
do the right thing.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 fs/block_dev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Jens Axboe Dec. 21, 2018, 7:25 p.m. UTC | #1
On 12/21/18 12:22 PM, Jens Axboe wrote:
> Tell the block layer if it's a sync or async polled request, so it can
> do the right thing.

Forgot to drop this one, please disregard it as it's super ceded by the
next patch anyway...
hch@infradead.org Dec. 27, 2018, 1:15 p.m. UTC | #2
On Fri, Dec 21, 2018 at 12:25:07PM -0700, Jens Axboe wrote:
> On 12/21/18 12:22 PM, Jens Axboe wrote:
> > Tell the block layer if it's a sync or async polled request, so it can
> > do the right thing.
> 
> Forgot to drop this one, please disregard it as it's super ceded by the
> next patch anyway...

FYI, I'd just add the users in the patch introducing bio_set_polled.
Jens Axboe Dec. 27, 2018, 8:22 p.m. UTC | #3
On 12/27/18 6:15 AM, Christoph Hellwig wrote:
> On Fri, Dec 21, 2018 at 12:25:07PM -0700, Jens Axboe wrote:
>> On 12/21/18 12:22 PM, Jens Axboe wrote:
>>> Tell the block layer if it's a sync or async polled request, so it can
>>> do the right thing.
>>
>> Forgot to drop this one, please disregard it as it's super ceded by the
>> next patch anyway...
> 
> FYI, I'd just add the users in the patch introducing bio_set_polled.

Folded.
diff mbox series

Patch

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 6de8d35f6e41..b8f574615792 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -402,8 +402,12 @@  __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages)
 
 		nr_pages = iov_iter_npages(iter, BIO_MAX_PAGES);
 		if (!nr_pages) {
-			if (iocb->ki_flags & IOCB_HIPRI)
-				bio->bi_opf |= REQ_HIPRI;
+			if (iocb->ki_flags & IOCB_HIPRI) {
+				if (!is_sync)
+					bio->bi_opf |= REQ_HIPRI_ASYNC;
+				else
+					bio->bi_opf |= REQ_HIPRI;
+			}
 
 			qc = submit_bio(bio);
 			WRITE_ONCE(iocb->ki_cookie, qc);