liburing icon indicating copy to clipboard operation
liburing copied to clipboard

possible issue after having upgraded to v2.6

Open lano1106 opened this issue 2 years ago • 47 comments

Since, I have upgraded to v2.6, I experience a periodic data corruption in the inbound TCP stream:

[2024-05-19 13:40:51] EROR WSCTX/log_emit_function 788: ssl error 167772603: error:0A0001BB:SSL routines::bad record type
[2024-05-19 13:40:51] EROR WSCTX/log_emit_function 788: ssl error 167772473: error:0A000139:SSL routines::record layer failure
[2024-05-19 13:40:51] INFO WSCTX/log_emit_function 788: lws_ssl_capable_read (0x7f9790015b80): ssl err 1 errno 0
[2024-05-19 13:40:51] INFO WSCTX/log_emit_function 788: lws_service_fd_tsi_nocheck (0x7f9790015b80): LWS_HPI_RET_PLEASE_CLOSE_ME
[2024-05-19 13:40:51] INFO WSCTX/log_emit_function 788: __lws_close_free_wsi (0x7f9790015b80): caller: lws_service_fd_tsi: close_and_handled

not sure if this could have anything to do with IORING_SETUP_NO_SQARRAY new feature...

I'll try to downgrade to v2.5 to see if the problem go away...

I'm not 100% sure where the problem comes from because I have changed few things all at the same time...

liburing my own code Change my instance type from 4 core machine to a 8 cores system...

I'll do some more experimentation, I'll report back if downgrading liburing makes the problem go away...

Important detail. This is with 6.8.9 kernel

lano1106 avatar May 19 '24 13:05 lano1106

data corruption occurs every 2-5 minutes on a ring managing 1 low-volume TCP connection... So ring buffer wraparound issue is a plausible cause.

Also worth mentioning. It happens only on a specific ring. The one that is configured with IORING_SETUP_ATTACH_WQ

lano1106 avatar May 19 '24 14:05 lano1106

I doubt this might be an issue but a particularity of my setup is that my 6.8.9 kernel has been patched with the NAPI busy polling code...

there is a very small probability that if the registering NAPI command value did change between what is in the patch vs the final official value.

imho, this would only make the registration fail but maybe not...

lano1106 avatar May 19 '24 14:05 lano1106

here is an update.... I have downgraded liburing from 2.6 to 2.5 and my inbound TCP stream corruption is gone...

My intuition tells me that there is something wrong with IORING_SETUP_NO_SQARRAY feature because I am not seeing what else could cause the issue...

I'll try to look into the IORING_SETUP_NO_SQARRAY code to see if I could not find the problem and I will report back here if I find something...

I am not reading the io_uring list as much as I did in the past so I missed the discussion around IORING_SETUP_NO_SQARRAY but I guess that there is no reason to not use it and removing this level of indirection is slightly improving io_uring performance, right?

I guess this will become clearer once I look into its code...

lano1106 avatar May 20 '24 00:05 lano1106

I can take a look if we can get a reproducer.

If you can't share your code directly, then could you please share what io_uring flags you're using and what you're sending over TCP so I can build one?

spikeh avatar May 20 '24 14:05 spikeh

And in lieu of a reproducer, can you simply try and disable IORING_SETUP_NO_SQARRAY just to rule that out? Just removing the

p->flags |= IORING_SETUP_NO_SQARRAY;

line in src/setup.c:io_uring_queue_init_try_nosqarr() should do it. I don't see how this can be related at all, or how the upgrade in general could break this for you, but let's see if we can collect some data points.

Another option is to try and bisect it between 2.5 and 2.6, if it really is the liburing side that broke it.

axboe avatar May 20 '24 14:05 axboe

I agree with Jens on this one, if you suspect IORING_SETUP_NO_SQARRAY, please try removing it. It can only be the problem if:

  1. You hacked into liburing internals and was using not exposed to users sqarray.
  2. There is a bug, maybe with offset calculations or so. Is it x64-86? Or some other arch?

isilence avatar May 20 '24 16:05 isilence

I have followed Jens suggestion to comment out the IORING_SETUP_NO_SQARRAY line in setup.c...

With that, my program works flawlessly with liburing 2.6...

you seem very confident that the problem cannot come from the IORING_SETUP_NO_SQARRAY kernel code. I'll trust you on that....

I may have another investigation lead...

I do use IORING_SETUP_NO_MMAP

and I assign remaining huge page memory to ring buffers if it has enough free memory. If not enough, my code fallback on using posix_memalign(). maybe that by modifying the amount of memory used by the io_uring with the IORING_SETUP_NO_SQARRAY option, this somehow make my code mismanage the memory...

lano1106 avatar May 20 '24 22:05 lano1106

I have followed Jens suggestion to comment out the IORING_SETUP_NO_SQARRAY line in setup.c... With that, my program works flawlessly with liburing 2.6...

you seem very confident that the problem cannot come from the IORING_SETUP_NO_SQARRAY kernel code. I'll trust you on that....

Not sure who you're replying to, but you never know, everything can happen. I'm getting you're not using sqarray, so might be some mishap in the offset calculation, especially in some less common cases like NO_MMAP or so.

I may have another investigation lead...

I do use IORING_SETUP_NO_MMAP

and I assign remaining huge page memory to ring buffers if it has enough free memory. If not enough, my code fallback on using posix_memalign(). maybe that by modifying the amount of memory used by the io_uring with the IORING_SETUP_NO_SQARRAY option, this somehow make my code mismanage the memory...

If you'd make it always use posix_memalign(), does it still reproduce or is it only happen with huge pages?

isilence avatar May 20 '24 22:05 isilence

Pavel,

I am going to give it a shot... To use posix_memalign() memory to the allocated ring buffers...

FYI, I allocate 3 io_urings in a single huge page. I use io_uring_queue_init_mem() return value to update the starting address to allocate the next ring structure... This might be another function to review...

I might not be able to continue the investigation today but I will for sure it tomorrow and update you on what I find...

Here are the log traces generated by the code setuping the rings... I am not expecting it to make any sense to anyone... I wrote the code many months ago, The code is in front of me and without some reviewing effort I cannot even figure out the traces...

for instance, I don't get why the huge page allocation trace appears after creating the first ring...

[2024-05-20 22:10:10] INFO WSCTX/createEventLoop tsi 0 io_uring loop took 282624 bytes from the huge page
[2024-05-20 22:10:10] INFO WSCTX/createEventLoop Master io_uring fd: 14
[2024-05-20 22:10:10] INFO WSCTX/getExtraHugePages mmap(142606336) succeeded
[2024-05-20 22:10:10] INFO WSCTX/initGroupBuffer Provide 8192 17408 bytes buffers to gid 1 from address 0x0x7fa37f800000 (142606336)
[2024-05-20 22:10:10] INFO Runnable/start ExecutionSVC initialized
[2024-05-20 22:10:10] INFO WSCTX/createEventLoop tsi 1 io_uring loop took 28672 bytes from the huge page
[2024-05-20 22:10:10] INFO WSCTX/initGroupBuffer Provide 32 17408 bytes buffers to gid 2 from address 0x0x7fa3a664c000 (557056)
[2024-05-20 22:10:10] INFO Runnable/start TradeFeed initialized
[2024-05-20 22:10:10] INFO WSCTX/createEventLoop tsi 2 io_uring loop took 28672 bytes from the huge page
[2024-05-20 22:10:10] INFO WSCTX/initGroupBuffer Provide 64 17408 bytes buffers to gid 3 from address 0x0x7fa3a66db000 (1114112)

here is something interesting... the io ring giving trouble is the one sandwiched in the middle. tsi 1 ring...

the more we discuss about the issue, the more it looks like some buffer overlap problem... The only remaining thing to determine is the source of the overlap...

Update: I have made sense of my own traces...

My program makes 2 mmap() calls... One of 2MB to store the 3 io_uring structures and the allocated buffers of the 2 smallest rings + 1 extra mmap() to allocate huge pages to allocate the 142MB allocated buffers of the ring 0.

I am going to improve my traces... I think that printing out the start and end region of each sections in the first huge page should make it obvious if there is an overlap somewhere...

lano1106 avatar May 20 '24 22:05 lano1106

here are improved logs:

[2024-05-21 05:21:06] INFO WSCTX/logRingMemory tsi 0 sq:256 cq:16384 io_uring mem with sq array:279552 rounded:282624 safety:3072
[2024-05-21 05:21:06] INFO WSCTX/logRingMemory tsi 0 sq:256 cq:16384 io_uring mem:278528 rounded:278528 safety:0
[2024-05-21 05:21:06] INFO WSCTX/createEventLoop tsi 0 io_uring loop took 282624 bytes from the huge page 0x0x7ff5b6c00000-0x0x7ff5b6c45000
[2024-05-21 05:21:06] INFO WSCTX/createEventLoop Master io_uring fd: 14
[2024-05-21 05:21:06] INFO WSCTX/getExtraHugePages mmap(142606336) succeeded: 0x0x7ff58f800000
[2024-05-21 05:21:06] INFO WSCTX/initGroupBuffer Provide 8192 17408 bytes buffers to gid 1 from address 0x0x7ff58f800000-0x0x7ff598000000 (142606336)
[2024-05-21 05:21:06] INFO Runnable/start ExecutionSVC initialized
[2024-05-21 05:21:06] INFO WSCTX/logRingMemory tsi 1 sq:256 cq:512 io_uring mem with sq array:25600 rounded:28672 safety:3072
[2024-05-21 05:21:06] INFO WSCTX/logRingMemory tsi 1 sq:256 cq:512 io_uring mem:24576 rounded:24576 safety:0
[2024-05-21 05:21:06] INFO WSCTX/createEventLoop tsi 1 io_uring loop took 28672 bytes from the huge page 0x0x7ff5b6c45000-0x0x7ff5b6c4c000
[2024-05-21 05:21:06] INFO WSCTX/initGroupBuffer Provide 32 17408 bytes buffers to gid 2 from address 0x0x7ff5b6c4c000-0x0x7ff5b6cd4000 (557056)
[2024-05-21 05:21:06] INFO Runnable/start TradeFeed initialized
[2024-05-21 05:21:06] INFO WSCTX/logRingMemory tsi 2 sq:256 cq:512 io_uring mem with sq array:25600 rounded:28672 safety:3072
[2024-05-21 05:21:06] INFO WSCTX/logRingMemory tsi 2 sq:256 cq:512 io_uring mem:24576 rounded:24576 safety:0
[2024-05-21 05:21:06] INFO WSCTX/createEventLoop tsi 2 io_uring loop took 28672 bytes from the huge page 0x0x7ff5b6cd4000-0x0x7ff5b6cdb000
[2024-05-21 05:21:06] INFO WSCTX/initGroupBuffer Provide 64 17408 bytes buffers to gid 3 from address 0x0x7ff5b6cdb000-0x0x7ff5b6deb000 (1114112)

I suspect maybe some aligment rounding requirements are not met anymore with IORING_SETUP_NO_SQARRAY. Perfect aligment was maybe achieved accidentally with including the sqarrays.

one addition to the logs is that I have replicated the code in io_uring_alloc_huge() to find out the break out of the memory distributed in the io_uring structures. I was particularly interested in knowing the safety space created by round up mem_used to the next page boundary.

it turns out that with IORING_SETUP_NO_SQARRAY, there is 0 buffer. So if somewhere there is a buffer overflow, it was masked by the rounding up that is not present with IORING_SETUP_NO_SQARRAY.

maybe tsi 0 cq ring is overflowing into tsi 1 ring memory. I have looked a little bit the cq management code but it has become very complex... It does overflow management, it caches several entries and on and on... it is very hard for a non-initiated to review it... If it can help you, I can tell that with tsi 0, multishot recvmsg are used. multishots appears to have a special cq management...

lano1106 avatar May 21 '24 03:05 lano1106

with provided buffers memory out of the way and only the rings adjacent to each other...

it seems like have a winner... no more ring corruption... My apologize... it seems like the problem is on my side...

I'll keep the issue open so that once I find out what is causing the problem, it is documented...

[2024-05-21 12:36:03] INFO WSCTX/WebSocketContext mmap(2097152) succeeded: 0x0x7fa439400000
[2024-05-21 12:36:03] INFO WSCTX/initContext Options: 00001030
[2024-05-21 12:36:03] INFO WSCTX/createEventLoop tsi 0 io_uring loop took 278528 bytes from the huge page 0x0x7fa439400000-0x0x7fa439444000
[2024-05-21 12:36:03] INFO WSCTX/createEventLoop Master io_uring fd: 14
[2024-05-21 12:36:03] INFO WSCTX/getExtraHugePages mmap(142606336) succeeded: 0x0x7fa413800000
[2024-05-21 12:36:03] INFO WSCTX/initGroupBuffer Provide 8192 17408 bytes buffers to gid 1 from address 0x0x7fa413800000-0x0x7fa41c000000 (142606336)
[2024-05-21 12:36:03] INFO Runnable/start ExecutionSVC initialized
[2024-05-21 12:36:03] INFO WSCTX/createEventLoop tsi 1 io_uring loop took 24576 bytes from the huge page 0x0x7fa439444000-0x0x7fa43944a000
[2024-05-21 12:36:03] INFO WSCTX/initGroupBuffer Provide 32 17408 bytes buffers to gid 2 from address 0x0x7fa40c002000-0x0x7fa40c08a000 (557056)
[2024-05-21 12:36:03] INFO Runnable/start TradeFeed initialized
[2024-05-21 12:36:03] INFO WSCTX/createEventLoop tsi 2 io_uring loop took 24576 bytes from the huge page 0x0x7fa43944a000-0x0x7fa439450000
[2024-05-21 12:36:03] INFO WSCTX/initGroupBuffer Provide 64 17408 bytes buffers to gid 3 from address 0x0x7fa404002000-0x0x7fa404112000 (1114112)

lano1106 avatar May 21 '24 12:05 lano1106

but I am still perplexed... my program only reads into the provided buffers... it is io_uring that does the writing...

I suspect an underflow in the provided buffers... I was doing an ugly hack to support kTLS by writing into the io_uring_recvmsg_out (16 bytes) and moving the payload buffer 5 bytes ahead but I am not using this anymore since software kTLS is not providing any performance benefit (last time I checked)... This could have been my issue if io_uring_recvmsg_out layout did change...

    /*
     * the io_uring inline functions manipulating the recvmsg multishot
     * result do not need to have the exact same msghdr than the one
     * used to initiate the request. It only needs to have one
     * that has the exact same value for the fields msg_namelen & msg_controllen
     * so that it can navigate correctly into the buffer with the correct
     * offsets.
     */
    static struct msghdr s_msgh = {
        .msg_name = nullptr,
        .msg_namelen = 0,
        .msg_iov = nullptr,
        .msg_iovlen = 0,
        .msg_control = nullptr,
        .msg_controllen = CMSG_SPACE(sizeof(unsigned char)),
        .msg_flags = 0
    };
    /*
     * assume that recvmsg_out cannot be nullptr
     * If the assumption turns out to be false, it will be noticed
     * immediately with a SEGV.
     */
    auto *recvmsg_out{io_uring_recvmsg_validate(bidBuf, entry.bytes_read,
                                                &s_msgh)};
    char *payload{static_cast<char *>(io_uring_recvmsg_payload(recvmsg_out, &s_msgh))};
    /*
     * the initial bytes_read value included the space used by the recvmg_out
     * headers. We now set it to the payload size only.
     */
    entry.bytes_read =
    io_uring_recvmsg_payload_length(recvmsg_out,
                                    entry.bytes_read, &s_msgh);
#ifndef OPENSSL_NO_KTLS
    /*
     * A hack is required to work with kTLS.
     * recvmsg() with kTLS is passing payload buffer 5 bytes in front of the
     * user buffer so that it can recreate the TLS header in front of the TLS
     * payload.
     *
     * Also note that the code only prepend the SSL header if control data
     * is present but it should always be present in msgs coming from kTLS.
     */
    struct cmsghdr *cmsg = io_uring_recvmsg_cmsg_firsthdr(recvmsg_out, &s_msgh);
    if (cmsg) {
        if (cmsg->cmsg_type == TLS_GET_RECORD_TYPE) { // 2
            payload -= SSL3_RT_HEADER_LENGTH;         // 5
            payload[0] = *((unsigned char *)CMSG_DATA(cmsg));
            payload[1] = TLS1_2_VERSION_MAJOR;
            payload[2] = TLS1_2_VERSION_MINOR;
            /* returned length is limited to msg_iov.iov_len above */
            payload[3] = (entry.bytes_read >> 8) & 0xff;
            payload[4] = entry.bytes_read & 0xff;
            entry.bytes_read += SSL3_RT_HEADER_LENGTH;
        }
    }
#endif

here is what I will do next. I'll put back the provided buffers into my huge page but I'll put an empty 4KB space between the end of the rings and the provided buffer.

with no under/over flow this space should remain null. If there is no non-null data in it. It will be proof that something is writing there and it should not...

lano1106 avatar May 21 '24 14:05 lano1106

but I am still perplexed... my program only reads into the provided buffers... it is io_uring that does the writing...

True, but the provided buffers start and length are controlled solely by you, so it'd be very possible that you'd run into problems if you have overlap. Maybe add some red zoning or similar as a debug thing to detect if anything is stepping over spots they should not be.

axboe avatar May 21 '24 15:05 axboe

This could be either a kernel side or application issue, so if you can debug a bit and figure out where it's coming from, that would certainly be helpful in figuring out who the culprit is.

axboe avatar May 21 '24 15:05 axboe

io_uring_recvmsg_out layout did not change, it's UABI so cannot change. But that doesn't mean that the kernel side handling couldn't be broken, though that seems unlikely if you are confident this happens with 2.6 and not with 2.5 of liburing (which still seems suspect, and I guess more likely causing a layout change for you that then further makes the bug more likely to trigger).

Have you tried running your app under valgrind, for example?

axboe avatar May 21 '24 15:05 axboe

IIUC 2.6 is the first version switching *NO_SQARRAY on by default. I wouldn't dismiss that clue, especially since it's confirmed switching it off doing something that resolves the issue and NO_MMAP coverage is not as good.

Sounds like rings might be overlapping with provided buffers, I'll look through the offset calculation. How does the setup addresses calc look like? Similar to below or you do offsets by hand?

off = io_uring_queue_init_mem(buf);
register_provided_buffers(buf + off);

isilence avatar May 21 '24 15:05 isilence

but I am still perplexed... my program only reads into the provided buffers... it is io_uring that does the writing...

True, but the provided buffers start and length are controlled solely by you, so it'd be very possible that you'd run into problems if you have overlap. Maybe add some red zoning or similar as a debug thing to detect if anything is stepping over spots they should not be.

you are correct about that... idk for sure what is going on or else I would tell... All I have is suspicions on where the problem could be.

Add an empty page between the end of a ring and its provided buffers is the next step.

Checking that the provided buffers initialization was good, is the first thing that I did check. AFAIK, it seems to be good:

/*
 * initGroupBuffer()
 *
 * Called from:
 * - WSProtocol::initEventLoop()
 *
 * In the client constructor, the protocols are added to the context.
 * Once all the protocols have been added and before the main thread
 * enters its event loop, the other protocols are initialized.
 */
void WebSocketContext::initGroupBuffer(unsigned gid, int tsi, int nr)
{
    if (gid >= Kraken::GID_NUMS)
        throw std::runtime_error{"WebSocketContext::initGroupBuffer(): invalid gid parameter"};
    if (m_brData[gid].io_uringBuf)
        throw std::runtime_error{"WebSocketContext::initGroupBuffer(): Request to init an initialized buffer"};
    auto *loop{getLoop(tsi)};

    if (ev_backend(loop) != EVBACKEND_IOURING)
        return;

    int res;
    const size_t rxBufSize{getRxBufSize(tsi)};

    m_brData[gid].bufTotalSize = nr*rxBufSize;
    if (m_brData[gid].bufTotalSize <= hpFreeSpace()) {
        m_brData[gid].io_uringBuf = hpCurPos();
        m_brData[gid].bufOrig = IO_URING_HP_ORIG;
    }  else {
        m_brData[gid].io_uringBuf = getExtraHugePages(m_brData[gid].bufTotalSize);
        if (!m_brData[gid].io_uringBuf) {
            res = posix_memalign(reinterpret_cast<void **>(&m_brData[gid].io_uringBuf),
                                 4096, m_brData[gid].bufTotalSize);

            if (unlikely(res)) {
                ERROR2("posix_memalign: (%d) %s", res, strerror(res));
                throw std::runtime_error{"posix_memalign() failure"};
            }
            WARN0_SL("memory allocated with posix_memalign()");
            m_brData[gid].bufOrig = POSIX_ALIGN_ORIG;
        } else
            m_brData[gid].bufOrig = EXTRA_HP_ORIG;
    }
    m_brData[gid].ring = static_cast<struct io_uring *>(ev_io_uring_ring(loop));
    m_brData[gid].nentries = nr;
    constexpr unsigned int flags{};

    /*
     * Allocate memory for the new bufring and register it to the kernel by
     * calling io_uring_register_buf_ring() 
     */ 
    m_brData[gid].br = io_uring_setup_buf_ring(m_brData[gid].ring, nr, gid,
                                               flags, &res);
    if (unlikely(res)) {
        ERROR2("io_uring_setup_buf_ring: (%d) %s", res, strerror(res));
        throw std::runtime_error{"io_uring_setup_buf_ring() failure"};
    }
    auto brmask{io_uring_buf_ring_mask(nr)};
    char *ptr{m_brData[gid].io_uringBuf};

    // io_uring_buf_ring_init() is called in io_uring_setup_buf_ring()
//    io_uring_buf_ring_init(m_brData[gid].br);
    for (int i{}; i < nr; ++i) {
        io_uring_buf_ring_add(m_brData[gid].br, ptr, rxBufSize, i, brmask, i);
        ptr += rxBufSize;
    }
    io_uring_buf_ring_advance(m_brData[gid].br, nr);
    INFO6("Provide %d %lu bytes buffers to gid %u from address 0x%p-0x%p (%lu)",
          nr, rxBufSize, gid, m_brData[gid].io_uringBuf,
          m_brData[gid].io_uringBuf+m_brData[gid].bufTotalSize,
          m_brData[gid].bufTotalSize);

    res = ev_iouring_init_buffers(loop, m_brData[gid].io_uringBuf,
                                  m_brData[gid].br, rxBufSize, nr, gid);
    if (unlikely(res < 0)) {
        ERROR5("ev_iouring_provide_buffers: (%d) %s\n"\
               "ring_fd: %d, enter_ring_fd: %d, int_flags: %u",
               -res, strerror(-res), m_brData[gid].ring->ring_fd,
               m_brData[gid].ring->enter_ring_fd,
               static_cast<unsigned>(m_brData[gid].ring->int_flags));
        throw std::runtime_error{"ev_iouring_provide_buffers() failure"};
    }
    if (m_brData[gid].bufOrig == IO_URING_HP_ORIG)
        advanceHpOffset(m_brData[gid].bufTotalSize);
}

lano1106 avatar May 21 '24 15:05 lano1106

IIUC 2.6 is the first version switching *NO_SQARRAY on by default. I wouldn't dismiss that clue, especially since it's confirmed switching it off doing something that resolves the issue and NO_MMAP coverage is not as good.

Sounds like rings might be overlapping with provided buffers, I'll look through the offset calculation. How does the setup addresses calc look like? Similar to below or you do offsets by hand?

Agree, it sounds like overlap, and that could of course be a liburing bug due to the combination of NO_SQARRAY and using NO_MMAP.

axboe avatar May 21 '24 15:05 axboe

io_uring_recvmsg_out layout did not change, it's UABI so cannot change. But that doesn't mean that the kernel side handling couldn't be broken, though that seems unlikely if you are confident this happens with 2.6 and not with 2.5 of liburing (which still seems suspect, and I guess more likely causing a layout change for you that then further makes the bug more likely to trigger).

Have you tried running your app under valgrind, for example?

there is something that valgrind does not like about programs using io_uring... I have never been able to run valgrind on my program with great success... that might have changed. I have not tried out recently... What I have been using successfully in the past with very good result, it is -fsanitize-address (or something like that)...

if you read my updates since yesterday... I have narrowed down the issue to:

  • 2.6 is fine as long as IORING_SETUP_NO_SQARRAY is not used
  • IORING_SETUP_NO_SQARRAY is fine as long as tsi 1 ring memory is not adjacent to its provided buffers memory area.

lano1106 avatar May 21 '24 15:05 lano1106

IIUC 2.6 is the first version switching *NO_SQARRAY on by default. I wouldn't dismiss that clue, especially since it's confirmed switching it off doing something that resolves the issue and NO_MMAP coverage is not as good.

Sounds like rings might be overlapping with provided buffers, I'll look through the offset calculation. How does the setup addresses calc look like? Similar to below or you do offsets by hand?

Agree, it sounds like overlap, and that could of course be a liburing bug due to the combination of NO_SQARRAY and using NO_MMAP.

this is what I am leading to think.

In https://github.com/axboe/liburing/issues/1151#issuecomment-2121676675

there are logRingMemory traces showing the memory layout with or without NO_SQARRAY. When the option is not set, there is a 3KB safety zone. with NO_SQARRAY option set, everything is flush to the byte and immediately adjacent to the next structure...

lano1106 avatar May 21 '24 15:05 lano1106