From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C8F8AA0561; Wed, 17 Mar 2021 18:09:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AEDD24069F; Wed, 17 Mar 2021 18:09:39 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id B1D4A4067E for ; Wed, 17 Mar 2021 18:09:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616000978; 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: content-transfer-encoding:content-transfer-encoding; bh=H/3xc6cw5Q+oAfzCLk28XkhHMF8yMI01/+IBUurtNBE=; b=DrMdk3pLBETLC+Ng1ouzxrVDaFx490ycg21eyTn59TJ2wRfGaC+aANrZ1wE8ZpkSIY3y8o xfMdefPj6Jk7j47AI6HHRhPsy17Rii+KLP7/5cS2ABht6Wz7ZzkcgphRj+Zldd+gfWdfMU g7hA8q2oOdUOKQt3ON4xEKNyqWx5BA4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-472-QUWA8GSWNJGnWmPAv1Fuwg-1; Wed, 17 Mar 2021 13:09:35 -0400 X-MC-Unique: QUWA8GSWNJGnWmPAv1Fuwg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DCDA181622; Wed, 17 Mar 2021 17:09:34 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29C3219CB6; Wed, 17 Mar 2021 17:09:26 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com, david.marchand@redhat.com, olivier.matz@6wind.com, bnemeth@redhat.com Cc: Maxime Coquelin Date: Wed, 17 Mar 2021 18:09:19 +0100 Message-Id: <20210317170922.25046-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH v3 0/3] vhost: make virtqueue cache-friendly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" As done for Virtio PMD, this series improves cache utilization of the vhost_virtqueue struct by removing unused field, make the live-migration cache dynamically allocated at live-migration setup time and by moving fields around so that hot fields are on the first cachelines. With this series, The struct vhost_virtqueue size goes from 832B (13 cachelines) down to 320B (5 cachelines). With this series and the virtio one, I measure a gain of up to 8% in IO loop micro-benchmark with packed ring, and 5% with split ring. I don't have a setup at hand to run PVP testing, but it might be interresting to get the numbers as I suspect the cache pressure is higher in this test as in real use-cases. Changes in v3: ============== - Don't check pointer validity before freeing (David) - Don't use deprecated rte_smp_wmb() (David, Checkpatch) - Handle booleans properly (David) - Prevent VQ size field overflow (David) - Fix typo and indent (David) Changes in v2: ============== - Add log_cache freeing in free_vq (Chenbo) Maxime Coquelin (3): vhost: remove unused Vhost virtqueue field vhost: move dirty logging cache out of the virtqueue vhost: optimize vhost virtqueue struct lib/librte_vhost/vhost.c | 21 +++++++++---- lib/librte_vhost/vhost.h | 56 +++++++++++++++++------------------ lib/librte_vhost/vhost_user.c | 40 ++++++++++++++++++------- lib/librte_vhost/virtio_net.c | 12 ++++---- 4 files changed, 80 insertions(+), 49 deletions(-) -- 2.30.2