Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2006 08:17:41 +0800
From:      David Xu <davidxu@freebsd.org>
To:        arch@freebsd.org
Subject:   vfs_aio.c is still not safe
Message-ID:  <43D6C3A5.4060100@freebsd.org>

next in thread | raw e-mail | index | archive | help
Even with recently change to vfs_aio.c, the kernel AIO code is
still not safe to be used. The problem is a AIO daemon thread
may be blocked on sockets, pipe, and fifo if peer does not
transfer any data, the problem can be accumulated and all
daemon threads will be blocked if such user process increases.
I don't know who hacked socket code to support some level of
callback, it seems work, but in fact, it may only work for
first AIO request, if user queued multiple requests, same problem
will happen, I tried to workaround this problem by using
non-blocking I/O, but with current file ops, there is no such
support, I can not change O_NONBLOCK on fly because userland
and kernel have race, PR: kernel/41331 is a well explained
problem, userland will hit the race.

So possible solution could be:
1) disable AIO support for none disk file.
2) someone implement callbacks for pipe, fifo, and add
   non-blocking feature to fo_read/fo_write.

The former is simple, the later needs some effort, however
with superio kqueue, the AIO support for socket and pipe is
less important, I prefer 1) to make the AIO code usable.

David Xu







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43D6C3A5.4060100>