projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
813d8fe
)
io_uring: correct pinned_vm accounting
author
Pavel Begunkov
<asml.silence@gmail.com>
Sun, 16 Oct 2022 21:42:55 +0000
(22:42 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:52 +0000
(12:35 +0200)
[ upstream commit
42b6419d0aba47c5d8644cdc0b68502254671de5
]
->mm_account should be released only after we free all registered
buffers, otherwise __io_sqe_buffers_unregister() will see a NULL
->mm_account and skip locked_vm accounting.
Cc: <Stable@vger.kernel.org>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/6d798f65ed4ab8db3664c4d3397d4af16ca98846.1664849932.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c
patch
|
blob
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index b94cbac07a5925f72ff1cec191295ce7aec61aeb..4d32483f8e45c7fa8715355ca1edc7a56d045d6d 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-9303,11
+9303,6
@@
static void io_ring_ctx_free(struct io_ring_ctx *ctx)
{
io_sq_thread_finish(ctx);
- if (ctx->mm_account) {
- mmdrop(ctx->mm_account);
- ctx->mm_account = NULL;
- }
-
/* __io_rsrc_put_work() may need uring_lock to progress, wait w/o it */
io_wait_rsrc_data(ctx->buf_data);
io_wait_rsrc_data(ctx->file_data);
@@
-9343,6
+9338,11
@@
static void io_ring_ctx_free(struct io_ring_ctx *ctx)
#endif
WARN_ON_ONCE(!list_empty(&ctx->ltimeout_list));
+ if (ctx->mm_account) {
+ mmdrop(ctx->mm_account);
+ ctx->mm_account = NULL;
+ }
+
io_mem_free(ctx->rings);
io_mem_free(ctx->sq_sqes);