From: valdis.kletnieks@vt.edu (valdis.kletnieks at vt.edu) Date: Sat, 18 Nov 2017 13:44:44 -0500 Subject: Invoking a system call from within the kernel In-Reply-To: <20171118181527.GA367@localhost.hsd1.tn.comcast.net> References: <20171116021635.GA15260@localhost.hsd1.tn.comcast.net> <20171116095424.GA32731@kroah.com> <20171118181527.GA367@localhost.hsd1.tn.comcast.net> Message-ID: <93703.1511030684@turing-police.cc.vt.edu> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Sat, 18 Nov 2017 13:15:27 -0500, Demi Marie Obenour said: > However, the ioctl I actually want to implement (see above) does the > system call asynchronously. That isn???t possible using the existing > APIs. Ever consider that it's because there's no clear semantics to what executing an arbitrary syscall asyncronously even *means*? What doe an async getuid() mean? For bonus points, what does it return if the program does an async getuid(), and then does a setuid() call *before the async call completes*? What is the return value of an async call that fails? How is it returned, and how do you tell if a negative return code is from the async code failing, or the syscall failing? > See above :) Basically, I am trying to improve performance and reduce > complexity of programs that need to do a lot of buffered file I/O. We already have an AIO subsystem for exactly this. And eventfd's, and poll(), and a bunch of other stuff. And they improve performance, but increase complexity. It's pretty hard to make while (rc=read(....) > 0) rc2 = write(....) less complex. Catching the return of an async call makes it more complex. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 486 bytes Desc: not available Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20171118/4d6421ac/attachment.bin