From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH for-next 2/5] io_uring: don't export io_put_task()
Date: Mon, 16 Jan 2023 16:48:58 +0000 [thread overview]
Message-ID: <43c7f9227e2ab215f1a6069dadbc5382bed346fe.1673887636.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
io_put_task() is only used in uring.c so enclose it there together with
__io_put_task().
Signed-off-by: Pavel Begunkov <[email protected]>
---
io_uring/io_uring.c | 11 ++++++++++-
io_uring/io_uring.h | 10 ----------
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 5570422dc2fb..1b72ff558c17 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -715,7 +715,7 @@ static void io_cqring_overflow_flush(struct io_ring_ctx *ctx)
io_cqring_do_overflow_flush(ctx);
}
-void __io_put_task(struct task_struct *task, int nr)
+static void __io_put_task(struct task_struct *task, int nr)
{
struct io_uring_task *tctx = task->io_uring;
@@ -725,6 +725,15 @@ void __io_put_task(struct task_struct *task, int nr)
put_task_struct_many(task, nr);
}
+/* must to be called somewhat shortly after putting a request */
+static inline void io_put_task(struct task_struct *task, int nr)
+{
+ if (likely(task == current))
+ task->io_uring->cached_refs += nr;
+ else
+ __io_put_task(task, nr);
+}
+
void io_task_refs_refill(struct io_uring_task *tctx)
{
unsigned int refill = -tctx->cached_refs + IO_TCTX_REFS_CACHE_NR;
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 5113e0ddb01d..c68edf9872a5 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -70,7 +70,6 @@ void io_wq_submit_work(struct io_wq_work *work);
void io_free_req(struct io_kiocb *req);
void io_queue_next(struct io_kiocb *req);
-void __io_put_task(struct task_struct *task, int nr);
void io_task_refs_refill(struct io_uring_task *tctx);
bool __io_alloc_req_refill(struct io_ring_ctx *ctx);
@@ -319,15 +318,6 @@ static inline void io_commit_cqring_flush(struct io_ring_ctx *ctx)
__io_commit_cqring_flush(ctx);
}
-/* must to be called somewhat shortly after putting a request */
-static inline void io_put_task(struct task_struct *task, int nr)
-{
- if (likely(task == current))
- task->io_uring->cached_refs += nr;
- else
- __io_put_task(task, nr);
-}
-
static inline void io_get_task_refs(int nr)
{
struct io_uring_task *tctx = current->io_uring;
--
2.38.1
next prev parent reply other threads:[~2023-01-16 17:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 16:48 [PATCH for-next 0/5] random for-next patches Pavel Begunkov
2023-01-16 16:48 ` [PATCH for-next 1/5] io_uring: return back links tw run optimisation Pavel Begunkov
2023-01-16 18:43 ` Jens Axboe
2023-01-16 19:47 ` Pavel Begunkov
2023-01-16 21:04 ` Jens Axboe
2023-01-16 21:14 ` Pavel Begunkov
2023-01-16 21:17 ` Jens Axboe
2023-01-16 21:15 ` Pavel Begunkov
2023-01-16 21:18 ` Jens Axboe
2023-01-16 16:48 ` Pavel Begunkov [this message]
2023-01-16 16:48 ` [PATCH for-next 3/5] io_uring: simplify fallback execution Pavel Begunkov
2023-01-16 16:49 ` [PATCH for-next 4/5] io_uring: optimise ctx flags layout Pavel Begunkov
2023-01-16 16:49 ` [PATCH for-next 5/5] io_uring: refactor __io_req_complete_post Pavel Begunkov
2023-01-16 21:09 ` [PATCH for-next 0/5] random for-next patches 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=43c7f9227e2ab215f1a6069dadbc5382bed346fe.1673887636.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