From patchwork Tue Jun 29 16:11:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 94988 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF8D9A0C3F; Tue, 29 Jun 2021 18:11:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D293411C0; Tue, 29 Jun 2021 18:11:48 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id CA8B940E01 for ; Tue, 29 Jun 2021 18:11:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624983106; 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=I03qf80t1JJseI0ZbLm8XBPb/e8yctXt+7L30BxgCIk=; b=CSi2TZQVMMabyyeSA000gtLDCa2Mlz0j8XxOKmDqVc0b5fTkwMr7mz5YMhERrGLHKC+dec quqGQCXlOwQ1jWjXrplf8VxQa7i6kRXdQrVWod/FduVeVeBXBAEOxQ8IXU7fjgMNlxJHtT V4d/3/p7NjRjGXH/GcS8QDTqFWs1chk= 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-350-WHthv0OlM86cdWv2L2x3Cw-1; Tue, 29 Jun 2021 12:11:44 -0400 X-MC-Unique: WHthv0OlM86cdWv2L2x3Cw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CDF4100C61F; Tue, 29 Jun 2021 16:11:43 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF4C15C1D0; Tue, 29 Jun 2021 16:11:35 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, david.marchand@redhat.com Cc: Maxime Coquelin Date: Tue, 29 Jun 2021 18:11:26 +0200 Message-Id: <20210629161133.79472-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 v7 0/7] vhost: Fix and improve NUMA reallocation 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" This patch series first fixes missing reallocations of some Virtqueue and device metadata. Then, it improves the numa_realloc function by using rte_realloc_socket API that takes care of the memcpy & freeing. The VQs NUMA IDs are also saved in the VQ metadata and used for every allocations so that all allocations before NUMA realloc are on the same VQ, later ones are allocated on the proper one. Finally inflight feature metada are converted from calloc() to rte_zmalloc_socket() and their reallocation is handled in numa_realloc(). Changes in v7: ============== - Fix missing free() to rte_free() conversion (Chenbo) - Add R-by's Changes in v6: ============== - Send the complete series Changes in v5: ============== - Do not reallocate if VS is ready (Chenbo) - Fix typos & cosmetics (Chenbo) - Improve numa_realloc() comment (Chenbo) Changes in v4: ============== - Check Vhose device numa node to avoid rte_realloc_socket to realloc even if already right node/size/align. Changes in v3: ============== - Fix copy/paste issues (David) - Ad new patch to fix multiqueue reallocation Changes in v2: ============== - Add missing NUMA realloc in patch 6 Maxime Coquelin (7): vhost: fix missing memory table NUMA realloc vhost: fix missing guest pages table NUMA realloc vhost: fix missing cache logging NUMA realloc vhost: fix NUMA reallocation with multiqueue vhost: improve NUMA reallocation vhost: allocate all data on same node as virtqueue vhost: convert inflight data to DPDK allocation API lib/vhost/vhost.c | 38 +++--- lib/vhost/vhost.h | 1 + lib/vhost/vhost_user.c | 278 ++++++++++++++++++++++++++--------------- 3 files changed, 198 insertions(+), 119 deletions(-)