From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2067.outbound.protection.outlook.com [40.107.249.67]) by sourceware.org (Postfix) with ESMTPS id 580583896C1F for ; Thu, 15 Dec 2022 15:44:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 580583896C1F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vXqHGndS5uf2n/caEKSpL0/L/nTA/kvvF9kqSm+TE18=; b=ranzUmFS2YBcQRM4rX6zKxGC2ym70aVHZOwjZLFblRP6LnobZ1r2FwkpvjX2IlbtOOtiwmlqmdSyE60X3io6uT6ggrryoYDlqq/E+P1PGZGCe6JLrx6DOJdXUdk8FcqAb4k4XjsdbiEL57d5A25FV9aw1TdX3trLnIupOWYkIy4= Received: from DB6P195CA0021.EURP195.PROD.OUTLOOK.COM (2603:10a6:4:cb::31) by GVXPR08MB7703.eurprd08.prod.outlook.com (2603:10a6:150:6b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.9; Thu, 15 Dec 2022 15:43:59 +0000 Received: from DBAEUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:cb:cafe::12) by DB6P195CA0021.outlook.office365.com (2603:10a6:4:cb::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.11 via Frontend Transport; Thu, 15 Dec 2022 15:43:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT015.mail.protection.outlook.com (100.127.142.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.11 via Frontend Transport; Thu, 15 Dec 2022 15:43:58 +0000 Received: ("Tessian outbound 0800d254cb3b:v130"); Thu, 15 Dec 2022 15:43:58 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6f91b42b24fa06fc X-CR-MTA-TID: 64aa7808 Received: from eecc10c985ca.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8FF8076A-2099-4D6B-9559-B843445DFB74.1; Thu, 15 Dec 2022 15:43:50 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eecc10c985ca.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 15 Dec 2022 15:43:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e8P/WKO7fDM3oqcgsBtdjKi5redTTcaompVambJCej6qYqXJzDCxSQl6MvepiChqiDGbHwdY4e19ZdmO39WP+W6xdzwyyC+41fkBwKVXwh12OvnIxNsyQN6vlk/BH1suAz8lk87MfIi9RLRmwrUX3V2SsBQ5eOPwnu/Pv5OPi2Hk+N6Y3fWiuQ9fzii8Xdzx+51cOXHSlcUj1nBfWQxlhdxO3F+cp/7beOYOC0tXTkUwxSQ4r3apMO6SrxnCpUrgIyxLuwWvIapZ57V+C1QrMYrxOw030f+2yR6l5SkhAtjjnIb5C8Um3HceLf8lOrDHY1mpV24WzZgeeQGRmNeWuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vXqHGndS5uf2n/caEKSpL0/L/nTA/kvvF9kqSm+TE18=; b=ahXE9r+ySlsSjkvoqPGRUpQbX0jVU7ie1dituILqpC7KhjtfbgiuN3gtGewb5mmNavRKOJxZMGS4OPLI0PWsVCWHesgDBOQX4LpzwNp1t31+yFvuT7k7xWSvd42oFWVhKqegFsgFFGAZo4U31awDPZiUkovQMc6ZQ91Qrk/wZ4se2ZFn8V9Ue5LR48y9CRvhuZksYNrHfGSSD5EXPj2hvbEQRp5FF86q45f//fVh84iYPLZ8znWZAu3HuLLYzFri7d8I2r9UOn2i8eDWYhGRcixKEuiIDeEviHyKsNfUlcgRnTXZTDTEWo9rgxEFP70aDcopbtcqBkqT2CE2jUBl0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vXqHGndS5uf2n/caEKSpL0/L/nTA/kvvF9kqSm+TE18=; b=ranzUmFS2YBcQRM4rX6zKxGC2ym70aVHZOwjZLFblRP6LnobZ1r2FwkpvjX2IlbtOOtiwmlqmdSyE60X3io6uT6ggrryoYDlqq/E+P1PGZGCe6JLrx6DOJdXUdk8FcqAb4k4XjsdbiEL57d5A25FV9aw1TdX3trLnIupOWYkIy4= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by AS8PR08MB10193.eurprd08.prod.outlook.com (2603:10a6:20b:63e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.11; Thu, 15 Dec 2022 15:43:44 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::66e4:4940:d096:4f7]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::66e4:4940:d096:4f7%9]) with mapi id 15.20.5924.010; Thu, 15 Dec 2022 15:43:44 +0000 From: Wilco Dijkstra To: DJ Delorie CC: "libc-alpha@sourceware.org" Subject: Re: [PATCH] malloc: Use correct C11 atomics for fastbin Thread-Topic: [PATCH] malloc: Use correct C11 atomics for fastbin Thread-Index: AQHY/cJS/cK/f0PorUWetLVbA8LI1q5aHYIAgAAXvhOAAEQcRYAADGLggAAHw+SAAHYsAIAF5wRGgAA4BACADhNRXQ== Date: Thu, 15 Dec 2022 15:43:43 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: PAWPR08MB8982:EE_|AS8PR08MB10193:EE_|DBAEUR03FT015:EE_|GVXPR08MB7703:EE_ X-MS-Office365-Filtering-Correlation-Id: c48b2487-e701-459c-8b62-08dadeb32eaa x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: l7hBmgyKL95uBRujyjutgDoCbedkTEM8821XOPY2wkKLjQl8GJYyIJgIc514ZYZrL6hh/jvKDgJ0ZQBRjUOw+3+cRnxmEK6rCg5kqxP3ZLhDR4HWBwXPilqIHA0oWybZAFVnuCiNMyCBItHvQTXl4ho3DCVlhVS8DR19qDmiiwrQAe0LDcZpSVn6qY1EzbRfacEnwVPOGJJ8IJ5kI9kM2SjbWWygrCk60iCtNGmo67DnWKVHzHXCvOYYooURJUeVutGCGoJElSyPkoBMo+M3SuumQ+MaVDktnhMJNX4hdY54dSlpwZ7JXSoo7hhLAOji17RJAsPwu942BxCKBx4MHi4YmvuL7OqXGr4npwrsDTbJAMvn54JcdOOaP1A8SSq4rR3vjU0JpP+/JikTuCOz3/tOJwl9P06t4vDgHny9AM+OBba2bWXb/AylH/RHI7PY35EMPu9sNYAztBLZZQRowbSgpFeYBnvybffwODFBsSNvHQ5dciA5dyZLXxRF7myHKBzcpQxtL1GNn5a02/v1zqs6uW3GA2/xFDwza85Q4Ihwo6T3t8LVwTebf/uhgHdgziLuOyg4rQiIZwIHmg5LQ+HU4o+oj7iF55UilBA6LVZ7Ue82nb5ncnewmH350HK1eW5gsb0nAx773xk8MDhAEWxz5S56ZZW5pP7xHziGwWIrZY/g+TQ6ohT0RKhLlOVdPjeKMJeppob1zNxmlk0ipoTMv4s/wkOarpB7wqAPadiCJzttliUlM15Q4UiEyuzKGVAfEssrYqjZsKvLH6Xmzg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAWPR08MB8982.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(136003)(346002)(366004)(396003)(376002)(451199015)(66476007)(8676002)(66446008)(66556008)(91956017)(86362001)(66946007)(41300700001)(76116006)(4326008)(38100700002)(316002)(6916009)(64756008)(478600001)(52536014)(5660300002)(966005)(71200400001)(26005)(8936002)(7696005)(186003)(6506007)(2906002)(122000001)(38070700005)(9686003)(83380400001)(33656002)(55016003);DIR:OUT;SFP:1101; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10193 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f4b7cc50-1d2d-4b9d-6391-08dadeb32564 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NpBEgbIppVrwWSACvr1Db1fNPZiGOaTD1AtjnMvY4cUJH8uvp9zBt8oAsh55Ihaq3QrzVCtTT9r0NA8YmKF6fL3hG/k1W8r4Fz+cSTZptIeQzxxKvRiRu1OTqo1dtZ03TBTyfm9CN9kU9jnP+waJ8HsjY0DdBEyBW0YpC0a0KrIQqscveIzOtSZsCrXJRkF8PLG0nwRYpFxEuqDomaqRHn6nrn1/p7S/a49go4fZrwMt00tM49Ur5PL8jcRrCCFS4cA0hOIDvyIkRXEmnsiUBxe9n8o2VewWcGdWHQW16VY0KzvPN3R7JXJ79eumn223aROvERr4ESjrg1IDurjVAoFRrCuUzu/vhZDgsomviy48RiCUMnlSTajo2TouHolQ2ucwKE5RRvA25yStkCOfFIZWGJC9sNBFiZyBd1Xdj/9ejzksqe7hCEQPscOcN6mZ4TG+4y0efaIXlUH9OE0VbiX3KeYBZfeTtTz+4nVME/2G0m+h/7IJPS70hcUOcv76I/rYMK8f6xhzQ/3xvpqr6e6HGUR277C3Jjlhl5Gv7wijyimudQ+/hy2at4IcWbms7P6KMtsr3NFsPibjnxkc+gY55dYWcYoSJRjZqeMMekLSwmINQDAQ/vIfD66A+03/1GFnPZqvf335sO+NjmtoSF0zP2whhhv1fb4aMQgwF6tFXE/+HeAIdMorSuLs1V7S4QdZeHagOeJE3fb0Vz9mFqA325UJJApyaZhh9sxEB08= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(39860400002)(346002)(396003)(376002)(451199015)(36840700001)(46966006)(40470700004)(52536014)(36860700001)(41300700001)(8936002)(82310400005)(2906002)(5660300002)(33656002)(356005)(6862004)(186003)(9686003)(83380400001)(86362001)(82740400003)(6506007)(336012)(47076005)(40460700003)(7696005)(70206006)(4326008)(8676002)(966005)(478600001)(55016003)(40480700001)(316002)(81166007)(26005)(70586007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2022 15:43:58.9787 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c48b2487-e701-459c-8b62-08dadeb32eaa X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7703 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi DJ,=0A= =0A= > If testing shows that a larger default makes sense across a wide range=0A= > of applications, then we can change the default.=A0 I'm a bit opposed to= =0A= > changing anything because "it makes sense".=A0 Back it up with data.=0A= =0A= Larger values result in major speedups. Even a very conservative increase= =0A= to 50 speeds up xalancbmk up by 5% and omnetpp by 1.3%. A value of=0A= 2000 gives 17.5% and 6% respectively, but performance increases continue=0A= well beyond that.=0A= =0A= > tcache is wide but shallow, fastbins are narrow but deep (tcache caches= =0A= > much larger chunks than fastbins do) Benchmarks show they both provide a= =0A= > speed boost separately, and more so when combined.=0A= =0A= If tcache was deeper, even if only for smaller sizes, it would make fastbin= s=0A= completely redundant and with it all the complex consolidation. As a result= ,=0A= there would be less fragmentation since adjacent free blocks will be merged= =0A= together more often.=0A= =0A= >> Modern allocators are not only much faster than GLIBC in their default= =0A= >> settings=0A= >=0A= > Back this up with data please.=A0 Tcache invalidated most online=0A= > benchmarks.=0A= =0A= Here is a recent paper that covers GLIBC with tcache - it still loses both = on=0A= performance and memory usage: https://arxiv.org/pdf/1905.01135.pdf =0A= =0A= >> but also have lower memory usage.=0A= >=0A= > This is a project we've got on our to-do list.=0A= =0A= I don't believe you can fix that without a major rewrite.=0A= =0A= Cheers,=0A= Wilco=