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=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_NEOMUTT 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 6DDE7C04AB4 for ; Tue, 14 May 2019 16:10:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4687C20862 for ; Tue, 14 May 2019 16:10:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726429AbfENQKr (ORCPT ); Tue, 14 May 2019 12:10:47 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51648 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbfENQKq (ORCPT ); Tue, 14 May 2019 12:10:46 -0400 Received: by mail-wm1-f66.google.com with SMTP id o189so3493527wmb.1 for ; Tue, 14 May 2019 09:10:45 -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:content-transfer-encoding :in-reply-to:user-agent; bh=wYcnLcHNEWzuyUPaOSPaqvipKhwQq75NVlrWVwfonxY=; b=iPGpbgoa2jROmIx6GbH6qFx0eFA5h97R1e9TRWoT3fSfXTR63760onDAK7bnPItBCg rcYR1bO0gtBVNABZakrovUceHM1iJEMs+gMce4qG3ysD2Yxk7kmiqeEXZjg2fDBCZCZ0 fHQqExonBdKVKO/Kt5uoys/SkYSHXbyoqQhiw6hwcCmqik2It/dQZLGR/H9V0xB1goVP uSI9jgmTh8J2350J+6TwEjld1w7GqpFuyhRxtky6exQItFH17AvHGMScaH5WtF35MJ7L +I2/FvsLCSaLm8DMzXLoP16whDZG7e7gTvVCr8Nuvjp9fG03MSrWlh5bF7HDa45Cfhs5 2ocA== X-Gm-Message-State: APjAAAXFsQkJxGWElAW0OlDdWXVmdQKnmgz1WbrrOa4HQV44keCz0Cn3 mfVcCPW4XZNklto35TTATuHTOg== X-Google-Smtp-Source: APXvYqxqlLOgXzEWalLGMo/rtA7vvFLalOSyrklAhb9ipPKK7DakL4gduRG3L+0mF5EDXgRvQwftWw== X-Received: by 2002:a1c:2dd2:: with SMTP id t201mr9244992wmt.136.1557850244405; Tue, 14 May 2019 09:10:44 -0700 (PDT) Received: from steredhat (host151-251-static.12-87-b.business.telecomitalia.it. [87.12.251.151]) by smtp.gmail.com with ESMTPSA id l2sm5293724wmf.16.2019.05.14.09.10.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 09:10:43 -0700 (PDT) Date: Tue, 14 May 2019 18:10:41 +0200 From: Stefano Garzarella To: Jason Wang Cc: netdev@vger.kernel.org, "David S. Miller" , "Michael S. Tsirkin" , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Stefan Hajnoczi Subject: Re: [PATCH v2 8/8] vsock/virtio: make the RX buffer size tunable Message-ID: <20190514161041.y4exigcwwys34naf@steredhat> References: <20190510125843.95587-1-sgarzare@redhat.com> <20190510125843.95587-9-sgarzare@redhat.com> <8e72ef5e-cf6a-a635-3f76-bdeac95761b8@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8e72ef5e-cf6a-a635-3f76-bdeac95761b8@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 13, 2019 at 08:46:19PM +0800, Jason Wang wrote: > > On 2019/5/13 下午6:05, Jason Wang wrote: > > > > On 2019/5/10 下午8:58, Stefano Garzarella wrote: > > > The RX buffer size determines the memory consumption of the > > > vsock/virtio guest driver, so we make it tunable through > > > a module parameter. > > > > > > The size allowed are between 4 KB and 64 KB in order to be > > > compatible with old host drivers. > > > > > > Suggested-by: Stefan Hajnoczi > > > Signed-off-by: Stefano Garzarella > > > > > > I don't see much value of doing this through kernel command line. We > > should deal with them automatically like what virtio-net did. Or even a > > module parameter is better. > > > > Thanks > > > Sorry, I misread the patch. But even module parameter is something not > flexible enough. We should deal with them transparently. > Okay, I'll try to understand how we can automatically adapt the RX buffer size. Since the flow is stream based, the receiver doesn't know the original packet size. Maybe I can reuse the EWMA approach to understand if the buffers are entirely filled or not. In that case I can increase (e.g. double) or decrease the size. I'll try to do it! Thanks, Stefano