Commit e4335ed3 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring: improve hardlink code generation

req_set_fail_links() condition checking is bulky. Even though it's
always in a slow path, it's inlined and generates lots of extra code,
simplify it be moving HARDLINK checking into helpers killing linked
requests.

          text    data     bss     dec     hex filename
before:  79318   12330       8   91656   16608 ./fs/io_uring.o
after:   79126   12330       8   91464   16548 ./fs/io_uring.o
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/96a9387db658a9d5a44ecbfd57c2a62cb888c9b6.1618101759.git.asml.silence@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 88885f66
...@@ -1101,7 +1101,7 @@ static bool io_match_task(struct io_kiocb *head, ...@@ -1101,7 +1101,7 @@ static bool io_match_task(struct io_kiocb *head,
static inline void req_set_fail_links(struct io_kiocb *req) static inline void req_set_fail_links(struct io_kiocb *req)
{ {
if ((req->flags & (REQ_F_LINK | REQ_F_HARDLINK)) == REQ_F_LINK) if (req->flags & REQ_F_LINK)
req->flags |= REQ_F_FAIL_LINK; req->flags |= REQ_F_FAIL_LINK;
} }
...@@ -1810,7 +1810,8 @@ static bool io_disarm_next(struct io_kiocb *req) ...@@ -1810,7 +1810,8 @@ static bool io_disarm_next(struct io_kiocb *req)
if (likely(req->flags & REQ_F_LINK_TIMEOUT)) if (likely(req->flags & REQ_F_LINK_TIMEOUT))
posted = io_kill_linked_timeout(req); posted = io_kill_linked_timeout(req);
if (unlikely(req->flags & REQ_F_FAIL_LINK)) { if (unlikely((req->flags & REQ_F_FAIL_LINK) &&
!(req->flags & REQ_F_HARDLINK))) {
posted |= (req->link != NULL); posted |= (req->link != NULL);
io_fail_links(req); io_fail_links(req);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment