SlideShare a Scribd company logo
Linux AIO [email_address]
Agenda IO Models POSIX AIO Linux Native AIO
IO Models
Sync Blocking IO
Sync Non-blocking IO
Async Blocking IO
Async Non-blocking IO
POSIX AIO glibc implementation Built on top of pthread All user space
POSIX AIO man 3 aio aio_init(3), aio_cancel(3), aio_cancel64(3),  aio_error(3), aio_error64(3), aio_fsync(3), aio_fsync64(3), aio_init(3), aio_read(3),  aio_read64(3), aio_return(3), aio_return64(3),  aio_suspend(3), aio_suspend64(3), aio_write(3), aio_write64(3)
POSIX AIO __aio_enqueue_request if (nthreads < optim.aio_threads && idle_thread_count == 0) aio_create_helper_thread (&thid, handle_fildes_io, newp) Queued operations: LIO_READ,LIO_WRITE,LIO_NOP LIO_DSYNC, LIO_SYNC, LIO_READ64,LIO_WRITE64
POSIX AIO handle_fildes_io pread/read pwrite/write fdatasync/fsync
POSIX AIO Example...
Linux Native AIO Kernel space implementation Use workqueue to handle deferred left-overs Libaio wrappers
Linux Native AIO Only support AIO-DIO No AIO fsync/fdatasync Not on sockets/pipes
Supported Operations IO_CMD_PREAD, IO_CMD_PWRITE IO_CMD_FSYNC, IO_CMD_FDSYNC IO_CMD_POLL, IO_CMD_NOOP IO_CMD_PREADV, IO_CMD_PWRITEV
Syscall APIs int io_setup(int maxevents, io_context_t *ctxp); int io_destroy(io_context_t ctx); int io_submit(io_context_t ctx, long nr, struct iocb *ios[]); int io_cancel(io_context_t ctx, struct iocb *iocb, struct io_event *evt); int io_getevents(io_context_t ctx_id, long min_nr, long nr, struct io_event *events, struct timespec *timeout);
Libaio wrappers int io_queue_init(int maxevents, io_context_t *ctxp);  int io_queue_release(io_context_t ctx); int io_queue_run(io_context_t ctx); io_prep_pread, io_prep_pwrite, io_set_callback
Kernel Implementation io_submit() aio_setup_iocb() aio_run_iocb() kiocb->ki_retry callback aio_complete() static struct workqueue_struct *aio_wq;
Native AIO Example...
Q & A?

More Related Content

PDF
Performance optimization for all flash based on aarch64 v2.0
PDF
InnoDB Performance Optimisation
PPTX
Introduction to PostgreSQL
PDF
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
PDF
Elasticsearch for Logs & Metrics - a deep dive
PDF
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
PPSX
Oracle Performance Tuning Fundamentals
PDF
QEMU Disk IO Which performs Better: Native or threads?
Performance optimization for all flash based on aarch64 v2.0
InnoDB Performance Optimisation
Introduction to PostgreSQL
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Elasticsearch for Logs & Metrics - a deep dive
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Oracle Performance Tuning Fundamentals
QEMU Disk IO Which performs Better: Native or threads?

What's hot (20)

PDF
Redo internals ppt
PDF
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
PDF
Accelerating Ceph with RDMA and NVMe-oF
PPTX
Hitchhiker's Guide to free Oracle tuning tools
PPT
Wait events
PDF
Postgresql database administration volume 1
PDF
Ceph issue 해결 사례
PDF
Crimson: Ceph for the Age of NVMe and Persistent Memory
PDF
Ceph and RocksDB
PPTX
Oracle Application Express Introduction
PDF
Advanced RAC troubleshooting: Network
PPTX
Ext4 write barrier
PDF
PostgreSQL Streaming Replication Cheatsheet
PDF
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
PDF
Troubleshooting tips and tricks for Oracle Database Oct 2020
PDF
Seastore: Next Generation Backing Store for Ceph
PDF
Ceph Tech Talk: Ceph at DigitalOcean
PPTX
ZFS appliance
PDF
BPF Internals (eBPF)
PDF
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Redo internals ppt
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
Accelerating Ceph with RDMA and NVMe-oF
Hitchhiker's Guide to free Oracle tuning tools
Wait events
Postgresql database administration volume 1
Ceph issue 해결 사례
Crimson: Ceph for the Age of NVMe and Persistent Memory
Ceph and RocksDB
Oracle Application Express Introduction
Advanced RAC troubleshooting: Network
Ext4 write barrier
PostgreSQL Streaming Replication Cheatsheet
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
Troubleshooting tips and tricks for Oracle Database Oct 2020
Seastore: Next Generation Backing Store for Ceph
Ceph Tech Talk: Ceph at DigitalOcean
ZFS appliance
BPF Internals (eBPF)
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Ad

Similar to Linux aio (20)

PPTX
Semana Interop: Desenvolvendo Asp.NET para Linux
PDF
Node.js - iJS 2019
PDF
What Have Syscalls Done for you Lately?
KEY
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
PDF
Syncing up with Python’s asyncio for (micro) service development, Joir-dan Gumbs
PPT
[CCC-28c3] Post Memory Corruption Memory Analysis
PPTX
Linux Initialization Process (1)
PDF
Ani hilate this week
PDF
[HITB Malaysia 2011] Exploit Automation
PDF
Investigation report on 64 bit support in Android Open Source Project
PDF
Shellcoding in linux
PPTX
04 - I love my OS, he protects me (sometimes, in specific circumstances)
PDF
OS*: OSv on *
PDF
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
PPTX
Adios Api Scidac Tutorialv2
PDF
That Goes Without Alpha-Num (or Does It ?) all your base10 are belong to us
PDF
Trap Handling in Linux
PDF
[Kiwicon 2011] Post Memory Corruption Memory Analysis
PPTX
Operating Systems - A Primer
PDF
Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...
Semana Interop: Desenvolvendo Asp.NET para Linux
Node.js - iJS 2019
What Have Syscalls Done for you Lately?
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Syncing up with Python’s asyncio for (micro) service development, Joir-dan Gumbs
[CCC-28c3] Post Memory Corruption Memory Analysis
Linux Initialization Process (1)
Ani hilate this week
[HITB Malaysia 2011] Exploit Automation
Investigation report on 64 bit support in Android Open Source Project
Shellcoding in linux
04 - I love my OS, he protects me (sometimes, in specific circumstances)
OS*: OSv on *
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
Adios Api Scidac Tutorialv2
That Goes Without Alpha-Num (or Does It ?) all your base10 are belong to us
Trap Handling in Linux
[Kiwicon 2011] Post Memory Corruption Memory Analysis
Operating Systems - A Primer
Python Brasil 2010 - Potter vs Voldemort - Lições ofidiglotas da prática Pyth...
Ad

More from bergwolf (11)

PDF
NFS updates for CLSF
PPT
PDF
CLFS 2010
PPT
Google Megastore
PDF
vmfs intro
PDF
pnfs status
PPT
linux trim
PPT
network filesystem briefs
PDF
logfs
PDF
gsoc and grub4ext4
PDF
grub4ext4 status-plans
NFS updates for CLSF
CLFS 2010
Google Megastore
vmfs intro
pnfs status
linux trim
network filesystem briefs
logfs
gsoc and grub4ext4
grub4ext4 status-plans

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
KodekX | Application Modernization Development
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Empathic Computing: Creating Shared Understanding
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
The Rise and Fall of 3GPP – Time for a Sabbatical?
Diabetes mellitus diagnosis method based random forest with bat algorithm
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Machine learning based COVID-19 study performance prediction
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
MYSQL Presentation for SQL database connectivity
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
KodekX | Application Modernization Development
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Review of recent advances in non-invasive hemoglobin estimation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

Linux aio