News for hackers. Stuff that matters.
Re:What's So Bad About Posix I/O? by Jasper_ on Tuesday September 12, 2017 @12:28PM (#15228685)
> If poll where to return non-ready (and remember that poll has no idea which pages you are interested in), what action, within posix, would you take to change it?

readahead(2) ? posix_fadvise(2) ?

Re:What's So Bad About Posix I/O? by cturner on Tuesday September 12, 2017 @01:50PM (#15229520)
From man page of readahead(2), "readahead() blocks until the specified data has been read." The other one claims async functionality. But says it is not reliable.

An idea for how it could be implemented in linux: kernel would offer a new kind of file descriptor. It would have a limited, in-kernel buffer, much like a socket has an arrival space. Once you have it, call something like,

   newkind_page_copy(newkind_fd, disk_fd, page_count, timeout) 
Timeout could be unlimited.

The buffer would behave like socket for the purpose of the read and error lists in select/poll/epoll. If you closed either descriptor, it goes to error-state. Within the kernel, it would watch real_file_fd, using code to similar to whatever is underneath inotify. Like inotify, this would not work for NFS.

Re:What's So Bad About Posix I/O? by Jasper_ on Tuesday September 12, 2017 @02:58PM (#15230527)
> From man page of readahead(2), "readahead() blocks until the specified data has been read."

? What man page are you reading? The goal of readahead is to prime the cache and return immediately. http://man7.org/linux/man-pages/man2/readahead.2.html

Re:What's So Bad About Posix I/O? by cturner on Wednesday September 13, 2017 @03:02PM (#15241496)
I quoted from this one, https://linux.die.net/man/2/readahead

There is a second obstacle I have in mind, around the robustness of this. Imagine if we had an implementation of that which reliably returned quickly. But we take our time doing the subsequent read. By the time we do, the value has already been chased out of the cache. It is an edge-case, and you could probably avoid it in practice, but it would be significant effort to to verify your mechanism, and would create cognitive load.