From owner-freebsd-arch@FreeBSD.ORG Mon Jun 3 21:29:16 2013 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0036124F for ; Mon, 3 Jun 2013 21:29:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 7EEA7192A for ; Mon, 3 Jun 2013 21:29:14 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r53LTDdR087999; Tue, 4 Jun 2013 01:29:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r53LTDTx087998; Tue, 4 Jun 2013 01:29:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 4 Jun 2013 01:29:13 +0400 From: Gleb Smirnoff To: Konstantin Belousov Subject: Re: aio_mlock(2) system call Message-ID: <20130603212913.GU67170@glebius.int.ru> References: <20130603100618.GH67170@FreeBSD.org> <20130603161255.GM3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130603161255.GM3047@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2013 21:29:16 -0000 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.