public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 2/4] io_uring: kill hot path fixed file bitmap debug checks
Date: Sun, 16 Oct 2022 21:30:49 +0100	[thread overview]
Message-ID: <cf77f2ded68d2e5b2bc7355784d969837d48e023.1665891182.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

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.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 io_uring/filetable.h | 1 +
 io_uring/io_uring.c  | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/filetable.h b/io_uring/filetable.h
index 19d2aed66c72..351111ff8882 100644
--- a/io_uring/filetable.h
+++ b/io_uring/filetable.h
@@ -25,6 +25,7 @@ unsigned int io_file_get_flags(struct file *file);
 
 static inline void io_file_bitmap_clear(struct io_file_table *table, int bit)
 {
+	WARN_ON_ONCE(!test_bit(bit, table->bitmap));
 	__clear_bit(bit, table->bitmap);
 	table->alloc_hint = bit;
 }
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 18aa39709fae..6e50f548de1a 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1858,7 +1858,6 @@ inline struct file *io_file_get_fixed(struct io_kiocb *req, int fd,
 	/* mask in overlapping REQ_F and FFS bits */
 	req->flags |= (file_ptr << REQ_F_SUPPORT_NOWAIT_BIT);
 	io_req_set_rsrc_node(req, ctx, 0);
-	WARN_ON_ONCE(file && !test_bit(fd, ctx->file_table.bitmap));
 out:
 	io_ring_submit_unlock(ctx, issue_flags);
 	return file;
-- 
2.38.0


  parent reply	other threads:[~2022-10-16 20:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 20:30 [PATCH 0/4] random io_uring cleanups Pavel Begunkov
2022-10-16 20:30 ` [PATCH 1/4] io_uring: remove FFS_SCM Pavel Begunkov
2022-10-16 20:30 ` Pavel Begunkov [this message]
2022-10-16 20:30 ` [PATCH 3/4] io_uring: reuse io_alloc_req() Pavel Begunkov
2022-10-16 20:30 ` [PATCH 4/4] io_uring: don't iopoll from io_ring_ctx_wait_and_kill() Pavel Begunkov
2022-10-16 23:08 ` [PATCH 0/4] random io_uring cleanups Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf77f2ded68d2e5b2bc7355784d969837d48e023.1665891182.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox