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 7C11AA034F; Tue, 28 Dec 2021 15:28:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07E2940040; Tue, 28 Dec 2021 15:28:52 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 90F8E4003C for ; Tue, 28 Dec 2021 15:28:50 +0100 (CET) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: [RFC] mempool: modify flush threshold Date: Tue, 28 Dec 2021 15:28:45 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D86DB9@smartserver.smartshare.dk> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [RFC] mempool: modify flush threshold Thread-Index: Adf79zjA8OxugdRtR/WNvhbMxwxg0g== From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Olivier Matz" , "Andrew Rybchenko" , 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 Hi mempool maintainers and DPDK team. Does anyone know the reason or history why CACHE_FLUSHTHRESH_MULTIPLIER = was chosen to be 1.5? I think it is counterintuitive. The mempool cache flush threshold was introduced in DPDK version 1.3; it = was not in DPDK version 1.2. The copyright notice for rte_mempool.c says = year 2012. Here is my analysis: With the multiplier of 1.5, a mempool cache is allowed to be filled up = to 50 % above than its target size before its excess entries are flushed = to the mempool (thereby reducing the cache length to the target size). In the opposite direction, a mempool cache is allowed to be drained = completely, i.e. up to 100 % below its target size. My instinct tells me that it would be more natural to let a mempool = cache go the same amount above and below its target size, i.e. using a = flush multiplier of 2 instead of 1.5. Also, the cache should be allowed to fill up to and including the flush = threshold, so it is flushed when the threshold is exceeded, instead of = when it is reached. Here is a simplified example: Imagine a cache target size of 32, corresponding to a typical packet = burst. With a flush threshold of 2 (and len > threshold instead of len = >=3D threshold), the cache could hold 1 +/-1 packet bursts. With the = current multiplier it can only hold [0 .. 1.5[ packet bursts, not really = providing a lot of elasticity. Med venlig hilsen / Kind regards, -Morten Br=F8rup