• Pavel Emelyanov's avatar
    page-server: Allow blocking on socket · a99b7c1b
    Pavel Emelyanov authored
    When splicing page server data from UNIX socket we may get
    error (EAGAIN) from splice if no data is available on the
    socket yet. This is because the SPLICE_F_NONBLOCK flag is
    checked by af_unix.c in the kernel to decide whether or
    not to do blocking read.
    
    This is not symmetrical with TCP sockets, which only check
    for the socket's O_NONBLOCK flag for the same decicion.
    
    Dropping the SPLICE_F_NONBLOCK flag is not possible too, as
    otherwise we'll block on the pipe when trying to put data
    into it. Even if part of the data fits into it kernel would
    block anyway untill full buffer is in. And there will be
    no read() from the pipe, as it should happen one step later
    in the same task.
    
    So to untie this, we need to wait for the data explicitly
    with poll().
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    a99b7c1b
Name
Last commit
Last update
Documentation Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...