aio_mlock(2) system call
Gleb Smirnoff
glebius at FreeBSD.org
Mon Jun 3 21:29:16 UTC 2013
On Mon, Jun 03, 2013 at 07:12:55PM +0300, Konstantin Belousov wrote:
K> On Mon, Jun 03, 2013 at 02:06:18PM +0400, Gleb Smirnoff wrote:
K> > Hello!
K> >
K> > This patch brings a new system call - aio_mlock(2). The idea is
K> > quite clear from its name: it performs mlock(2), which can take
K> > a long time if pages aren't resident, under aio(4) control.
K> >
K> > The patch is quite simple, and non-desctructive. Here it is
K> > for your review.
K> >
K> > If no one objects, I'd like to add it to FreeBSD 10.
K>
K> I suggest to rename the aio_process() to aio_process_rw().
K> Also, it might make sense to assert aio_lio_opcode value on the entry
K> to aio_process_*() functions.
Will do.
K> > +static void
K> > +aio_process_mlock(struct aiocblist *aiocbe)
K> > +{
K> > + struct aiocb *cb = &aiocbe->uaiocb;
K> > + int error;
K> > +
K> > + error = vm_mlock(aiocbe->userproc, aiocbe->cred,
K> > + (void *)(uintptr_t)cb->aio_buf, cb->aio_nbytes);
K> This probably should be spelled __DEVOLATILE().
K>
K> We traditionally do not reuse the gaps in the syscall table, but add
K> new syscalls at the end.
Hmm. I did that because I wanted to be all aio_* grouped together. Why not?
K> Did you tested the kqueue completion notifications with the aio_mlock() ?
Sure. This is my main use case here.
--
Totus tuus, Glebius.
More information about the freebsd-arch
mailing list