Comments (10)
Great! Updated:
https://git.kernel.dk/cgit/linux/commit/?h=io_uring-6.10&id=06fe9b1df1086b42718d632aa57e8f7cd1a66a21
Closing this one, it'll go into Linus's tree later this week, before 6.10-rc2. Thanks for the report, and for testing -rc kernels! Much better to find these kinds of things before they hit an actual release.
from liburing.
Was just poking at this based on your earlier tweet, this is what I see here too. liburing seems to be underestimating the memory required, or the kernel overestimating. I'll poke a bit and figure out what is going on.
from liburing.
The patch worked!
Sure, can use Lucas Mülling <[email protected]>
from liburing.
I think it's the Kernel, since I came to this by doing things by hand, without liburing.
from liburing.
You sure? Looks like liburing passing in a too small value here. For example, for 128 sq entries, which is 256 entries, liburing passes in 4096. But that covers only the CQEs themselves, not the shared ring space which is 64 bytes. So the kernel thinks it should be 4096+64, liburing thinks it's 4096.
from liburing.
Hmm maybe it is the kernel...
from liburing.
Not sure, weird that is works on previous kernels using the same ring size.
from liburing.
Agree, the most likely suspect is the kernel not honoring old userspace which still does separate mmap's rather than take advantage for the single mmap.
from liburing.
Try this:
diff --git a/io_uring/memmap.c b/io_uring/memmap.c
index 4785d6af5fee..e5f634a1218e 100644
--- a/io_uring/memmap.c
+++ b/io_uring/memmap.c
@@ -244,17 +244,20 @@ __cold int io_uring_mmap(struct file *file, struct vm_area_struct *vma)
struct io_ring_ctx *ctx = file->private_data;
size_t sz = vma->vm_end - vma->vm_start;
long offset = vma->vm_pgoff << PAGE_SHIFT;
+ unsigned int npages;
void *ptr;
ptr = io_uring_validate_mmap_request(file, vma->vm_pgoff, sz);
if (IS_ERR(ptr))
return PTR_ERR(ptr);
+ npages = ctx->n_ring_pages;
switch (offset & IORING_OFF_MMAP_MASK) {
case IORING_OFF_SQ_RING:
+ npages = min(npages, (sz + PAGE_SIZE - 1) >> PAGE_SHIFT);
+ fallthrough;
case IORING_OFF_CQ_RING:
- return io_uring_mmap_pages(ctx, vma, ctx->ring_pages,
- ctx->n_ring_pages);
+ return io_uring_mmap_pages(ctx, vma, ctx->ring_pages, npages);
case IORING_OFF_SQES:
return io_uring_mmap_pages(ctx, vma, ctx->sqe_pages,
ctx->n_sqe_pages);
from liburing.
Tweaked it a bit and pushed it here:
https://git.kernel.dk/cgit/linux/commit/?h=io_uring-6.10&id=6767af20a5ea99889a64ef90a7f22c23c7d0b962
I like to add a Reported-by: tag to the commits to attribute the person who reported the issue. If you don't mind that, please provide me with an identity and email that I can use for that, eg Name <[email protected]>
that I can put in there. If you don't want.
from liburing.
Related Issues (20)
- io_uring read multishot fails when trying to read a tty HOT 8
- Is there a way to synchronously wait for a completion of a submitted write for a particular FD HOT 2
- redefinition of 'struct in6_pktinfo' when building on ubi7 with gcc/g++ 9.5.0 HOT 5
- Can we know how many bytes we have read by using io_uring_prep_readv method? HOT 1
- RCU calls made by the NAPI busy poll code generates context switches occupying 50% of the time of the CPU hosting the sqp thread HOT 92
- Per-iovec zero-copy and fixed buffer settings for writev/sendmsg HOT 5
- possible socket leakage with direct file descriptors HOT 21
- Ordering guarantees between accept and close? HOT 11
- SYSCHK(syscall(__NR_io_uring_setup, 10, ¶ms)): Invalid argument HOT 3
- io_uring openat non-existing file, cqe->res returns -2, outside of specification HOT 2
- io_uring_prep_recv with IORING_RECVSEND_BUNDLE always fills only one buffer at a time HOT 13
- io_uring_prep_send_bundle should not have len argument HOT 5
- Wrong number of arguments in io_uring_prep_fixed_fd_install man
- test buf-ring-nommap.t failed with -12 (-ENOMEM) in ppc64le arch.
- Long tail between submit event to complete event exceed 1 second
- SQE timeout with IORING_TIMEOUT_ETIME_SUCCESS set return a CQE with res field equal to -ETIME HOT 4
- io_poll and sqpoll cause IOPS degradation
- ppc64le: Tests failed (2): <no-mmap-inval.t> <reg-fd-only.t> HOT 4
- ` io_uring_prep_link_timeout` may return undocumented error -ENOENT HOT 3
- Behavior of io_uring_wait_cqes is not documented for null `ts` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liburing.