Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6540035yba; Tue, 14 May 2019 09:12:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9tcxmjWLAkF5vhD+J0dSYE+zhkzmriSmhcoBD2tY1QGtmi4z4disQb8VclSfG+oeIjx5/ X-Received: by 2002:a63:b706:: with SMTP id t6mr32612854pgf.305.1557850333536; Tue, 14 May 2019 09:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557850333; cv=none; d=google.com; s=arc-20160816; b=NAa1SeGX0Pv5P8UE6dkfTYulvP2GkfB9AbSZLIhqkgCOu/NDr1nscYEwnseh/s0+rq emkAfuRQftzAKvdqdxPhH/fZwz/z0Cs25OSkl0aNP9/mGsCKgdrsZ6X4haYMcAGsq+qV q8U59AltJ3CNqldyt9jS/GzHiHUEABX+jhxy8UjxZRLFkSyU3wTOhPEg7WxJosQKgCJr R/ndbqGyEsmmDJ3IP25XaKCLTUtRf/eBxbg6epHu9YfKkSTXPYG10jinZTjgIiV1Cshq IuluXN0cFHrBDKG8GgCgbstNzOcqJFYnYsHSsPK/v/cRyUhv7ji6d6CAhhnwMjXeAnyN Rn8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=wYcnLcHNEWzuyUPaOSPaqvipKhwQq75NVlrWVwfonxY=; b=NkZdGM9dSyi8xNzH5f21Di4/XsD7L4RW39KSCoCt7di9P5HI7jHR/uTR2Gs5qTT/zT iMfTX9zG86Yt4lR9H54cjxQSCLYj6JiZGJbWzgCpBzaPjhBG+LpfVI7O3KB0Kc0QDZWx myKwbHJxhbtov/SX6bMSg5CipqJB7i0Gdf8M+QxYXCJ9Fj8kJ5EXCsLLRrJTl/Me1jXf DrRt+5ktC+RYmsGbso7XpY+wg2ovrEd/brT2WrgYIIu5b523YjlAm9ZYxG4f2LCL+Sac EzRGuHknlzV/5f8r+xaYwegAsDLmQG1FA8PpIUCePQ8hQpBuGI0uDtRuQAIHjWKnrhAV GKAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h96si6704784plb.281.2019.05.14.09.11.58; Tue, 14 May 2019 09:12:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726406AbfENQKq (ORCPT + 99 others); Tue, 14 May 2019 12:10:46 -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-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