Skip to content

Commit 4d50595

Browse files
isilenceaxboe
authored andcommitted
io_uring: kill hot path fixed file bitmap debug checks
We test file_table.bitmap in io_file_get_fixed() to check invariants, don't do it, it's expensive and was showing up in profiles. No reports of this triggering has come in. Move the check to the file clear instead, which will still catch any wrong usage. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/cf77f2ded68d2e5b2bc7355784d969837d48e023.1665891182.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 38eddb2 commit 4d50595

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

io_uring/filetable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ unsigned int io_file_get_flags(struct file *file);
2525

2626
static inline void io_file_bitmap_clear(struct io_file_table *table, int bit)
2727
{
28+
WARN_ON_ONCE(!test_bit(bit, table->bitmap));
2829
__clear_bit(bit, table->bitmap);
2930
table->alloc_hint = bit;
3031
}

io_uring/io_uring.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,6 @@ inline struct file *io_file_get_fixed(struct io_kiocb *req, int fd,
18581858
/* mask in overlapping REQ_F and FFS bits */
18591859
req->flags |= (file_ptr << REQ_F_SUPPORT_NOWAIT_BIT);
18601860
io_req_set_rsrc_node(req, ctx, 0);
1861-
WARN_ON_ONCE(file && !test_bit(fd, ctx->file_table.bitmap));
18621861
out:
18631862
io_ring_submit_unlock(ctx, issue_flags);
18641863
return file;

0 commit comments

Comments
 (0)