From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xmDiD6+7bmhJ+C8AWB0awg (envelope-from ) for ; Wed, 09 Jul 2025 14:57:51 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=lists.lttng.org header.i=@lists.lttng.org header.a=rsa-sha256 header.s=default header.b=xkiTcg/u; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2AC911E11C; Wed, 9 Jul 2025 14:57:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 Received: from lists.lttng.org (lists.lttng.org [158.69.130.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E95351E089 for ; Wed, 9 Jul 2025 14:57:49 -0400 (EDT) ARC-Filter: OpenARC Filter v1.2.1 lists.lttng.org 4bcnKn2Pzfz2R6n ARC-Seal: i=1; d=lists.lttng.org; s=arc1; a=rsa-sha256; cv=none; t=1752087469; b=pQHNB6YlgRMuC1S+s56QQX1kLlR2CDMYLqKfQbsh8GVQXA5tLCmovNX6MpgbzPppjVDf 5Unt3xiKOcpGvfyVdC7YI/Y9mCQuvKXbboM98U8LrQ0bCjVoojIWApizEKD0MNLIIaHyM vlD9yISMQJpgJ3aV1r2qND34WxIganGtGtSkVcF7k9Jb0DbsnXTOxokB2c3f7TgVeZ03S qioz5xK3/g/olpmdv5DADjs9huhWb3Ln20Reehrf8vnvCw367Em0o8YwE9OJtUCIf1bK9 LzWe7m90oKe3m3dGFHh0t1PHKFFinIbDQ8ZbQfqHTmVTyicxMiraSAM7aWA4Sya52rg== ARC-Message-Signature: i=1; d=lists.lttng.org; s=arc1; a=rsa-sha256; c=relaxed/simple; t=1752087469; h=DKIM-Signature:Mime-Version:Subject:Message-Id:Date:To:From:From; bh=6ipdHbiYIDOWBfevQFo99DAjrA2xMLjgX5dCITSVejk=; b=Z7gpmrsvEiOzeglGdJnPdhaXOcs0Y1Uwb5PFSZZe47MdGZC+xoMrA8IWcwc1DK9R1xsp P28nXWIaJsQfVAPg8E8dw1d0utV6NnO8s8l8d5MqHsbs7HOjBoStIrFM4LhMVhdCq/t3K F0u4RDXbyqbzmid7xorckxmGCJbnNMdXY+E1ExqVIDBv9PjPdLIIQd3oij6Ug0XZqYotJ +XJT/N6Uplh5/12R9r6ZQfi9UHwH6q9xDAqMucVxuMU4aFwhdES87/IHuh0dWU57vSnsX 6Ir7rpOkS9YqstqRJWtbxO7IZ9rG/NzZZ7iCO3jQf97s4geb1diWtPXeP5UJk7WmXBA== ARC-Authentication-Results: i=1; lists.lttng.org; arc=none smtp.remote-ip="::1" DKIM-Filter: OpenDKIM Filter v2.11.0 lists.lttng.org 4bcnKn2Pzfz2R6n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1752087469; bh=6ipdHbiYIDOWBfevQFo99DAjrA2xMLjgX5dCITSVejk=; h=Subject:Date:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xkiTcg/u2DgTWaqTHkyVasIsf/VTDXQ336lnw1C7oZSOlXZcktRQGtv6OQ4yOYFEX 2P3VPBj/TVwbSDZtkEceZcvBfaDs6MtqhqbqZEvDuxRNw532HEtrDQHxjJ9vJ0fJvy L2W8ydByi4a9CcFbDNMJOyXprkPzOC/F+gb0q7/uedcxEiI3mWsFKufj5+rv55q2ig ZEXKg7GwISbP5fUYc6lycAFFerr3TFWljz+S2IwVRmG2WycfMh+N4Tl7W7pLAG/Sq8 DnNbkIA8mCZjj+jGU5Mpe2/bDsyXSYnmv8kBkNChSh3zWVfitId/nOoaeeo0ksJV7V 2W7cDtmzj+L/w== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4bcnKn2Pzfz2R6n; Wed, 9 Jul 2025 14:57:49 -0400 (EDT) ARC-Filter: OpenARC Filter v1.2.1 lists.lttng.org 4bcnKk5XnSz2Qy7 DKIM-Filter: OpenDKIM Filter v2.11.0 lists.lttng.org 4bcnKk5XnSz2Qy7 Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) by lists.lttng.org (Postfix) with ESMTPS id 4bcnKk5XnSz2Qy7 for ; Wed, 9 Jul 2025 14:57:46 -0400 (EDT) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id A1D8314003C2 for ; Wed, 9 Jul 2025 14:57:44 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Wed, 09 Jul 2025 14:57:44 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdefkeefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhephfgtgfgguffkfffvofesthhqmhdthhdtje enucfhrhhomhepqfhnughrvghjucfuuhhrupcuoehonhgurhgvjhesshhurhihrdhorhhg qeenucggtffrrghtthgvrhhnpeekieekgffhhedvteelfeefleeiiefhtdfhtdeuleffff dtveeujeetuedvkeevjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehonhgurhgvjhesshhurhihrdhorhhgpdhnsggprhgtphhtthhopedupd hmohguvgepshhmthhpohhuthdprhgtphhtthhopehlthhtnhhgqdguvghvsehlihhsthhs rdhlthhtnhhgrdhorhhg X-ME-Proxy: Feedback-ID: ida81469e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 9 Jul 2025 14:57:44 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: cds_lfht_new() clarification - init vs min Message-Id: <0178CA60-19CE-4E0A-AEEB-5E9DEAAB460E@sury.org> Date: Wed, 9 Jul 2025 20:57:31 +0200 To: lttng-dev X-Mailer: Apple Mail (2.3826.600.51.1.1) X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: =?utf-8?q?Ond=C5=99ej_Sur=C3=BD_via_lttng-dev?= Reply-To: =?utf-8?B?T25kxZllaiBTdXLDvQ==?= Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" Hi, as the answer to this might be useful to more people, I am asking here: The cds_lfht_new documentation specifies 3 sizes. * cds_lfht_new - allocate a hash table. * @init_size: number of buckets to allocate initially. Must be power of = two. * @min_nr_alloc_buckets: the minimum number of allocated buckets. * (must be power of two) * @max_nr_buckets: the maximum number of hash table buckets allowed. * (must be power of two, 0 is accepted, means * "infinite") The max number of buckets is obvious, but the interaction between init and min is confusing. If I am reading the code right, then init_size < min_nr_alloc_buckets = have no effect, the buckets table will be at least 1 << min_nr_alloc_buckets. But what happens if init_size > min_nr_alloc_buckets? It feels like it = will work as expected if you pre-populate the table, but if you use it "normally", = e.g. there could be single add / del, the table will shrink immediately. Do I understand the code correctly? Ondrej -- Ond=C5=99ej Sur=C3=BD (He/Him) ondrej@sury.org