4 ms·
Maybe they meant using IORING_OP_MADVISE with MADV_WILLNEED to bring ranges into memory?
by jeffbee 1mo ago
Maybe they meant using IORING_OP_MADVISE with MADV_WILLNEED to bring ranges into memory?
- marginalia_nu 1mo agoThough at that point you can just use FADV_WILLNEED.
- jeffbee 1mo agoI'm just steelmanning here ¯\_(ツ)_/¯
- deleted 1mo ago[deleted]
- adrian_b 1mo agoThe Linux-specific MADV_POPULATE_READ is much more reliable than MADV_WILLNEED if you want to implement read-ahead for a memory-mapped file. In my opinion, the POSIX advices specified for madvise are useless or even dangerous. On Linux, for precise control of memory-mapped files one should use only these 4 Linux-specific advices: MADV_COLD, MADV_PAGEOUT, MADV_POPULATE_READ & MADV_POPULATE_WRITE. These should be used within io_uring, so that they will be executed asynchronously. These have a well-documented meaning and using them carefully should be sufficient to reach optimum performance with mmap.