[{"data":1,"prerenderedAt":124},["ShallowReactive",2],{"term-i\u002Fio-uring":3,"related-i\u002Fio-uring":108},{"id":4,"title":5,"acronym":6,"body":7,"category":89,"description":90,"difficulty":91,"extension":92,"letter":93,"meta":94,"navigation":95,"path":96,"related":97,"seo":102,"sitemap":103,"stem":106,"subcategory":6,"__hash__":107},"terms\u002Fterms\u002Fi\u002Fio-uring.md","io_uring",null,{"type":8,"value":9,"toc":83},"minimark",[10,15,19,23,26,30,72,76,79],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 - The Vibe Check",[16,17,18],"p",{},"io_uring is a modern Linux way of asking the kernel to do I\u002FO work that skips almost all the usual back-and-forth. Instead of your program repeatedly interrupting the kernel with is it done yet, is it done yet, both sides just drop requests and results into a shared ring buffer that they both can see, no syscall needed for most operations, which is a big reason it dramatically outperforms the older epoll-based model for I\u002FO-heavy workloads.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"io_uring is a Linux kernel interface for asynchronous I\u002FO that uses two shared ring buffers, a submission queue and a completion queue, memory-mapped between user space and the kernel, so applications can submit and retrieve I\u002FO requests with drastically fewer syscalls and context switches than traditional read\u002Fwrite or epoll-based models. It supports a wide range of operations beyond networking, including file I\u002FO, and underpins high-performance runtimes and databases that need to push I\u002FO throughput to its limit.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-c shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F io_uring: submit a read, keep working, reap the result later\nio_uring_prep_read(sqe, fd, buf, size, offset);\nio_uring_submit(&ring);\n\u002F\u002F ... do other work ...\nio_uring_wait_cqe(&ring, &cqe); \u002F\u002F pick up the result whenever it's ready\n","c","",[38,39,40,48,54,60,66],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,47],{},"\u002F\u002F io_uring: submit a read, keep working, reap the result later\n",[41,49,51],{"class":43,"line":50},2,[41,52,53],{},"io_uring_prep_read(sqe, fd, buf, size, offset);\n",[41,55,57],{"class":43,"line":56},3,[41,58,59],{},"io_uring_submit(&ring);\n",[41,61,63],{"class":43,"line":62},4,[41,64,65],{},"\u002F\u002F ... do other work ...\n",[41,67,69],{"class":43,"line":68},5,[41,70,71],{},"io_uring_wait_cqe(&ring, &cqe); \u002F\u002F pick up the result whenever it's ready\n",[11,73,75],{"id":74},"when-youll-hear-this","When You'll Hear This",[16,77,78],{},"\"We switched the proxy from epoll to io_uring and syscall overhead basically vanished.\" \u002F \"io_uring's shared ring buffers mean the kernel and your program barely have to talk.\"",[80,81,82],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":50,"depth":50,"links":84},[85,86,87,88],{"id":13,"depth":50,"text":14},{"id":21,"depth":50,"text":22},{"id":28,"depth":50,"text":29},{"id":74,"depth":50,"text":75},"backend","io_uring is a modern Linux way of asking the kernel to do I\u002FO work that skips almost all the usual back-and-forth.","advanced","md","i",{},true,"\u002Fterms\u002Fi\u002Fio-uring",[98,99,100,101],"Syscall","Context Switch","Zero-Copy","Event Loop",{"title":5,"description":90},{"changefreq":104,"priority":105},"weekly",0.7,"terms\u002Fi\u002Fio-uring","VqTPE8PGIc9-l9z5c4JkMdlFIdfiCmgcWaTtOTlr9jc",[109,113,117,121],{"title":99,"path":110,"acronym":6,"category":89,"difficulty":111,"description":112},"\u002Fterms\u002Fc\u002Fcontext-switch","intermediate","A context switch is the CPU pausing whatever thread it's running, carefully saving all its progress like a bookmark, and loading up a completely different...",{"title":101,"path":114,"acronym":6,"category":115,"difficulty":91,"description":116},"\u002Fterms\u002Fe\u002Fevent-loop","frontend","JavaScript can only do one thing at a time (single-threaded), but the Event Loop is the trick that makes it seem like it can multitask.",{"title":98,"path":118,"acronym":6,"category":89,"difficulty":119,"description":120},"\u002Fterms\u002Fs\u002Fsyscall","beginner","A syscall is your program raising its hand and asking the operating system kernel to do something it isn't allowed to do itself, like reading a file, openi...",{"title":100,"path":122,"acronym":6,"category":89,"difficulty":111,"description":123},"\u002Fterms\u002Fz\u002Fzero-copy","Normally, sending a file over the network means the OS copies its bytes from disk into your program's memory, then your program hands it to the OS again to...",1792528093319]