From: Anton Ivanov <antiv...@cisco.com> socketpair() is a better IPC choice for lots of small requests as it allows deeper (and configurable) queues than pipe()
As a result UBD will process nearly all of the requests submitted to it instead of bouncing a significant percentage under load Signed-off-by: Anton Ivanov <antiv...@cisco.com> --- arch/um/drivers/ubd_kern.c | 2 +- arch/um/drivers/ubd_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 66d424a..ae78211 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -1268,7 +1268,7 @@ static bool submit_request(struct io_thread_req *io_req, struct ubd *dev) int n = os_write_file(thread_fd, &io_req, sizeof(io_req)); if (n != sizeof(io_req)) { - if (n != -EAGAIN) + if ((n != -EAGAIN) && (n != -ENOBUFS)) printk("write to io thread failed, " "errno = %d\n", -n); else if (list_empty(&dev->restart)) diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c index e376f9b..117ff13 100644 --- a/arch/um/drivers/ubd_user.c +++ b/arch/um/drivers/ubd_user.c @@ -25,7 +25,7 @@ int start_io_thread(unsigned long sp, int *fd_out) { int pid, fds[2], err; - err = os_pipe(fds, 1, 1); + err = socketpair(AF_UNIX, SOCK_STREAM, 0, (int *) &fds); if(err < 0){ printk("start_io_thread - os_pipe failed, err = %d\n", -err); goto out; -- 1.7.10.4 ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel