[libvirt] [PATCH v3] libvirtd: Increase NL buffer size for lots of interface

Martin Kletzander mkletzan at redhat.com
Mon Jan 11 10:44:31 UTC 2016


On Mon, Jan 11, 2016 at 02:59:00PM +0800, Leno Hou wrote:
>1. When switching CPUs to offline/online in a system more than 128 cpus
>2. When using virsh to destroy domain in a system with more interface
>
>All of above happens nl_recv returned with error: No buffer space available.
>This patch sets the socket buffer size to 128K and turns on message peeking
>for nl_recv,as this would solve this problem totally and permanetly.
>

So if none of the above is true/happening...

>Signed-off-by: Leno Hou <houqy at linux.vnet.ibm.com>
>Cc: Wenyi Gao <wenyi at linux.vnet.ibm.com>
>CC: Laine Stump <laine at laine.org>
>CC: Michal Privoznik <mprivozn at redhat.com>
>---
> src/util/virnetlink.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
>diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
>index 679b48e..ea65cbc 100644
>--- a/src/util/virnetlink.c
>+++ b/src/util/virnetlink.c
>@@ -65,10 +65,12 @@ struct virNetlinkEventHandle {
>
> # ifdef HAVE_LIBNL1
> #  define virNetlinkAlloc nl_handle_alloc
>+#  define virSocketSetBufferSize nl_set_buffer_size
> #  define virNetlinkFree nl_handle_destroy
> typedef struct nl_handle virNetlinkHandle;
> # else
> #  define virNetlinkAlloc nl_socket_alloc
>+#  define virSocketSetBufferSize nl_socket_set_buffer_size
> #  define virNetlinkFree nl_socket_free
> typedef struct nl_sock virNetlinkHandle;
> # endif
>@@ -696,6 +698,14 @@ virNetlinkEventServiceStart(unsigned int protocol, unsigned int groups)
>         goto error_server;
>     }
>
>+    if (virSocketSetBufferSize(srv->netlinknh, 131702, 0) < 0) {
>+        virReportSystemError(errno,
>+                "%s",_("cannot set netlink socket buffer size to 128k"));
>+        goto error_server;
>+    }
>+
>+    nl_socket_enable_msg_peek(srv->netlinknh);
>+

... shouldn't this be non-fatal just in case?

>     if ((srv->eventwatch = virEventAddHandle(fd,
>                                              VIR_EVENT_HANDLE_READABLE,
>                                              virNetlinkEventCallback,
>--
>1.9.1
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160111/f10f5d5a/attachment-0001.sig>


More information about the libvir-list mailing list