From patchwork Tue Dec 22 13:56:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 85653 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D4BB2A052A; Tue, 22 Dec 2020 14:57:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 00F70CA52; Tue, 22 Dec 2020 14:57:12 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 15CDBCA3E for ; Tue, 22 Dec 2020 14:57:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608645428; 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=hiNgIwTC8PNWGkzLRM/v/Hz2X2/HX434x6ybN4Z8Gxg=; b=PDfEFBMa2CgRFq5vzYsKvcQq92y9fkRakytGwXerKCHfCPfjZ+M0Zf9l6+seyzMxVAFuut V3BjFVM0CvY5x+G/cKQsB8R9OS8BljkOVzp1zBF6EATKGBb8FFFXtiWJ70c8Y2fUijOeNu he0nwccE4pdyJz2n1zuLj36WCjBtGGw= 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-504-45MY2HL5PU-v_cabKfQypw-1; Tue, 22 Dec 2020 08:57:06 -0500 X-MC-Unique: 45MY2HL5PU-v_cabKfQypw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 02CD01800D42; Tue, 22 Dec 2020 13:57:05 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B8FC5275D; Tue, 22 Dec 2020 13:57:00 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com Cc: Maxime Coquelin Date: Tue, 22 Dec 2020 14:56:55 +0100 Message-Id: <20201222135658.53916-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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 Subject: [dpdk-dev] [PATCH 0/3] vhost: make virtqueue cache-friendly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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. 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 | 14 +++++++-- lib/librte_vhost/vhost.h | 54 +++++++++++++++++------------------ lib/librte_vhost/vhost_user.c | 25 ++++++++++++++++ 3 files changed, 64 insertions(+), 29 deletions(-)