From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8D6FC63797 for ; Thu, 22 Jul 2021 12:55:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1A0361396 for ; Thu, 22 Jul 2021 12:55:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232110AbhGVMOv (ORCPT ); Thu, 22 Jul 2021 08:14:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22957 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232105AbhGVMOu (ORCPT ); Thu, 22 Jul 2021 08:14:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626958524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1CwiWu4T1TCrXr2lCQ50ReEt7fD3KW4sYxtYxQrRVQw=; b=K1VLn4gxUGY7idhtPf04e9xGR8ywt48HAZCLW4NJoIAnui7qAj/sFlSqILWuwSjJY1jMZ8 iD0fRc9lSamQGeFuev6XTzrxlWjpDzEaSFg+lJLNXfrRp4Yq8jxjvLvjBB1nTG3uvtbmWS J3774hjsw6MG934kSMn754iCy/Y3sUU= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-550-uhKPmG8NOYSCTxUOY-VkmA-1; Thu, 22 Jul 2021 08:55:23 -0400 X-MC-Unique: uhKPmG8NOYSCTxUOY-VkmA-1 Received: by mail-ej1-f69.google.com with SMTP id lb20-20020a1709077854b02904c5f93c0124so1768155ejc.14 for ; Thu, 22 Jul 2021 05:55:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1CwiWu4T1TCrXr2lCQ50ReEt7fD3KW4sYxtYxQrRVQw=; b=T46cJaCWQfN16CtZhTLxPeWb2QrJuaT6SYso9f/snjm3dX5njaWRmajAU8hq2FI1Zr nqF03418e4U8hKPmgzZZf0MGpCNKjM43+Mo83OB9XLcd+8RPVKdQ+VnNV9Ibx50Papvr TBo036J/94I0tMQ1UH/ELEOakgcYdgKtwDrHq+m1CRPDEObJSYepl6hU/ATFA45wLi86 r//oHo7FJ1TXR7ZYLkB7KH8/2s+2jRBYh7CBTEupc3yYTCMVXNkn10HkWA7FrYsBg+6w KknG5yqTmEOg+lEGIIwa0DXtclYHXBQEErnUUpaGLB8/Fsr1mwM0nwO/rEaas3cA5/3B oYig== X-Gm-Message-State: AOAM532k6jo5Zsr5jNSSzIrbB6TeOlOSLp7hMwn8ZKWTwMgaPWC6sZfT qpgz1t10/QVnRATor117RALOl/O2O6m3bHazMnhqFJkwII5KK+RL+fCKGPDyxy7jn3J9sCbA9im EclnExktc4+bx X-Received: by 2002:a17:906:4b47:: with SMTP id j7mr43399496ejv.104.1626958522044; Thu, 22 Jul 2021 05:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQU28JFAqvNmUaGfaHpdW27wO3IJ4E+xBiNDz/aPu1UOIaWniwAJM4pJxCmsaa9I5ynqJCHA== X-Received: by 2002:a17:906:4b47:: with SMTP id j7mr43399477ejv.104.1626958521846; Thu, 22 Jul 2021 05:55:21 -0700 (PDT) Received: from steredhat (host-79-18-148-79.retail.telecomitalia.it. [79.18.148.79]) by smtp.gmail.com with ESMTPSA id g11sm12413592edt.85.2021.07.22.05.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 05:55:21 -0700 (PDT) Date: Thu, 22 Jul 2021 14:55:19 +0200 From: Stefano Garzarella To: Lee Jones Cc: linux-kernel@vger.kernel.org, Ram Muthiah , "Michael S. Tsirkin" , Jason Wang , Stefan Hajnoczi , "David S. Miller" , Jakub Kicinski , virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, netdev@vger.kernel.org, jiang.wang@bytedance.com Subject: Re: [PATCH 1/1] virtio/vsock: Make vsock virtio packet buff size configurable Message-ID: <20210722125519.jzs7crke7yqfh73e@steredhat> References: <20210721143001.182009-1-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210721143001.182009-1-lee.jones@linaro.org> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, Jul 21, 2021 at 03:30:00PM +0100, Lee Jones wrote: >From: Ram Muthiah > >After a virtual device has been running for some time, the SLAB >sustains ever increasing fragmentation. Contributing to this >fragmentation are the virtio packet buffer allocations which >are a drain on 64Kb compound pages. Eventually these can't be >allocated due to fragmentation. > >To enable successful allocations for this packet buffer, the >packet buffer's size needs to be reduced. > >In order to enable a reduction without impacting current users, >this variable is being exposed as a command line parameter. > >Cc: "Michael S. Tsirkin" >Cc: Jason Wang >Cc: Stefan Hajnoczi >Cc: Stefano Garzarella >Cc: "David S. Miller" >Cc: Jakub Kicinski >Cc: virtualization@lists.linux-foundation.org >Cc: kvm@vger.kernel.org >Cc: netdev@vger.kernel.org >Signed-off-by: Ram Muthiah >Signed-off-by: Lee Jones >--- > include/linux/virtio_vsock.h | 4 +++- > net/vmw_vsock/virtio_transport_common.c | 4 ++++ > 2 files changed, 7 insertions(+), 1 deletion(-) > >diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h >index 35d7eedb5e8e4..8c77d60a74d34 100644 >--- a/include/linux/virtio_vsock.h >+++ b/include/linux/virtio_vsock.h >@@ -7,9 +7,11 @@ > #include > #include > >+extern uint virtio_transport_max_vsock_pkt_buf_size; >+ > #define VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE (1024 * 4) > #define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL >-#define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE (1024 * 64) >+#define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE virtio_transport_max_vsock_pkt_buf_size > > enum { > VSOCK_VQ_RX = 0, /* for host to guest data */ >diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c >index 169ba8b72a630..d0d913afec8b6 100644 >--- a/net/vmw_vsock/virtio_transport_common.c >+++ b/net/vmw_vsock/virtio_transport_common.c >@@ -26,6 +26,10 @@ > /* Threshold for detecting small packets to copy */ > #define GOOD_COPY_LEN 128 > >+uint virtio_transport_max_vsock_pkt_buf_size = 1024 * 64; >+module_param(virtio_transport_max_vsock_pkt_buf_size, uint, 0444); >+EXPORT_SYMBOL_GPL(virtio_transport_max_vsock_pkt_buf_size); >+ Maybe better to add an entry under sysfs similar to what Jiang proposed here: https://lists.linuxfoundation.org/pipermail/virtualization/2021-June/054769.html Thanks, Stefano