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 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 8568290..80f8655 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..6833fc5 100644 --- a/arch/um/drivers/ubd_user.c +++ b/arch/um/drivers/ubd_user.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2000, 2001, 2002 Jeff Dike (jd...@karaya.com) * Copyright (C) 2001 Ridgerun,Inc (glon...@ridgerun.com) * Licensed under the GPL @@ -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