From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 029871FAF0 for ; Wed, 16 Nov 2022 09:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1668590807; bh=JuutkD/I1UUhzglqGVQnGiexdAdjTgQCu+FrSXCofck=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rAVO2aVbsMK56NpHOUnmkUhkt/yPhZPFrUI04G+4fs8DHVpjZITa8c12zMkeRlTp7 MKiHPfXBCxdomJvPSyJ/T0XNr2ylbTHLv1I0DTa9sCxQ/cYNxgFsLZ0hWO9swy3Bgg NXJIyRfTWAPekaQOTN6jeC63rtQhTMB/PRv4WjLE= From: Eric Wong To: mwrap-perl@80x24.org Subject: [PATCH 2/6] mwrap_core: document the reason for padding the mutex Date: Wed, 16 Nov 2022 09:26:42 +0000 Message-Id: <20221116092646.19919-3-e@80x24.org> In-Reply-To: <20221116092646.19919-1-e@80x24.org> References: <20221116092646.19919-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: While 64 has an obvious meaning to me, I reject Moore's law and have no idea what cache line sizes modern CPUs use. --- mwrap_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mwrap_core.h b/mwrap_core.h index 09b579d..94a6af3 100644 --- a/mwrap_core.h +++ b/mwrap_core.h @@ -68,7 +68,7 @@ static size_t *root_locating; /* determines if PL_curcop is our thread */ static struct cds_lfht *totals; union padded_mutex { pthread_mutex_t mtx; - char pad[64]; + char pad[64]; /* cache alignment for common CPUs */ }; /* a round-robin pool of mutexes */