From patchwork Sun Oct 9 13:25:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 117739 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 30EA5A0542; Sun, 9 Oct 2022 15:25:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27816400D5; Sun, 9 Oct 2022 15:25:26 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 0164440042 for ; Sun, 9 Oct 2022 15:25:25 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 115) id 97BA07F; Sun, 9 Oct 2022 16:25:24 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mail1.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD autolearn=no autolearn_force=no version=3.4.6 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id 1318A66; Sun, 9 Oct 2022 16:25:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 1318A66 Authentication-Results: shelob.oktetlabs.ru/1318A66; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: Olivier Matz Cc: dev@dpdk.org, =?utf-8?q?Morten_Br=C3=B8rup?= , Bruce Richardson Subject: [PATCH v5 0/4] mempool: fix mempool cache flushing algorithm Date: Sun, 9 Oct 2022 16:25:11 +0300 Message-Id: <20221009132515.584958-1-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 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 v5 changes (Andrew Rybchenko): - Factor out cosmetic fixes into separate patches to make all patches smaller and easier to review - Remove extra check as per review notes - Factor out entire cache flushing into a separate patch. It is nice from logical changes separation point of view, easier to bisect and revert. v4 changes: - Updated patch title to reflect that the scope of the patch is only mempool cache flushing. - Do not replace rte_memcpy() with alternative copying method. This was a pure optimization, not a fix. - Elaborate even more on the bugs fixed by the modifications. - Added 4th bullet item to the patch description, regarding rte_mempool_ops_enqueue_bulk() with RTE_LIBRTE_MEMPOOL_DEBUG. v3 changes: - Actually remove my modifications of the rte_mempool_cache structure. v2 changes: - Not adding the new objects to the mempool cache before flushing it also allows the memory allocated for the mempool cache to be reduced from 3 x to 2 x RTE_MEMPOOL_CACHE_MAX_SIZE. However, such this change would break the ABI, so it was removed in v2. - The mempool cache should be cache line aligned for the benefit of the copying method, which on some CPU architectures performs worse on data crossing a cache boundary. However, such this change would break the ABI, so it was removed in v2; and yet another alternative copying method replaced the rte_memcpy(). Andrew Rybchenko (3): mempool: check driver enqueue result in one place mempool: avoid usage of term ring on put mempool: flush cache completely on overflow Morten Brørup (1): mempool: fix cache flushing algorithm lib/mempool/rte_mempool.c | 5 ++++ lib/mempool/rte_mempool.h | 55 ++++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 27 deletions(-)