Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp35016rwr; Wed, 19 Apr 2023 03:03:37 -0700 (PDT) X-Google-Smtp-Source: AKy350be3i1+5PVq7BOlwnz21XfV2bulsouSpNEtAawZxzSSBz4o2K0uPJNtd7sGgYgjc/C7fmSi X-Received: by 2002:a17:902:ea05:b0:1a8:1a9d:d994 with SMTP id s5-20020a170902ea0500b001a81a9dd994mr2414700plg.48.1681898616826; Wed, 19 Apr 2023 03:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681898616; cv=none; d=google.com; s=arc-20160816; b=kazrgjH5erk5Ii0OZfGSMWR4UJrkhaPy5tp92LMY2m0nMDbzMJ8A91JjlQXFWaauq8 Ex1NlVvK4igZS9tGVS8wAEM+CXnYl8ZGt6+5GZD5tk/Q0rAA2rRxP0g7X0GMD+cFnrBv C9xeegvzysCfN3iwuiC83JLkZrwctPMDOGLU4w5Wm2nE/r246eLXWq7VEzv24ADDXKVx dpv4DXnconOcefPPXSwdy6ySy/J3Rrjt6kQ3h92pSAlJwddxMVQfB0H1t/ACMvl4rjTG uuCGLpAQ1xxJ+lDM3fbP2uKTqU/gWGsrVUap027bDDnEKQe6AwA8twylr/GKWQzWdDNe IzRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XQ6sCjmuWnVFb8UpDGaTI+MOdoOd+qfctALNM5m0k+g=; b=LU8QhAnxx9w6Zc2Yuj7BaGjK2CgWfWF0VAok1m2OcQhLwl32hmvqZc2CrbPo+MdXNh 3tldJfwZj4qKkbu+wqdtL+4SoAvUbMA2kjgdxvbcIk0D2v/nnjJ+egByfp9E/LmjweIa aW6DBcBfSo2XHAQ1KTNxzuITOwIJe1Oqut+qem4iqV6yFPWE/Q7uiNKXf1VX6f7Vst2/ Gh1q5M+rzMdHrLa7z1QH+JpaRHWSWNy9EbyKDCwE9gsdo/X7UmkNBK2K/cJpAU1bD1Mt qeMrUUYqT43iCRK6dO8UxFN/YcIIwVYq8teZwh3xWKiCly9ENz26ebZvrLXpf3a9yDWO Cy/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hyV+3+J5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z8-20020a170903018800b001a6dfb35f63si7001700plg.385.2023.04.19.03.03.16; Wed, 19 Apr 2023 03:03:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hyV+3+J5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232374AbjDSKBO (ORCPT + 99 others); Wed, 19 Apr 2023 06:01:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232041AbjDSKBL (ORCPT ); Wed, 19 Apr 2023 06:01:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D34166E8B for ; Wed, 19 Apr 2023 03:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681898427; 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=XQ6sCjmuWnVFb8UpDGaTI+MOdoOd+qfctALNM5m0k+g=; b=hyV+3+J5NOvASYRXZY6sjWgrk7FeoYvE6+CJOzZoFDjGnwiGxVV0k3Y0d8d11g+VL747i9 XvPHjJCbgG/xxvbT/7Hv4d1ntscg1J1AvE5eN+J7sssgzasev3DVDknt2vfHSX9uyU5RW9 tgcpXAucWBlnRf/xDCV6+ws4/JufQXY= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-297-zEShlqKRMsOgeCk8EmDMOg-1; Wed, 19 Apr 2023 06:00:25 -0400 X-MC-Unique: zEShlqKRMsOgeCk8EmDMOg-1 Received: by mail-qk1-f199.google.com with SMTP id q30-20020a05620a025e00b007468c560e1bso15073011qkn.2 for ; Wed, 19 Apr 2023 03:00:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681898425; x=1684490425; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XQ6sCjmuWnVFb8UpDGaTI+MOdoOd+qfctALNM5m0k+g=; b=N+4rPdOPLxUdGBxKdWH2Evj1/w+e7gkKcPOcgvBNH4rSiEooxUHTZhwNWT594vkm2s 4Tl9AKu24tqQ+Ui0I+3+nrhAnxmRsf3jxggTefhNMtykyf+hDBPGNLWt3EMtlTP595rA g5yEEpJqKDOcSRyBp+GZxPYyIVHY1J0HsGuVb+vzfurkZ6dYq2MecyFFLb8DEeHvAeqE GScwb6neUwH4ECZaQ0XUVkQn92waI7XkWN4f+QyNeFBiNtL6uuRpr0oEZH/fW3V+KmPl V+16WnZuRQOIN/mzRgbuAE8pIsCSoTppuWL4HgDxuSbK3Aw/CiGJIPAF7UdOOh++lgzz 4RfA== X-Gm-Message-State: AAQBX9fpFcldnC078UDaGzXjU/amQlQ63r4sCntyLvhn8blFJ2R89W9z YoLFuaJLDqbci954irBrgaHxA5vadkTWIWoj/yxVgpgRxY+Xxy0x4DgTx3w15elgZbfYrFzWPwN rgWAncNqVnse84g0ayC1505vg X-Received: by 2002:a05:622a:44e:b0:3ef:437e:c828 with SMTP id o14-20020a05622a044e00b003ef437ec828mr1647537qtx.54.1681898424520; Wed, 19 Apr 2023 03:00:24 -0700 (PDT) X-Received: by 2002:a05:622a:44e:b0:3ef:437e:c828 with SMTP id o14-20020a05622a044e00b003ef437ec828mr1647485qtx.54.1681898424062; Wed, 19 Apr 2023 03:00:24 -0700 (PDT) Received: from sgarzare-redhat (host-82-53-134-157.retail.telecomitalia.it. [82.53.134.157]) by smtp.gmail.com with ESMTPSA id bq16-20020a05620a469000b007484d284cdasm4564029qkb.93.2023.04.19.03.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 03:00:23 -0700 (PDT) Date: Wed, 19 Apr 2023 12:00:17 +0200 From: Stefano Garzarella To: Bobby Eshleman Cc: Bobby Eshleman , Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Bryan Tan , Vishnu Dasa , VMware PV-Drivers Reviewers , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, Jiang Wang , Cong Wang Subject: Re: [PATCH RFC net-next v2 0/4] virtio/vsock: support datagrams Message-ID: References: <20230413-b4-vsock-dgram-v2-0-079cc7cee62e@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bobby, On Fri, Apr 14, 2023 at 11:18:40AM +0000, Bobby Eshleman wrote: >CC'ing Cong. > >On Fri, Apr 14, 2023 at 12:25:56AM +0000, Bobby Eshleman wrote: >> Hey all! >> >> This series introduces support for datagrams to virtio/vsock. Great! Thanks for restarting this work! >> >> It is a spin-off (and smaller version) of this series from the summer: >> https://lore.kernel.org/all/cover.1660362668.git.bobby.eshleman@bytedance.com/ >> >> Please note that this is an RFC and should not be merged until >> associated changes are made to the virtio specification, which will >> follow after discussion from this series. >> >> This series first supports datagrams in a basic form for virtio, and >> then optimizes the sendpath for all transports. >> >> The result is a very fast datagram communication protocol that >> outperforms even UDP on multi-queue virtio-net w/ vhost on a variety >> of multi-threaded workload samples. >> >> For those that are curious, some summary data comparing UDP and VSOCK >> DGRAM (N=5): >> >> vCPUS: 16 >> virtio-net queues: 16 >> payload size: 4KB >> Setup: bare metal + vm (non-nested) >> >> UDP: 287.59 MB/s >> VSOCK DGRAM: 509.2 MB/s >> >> Some notes about the implementation... >> >> This datagram implementation forces datagrams to self-throttle according >> to the threshold set by sk_sndbuf. It behaves similar to the credits >> used by streams in its effect on throughput and memory consumption, but >> it is not influenced by the receiving socket as credits are. So, sk_sndbuf influece the sender and sk_rcvbuf the receiver, right? We should check if VMCI behaves the same. >> >> The device drops packets silently. There is room for improvement by >> building into the device and driver some intelligence around how to >> reduce frequency of kicking the virtqueue when packet loss is high. I >> think there is a good discussion to be had on this. Can you elaborate a bit here? Do you mean some mechanism to report to the sender that a destination (cid, port) is full so the packet will be dropped? Can we adapt the credit mechanism? >> >> In this series I am also proposing that fairness be reexamined as an >> issue separate from datagrams, which differs from my previous series >> that coupled these issues. After further testing and reflection on the >> design, I do not believe that these need to be coupled and I do not >> believe this implementation introduces additional unfairness or >> exacerbates pre-existing unfairness. I see. >> >> I attempted to characterize vsock fairness by using a pool of processes >> to stress test the shared resources while measuring the performance of a >> lone stream socket. Given unfair preference for datagrams, we would >> assume that a lone stream socket would degrade much more when a pool of >> datagram sockets was stressing the system than when a pool of stream >> sockets are stressing the system. The result, however, showed no >> significant difference between the degradation of throughput of the lone >> stream socket when using a pool of datagrams to stress the queue over >> using a pool of streams. The absolute difference in throughput actually >> favored datagrams as interfering least as the mean difference was +16% >> compared to using streams to stress test (N=7), but it was not >> statistically significant. Workloads were matched for payload size and >> buffer size (to approximate memory consumption) and process count, and >> stress workloads were configured to start before and last long after the >> lifetime of the "lone" stream socket flow to ensure that competing flows >> were continuously hot. >> >> Given the above data, I propose that vsock fairness be addressed >> independent of datagrams and to defer its implementation to a future >> series. Makes sense to me. I left some preliminary comments, anyway now it seems reasonable to use the same virtqueues, so we can go head with the spec proposal. Thanks, Stefano