From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Moyer Subject: Re: [PATCH 3/8] aio: add an interface to submit aio from the kernel Date: Mon, 26 Oct 2009 12:10:41 -0400 Message-ID: References: <1256243157-16667-1-git-send-email-zach.brown@oracle.com> <1256243157-16667-2-git-send-email-zach.brown@oracle.com> <1256243157-16667-3-git-send-email-zach.brown@oracle.com> <1256243157-16667-4-git-send-email-zach.brown@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Zach Brown Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47704 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753132AbZJZQKk (ORCPT ); Mon, 26 Oct 2009 12:10:40 -0400 In-Reply-To: <1256243157-16667-4-git-send-email-zach.brown@oracle.com> (Zach Brown's message of "Thu, 22 Oct 2009 13:25:52 -0700") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Zach Brown writes: > This adds a simple interface that lets other parts of the kernel submit aio > iocbs. Callers provide a function which is called as the IO completes. > > These iocbs aren't tracked to reduce overhead: they can't be canceled, callers > limit the number in flight, and previous patches in this series removed > retry-based aio. > > Signed-off-by: Zach Brown > +void aio_kernel_init_rw(struct kiocb *iocb, struct file *filp, > + unsigned short op, void *ptr, size_t nr, loff_t off) > +{ > + iocb->ki_filp = filp; > + iocb->ki_opcode = op; > + iocb->ki_buf = (char __user *)(unsigned long)ptr; > + iocb->ki_left = nr; > + iocb->ki_nbytes = nr; > + iocb->ki_pos = off; > +} > +EXPORT_SYMBOL_GPL(aio_kernel_init_rw); Why isn't this just a static inline in a header, like the io_prep_pread/pwrite methods in libaio.h? Not a big deal, just curious. > +int aio_kernel_submit(struct kiocb *iocb) Why are you limiting this to just 1 iocb at a time? Is it because the overhead of a function call is pretty small (as compared to the user/kernel context switch for the system call)? I guess we can add a mechanism to submit multiple iocbs if it becomes necessary. Cheers, Jeff