From owner-freebsd-arch@FreeBSD.ORG Mon Jun 3 16:13:03 2013 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F1C7BE8; Mon, 3 Jun 2013 16:13:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8C90317E4; Mon, 3 Jun 2013 16:13:02 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r53GCtlo070844; Mon, 3 Jun 2013 19:12:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r53GCtlo070844 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r53GCthv070843; Mon, 3 Jun 2013 19:12:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Jun 2013 19:12:55 +0300 From: Konstantin Belousov To: Gleb Smirnoff Subject: Re: aio_mlock(2) system call Message-ID: <20130603161255.GM3047@kib.kiev.ua> References: <20130603100618.GH67170@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jwY/bXrd6avG4scw" Content-Disposition: inline In-Reply-To: <20130603100618.GH67170@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home 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 16:13:03 -0000 --jwY/bXrd6avG4scw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 03, 2013 at 02:06:18PM +0400, Gleb Smirnoff wrote: > Hello! >=20 > This patch brings a new system call - aio_mlock(2). The idea is > quite clear from its name: it performs mlock(2), which can take > a long time if pages aren't resident, under aio(4) control. >=20 > The patch is quite simple, and non-desctructive. Here it is > for your review. >=20 > If no one objects, I'd like to add it to FreeBSD 10. I suggest to rename the aio_process() to aio_process_rw(). Also, it might make sense to assert aio_lio_opcode value on the entry to aio_process_*() functions. > +static void > +aio_process_mlock(struct aiocblist *aiocbe) > +{ > + struct aiocb *cb =3D &aiocbe->uaiocb; > + int error; > + > + error =3D vm_mlock(aiocbe->userproc, aiocbe->cred, > + (void *)(uintptr_t)cb->aio_buf, cb->aio_nbytes); This probably should be spelled __DEVOLATILE(). We traditionally do not reuse the gaps in the syscall table, but add new syscalls at the end. Did you tested the kqueue completion notifications with the aio_mlock() ? --jwY/bXrd6avG4scw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJRrMCHAAoJEJDCuSvBvK1BgWAQAIybpSeMlA5tMd8xEfWodRzN jmF62DI9uh+ThrTHQ7cB0FXIZtvCEbWFMbvHNKo9Z9lE53Pld9QnQ3Y8xe7ccZ7Q OUWbdQbwlQ+B+bzjuGwciYaASdSJSiUHhUb32prDd2p1umRc0fGeeihb8PBEO6jM TLzAA0tK5UrcJvS7DgfQan2JdJlrjxrtyItvHuxUlhS8gnESACrD2WtenC6SlHrv gEpMohQKrQjCK9FPd1/s2k4aj25bsIB2LTJVoXrbmabP9/Mh1daaXbLWTMXf6BgY wyxhbXMmiAsqPDo2anggWi8YwN742nuWawEZGm7LxhCcEvqraCpFQQk2g3KOHA9l mSzYRIxCNImTpDzLCqHsgvjNqjT36VNGc/fY8VB6GfSAO28OIp7vatnFF4qL9m+P H/cH6uNmp0PHqpztoOUxZ3ykT4N/hxYHSH+wvUvJ8bK0PHGOGti26EraNYnH3WyJ 8IbMocB97olBC81yhpJN7kBOon/78NzPvA9Ymz6YdQUcpTzSnT+GKSpHQ5jrMgqP qiwMuzvoJhmJR2d+c/zJYwDrXYN75+U7xQyp2ghUOkg2yKE4HF1+g2ZFcHbw29xN HHDk/IWC4KcVjnJM/hZ2r4O+jL2U6d7F74oBq9WZstyHy6Y6KluTKzDmTcuL2JZG hM99hqXEZu4iZsQdxJ9o =n7ol -----END PGP SIGNATURE----- --jwY/bXrd6avG4scw--