From: Gabriel Krisman Bertazi <krisman@suse.de>
To: axboe@kernel.dk
Cc: io-uring@vger.kernel.org, Gabriel Krisman Bertazi <krisman@suse.de>
Subject: [PATCH] test/file-verify.t: Don't run over mlock limit when run as non-root
Date: Thu, 20 Apr 2023 14:57:28 -0400 [thread overview]
Message-ID: <20230420185728.4104-1-krisman@suse.de> (raw)
test/file-verify tries to get 2MB of pinned memory at once, which is
higher than the default allowed for non-root users in older
kernels (64kb before v5.16, nowadays 8mb). Skip the test for non-root
users if the registration fails instead of failing the test.
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
---
test/file-verify.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/file-verify.c b/test/file-verify.c
index f33b24a..89cbb02 100644
--- a/test/file-verify.c
+++ b/test/file-verify.c
@@ -381,9 +381,12 @@ static int test(struct io_uring *ring, const char *fname, int buffered,
v[i].iov_base = buf[i];
v[i].iov_len = CHUNK_SIZE;
}
- ret = io_uring_register_buffers(ring, v, READ_BATCH);
+ ret = t_register_buffers(ring, v, READ_BATCH);
if (ret) {
- fprintf(stderr, "Error buffer reg %d\n", ret);
+ if (ret == T_SETUP_SKIP) {
+ ret = 0;
+ goto free_bufs;
+ }
goto err;
}
}
@@ -477,6 +480,7 @@ static int test(struct io_uring *ring, const char *fname, int buffered,
done:
if (registered)
io_uring_unregister_buffers(ring);
+free_bufs:
if (vectored) {
for (j = 0; j < READ_BATCH; j++)
for (i = 0; i < nr_vecs; i++)
--
2.40.0
next reply other threads:[~2023-04-20 18:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 18:57 Gabriel Krisman Bertazi [this message]
2023-04-20 19:04 ` [PATCH] test/file-verify.t: Don't run over mlock limit when run as non-root 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=20230420185728.4104-1-krisman@suse.de \
--to=krisman@suse.de \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).