Message ID | PAWPR08MB8982F23E02BA7BBDC488369083B72@PAWPR08MB8982.eurprd08.prod.outlook.com (mailing list archive) |
---|---|
State | New |
Headers |
Return-Path: <libc-alpha-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E8AB73854835 for <patchwork@sourceware.org>; Thu, 10 Apr 2025 13:45:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8AB73854835 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=lgPXNEJS; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=lgPXNEJS X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on20612.outbound.protection.outlook.com [IPv6:2a01:111:f403:2606::612]) by sourceware.org (Postfix) with ESMTPS id 37B383851A93 for <libc-alpha@sourceware.org>; Thu, 10 Apr 2025 13:44:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 37B383851A93 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 37B383851A93 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2606::612 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1744292664; cv=pass; b=u8mjU5hPtC99OQKUwV+E0dRLCkYRz84irc33n+EHqBAL3cqzac/+Xtn445JuXcHFdB3EF6hlTlGxy6HJn2VkuGUPXSRevQVVYBbghdaoleqXxkt+EXkoGOdFlMc0o1SXB7JPGh44c2KPYoXINpZEU8b+MTVJYxU7k0yE2he9B1U= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1744292664; c=relaxed/simple; bh=ctHEoR/nojC/9w+YE1ZZV0eJtODZJqwzZFdRXdH8kSg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=bipYQT1Svfm0hmU0KoEQDT3ym2isBH+PSkmcBzFMyMSjZC49q1DdCcOsZs8teKzVdStZWtZkPRYbtqLh9cPDUKleuOQ6xfBZnrucBgkNWXYnhF7lMt8gZ9gI3fcKjBdZ7WWwlU0d1/wyvjURjkPl3ulojZijD4FBLrLEiAwEzh8= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37B383851A93 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=DLcACMY+MixoZB9V6KcCaHRAfpqLk6GrkOGOhFmiJCyAZz6nHfEKfsqvBV6a6bkI3Qd/fEd3GjDL6mBaowYW1r784kD0x5gIeVrkPKD2NKhImDSxTtewO9rnFB1OHh/6Qj0X3o1HCyK/I6vVsbf8lzZlMglJWCoBDP2/mUZ43vagZD1AALcebZc1NK9TyWtgd4fuy0+8E5ycbVUsMQ+cmw28hHRgF6duSqVUZWVtf32jc5a9sOdtQSSpI7PdOUuPyQjtP3nBwxANvNDB74PwhbKBc/1op3FM4nbcjMWOmwTz63cargs5E6l/nfRJnk1tKH1YL8i7zqmdos1PIuM0AA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=RsgmrHO6CN0IHWBTasCUXGBtdJ8XKCUJqz7uKsMAq2I=; b=D9PK4zf0SMo39Lnqw1HFzzHBcMFZQCRMM5orBGxGQ6AjMbenSM51CeKbO5XM4+0QoKn/MhQTxOXG2Mp+y++yGZ7U2ajSKVVFBGHzaXqwSM+ZNI30efkkcA0NlUwkBRrpxGxPS/+arEVBiHV8V6xeV76xbSGf1DuQF8eLy6TV8ITJ1anfZQWC6BDJUW77ogtrZOQqVWSdq21Ic32lBqLAJMziDhccn5GJ+5uAjvM0M1Qu/SfZeACKPklcTfa6eNPLxcmQhLH1XWAsz6tMAdl+dF5cdRl/VQ2DP7VPS+nTP7Jw0RB+uh7S6AqB+Z7KtcnAbu3W5FoxwuBtBApTLIohqA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RsgmrHO6CN0IHWBTasCUXGBtdJ8XKCUJqz7uKsMAq2I=; b=lgPXNEJSTavrdHbznu8nAMEsFqrPoKczgmuCK0M0h764IUqhgKixirDaiKbm028ukBJ8THhlK8gdMedc5YFRBfBffxeVgmuyn8RfkwdxtfbCFFBVnX63bPlnytA+NPqsDFncdQrlPKItYm532mAScknVl3Cj6te68VIda/2vb50= Received: from DU2PR04CA0303.eurprd04.prod.outlook.com (2603:10a6:10:2b5::8) by AS8PR08MB10194.eurprd08.prod.outlook.com (2603:10a6:20b:63c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8632.23; Thu, 10 Apr 2025 13:44:19 +0000 Received: from DU2PEPF0001E9BF.eurprd03.prod.outlook.com (2603:10a6:10:2b5:cafe::db) by DU2PR04CA0303.outlook.office365.com (2603:10a6:10:2b5::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8632.23 via Frontend Transport; Thu, 10 Apr 2025 13:44:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DU2PEPF0001E9BF.mail.protection.outlook.com (10.167.8.68) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8632.13 via Frontend Transport; Thu, 10 Apr 2025 13:44:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nbMpNTQ9k7C2qLFSkadJMcbDupCqMyATKrQM1xqAaO41Z4zNP3SwUS3sDn/ZNpOIJYGnA+LxXAbEL2+oIxUf6qYPgdLlr5d96kN6IIYVRfRieJ+9A/uVkX8qSe27pC+TVQ+PUKyBNVNx7zqNu8mbE1ywVJEl/0Y/J6HaVdwdjr5mFebUzOG/HuoijNkOE54NxwiKXssH4+1kaM81y1c12VAf0gJaCxIZjZRszLvhu2yaTxMRy+DD+vnrzeoCpr+5VR+Ncjn4qoFauBOYkQ0GO7wS8W9myC6JmO/PkB/v6e/gMI9vR42JcjKtdqv7MNLa+Flseuc9BmnucW4GXXmd3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=RsgmrHO6CN0IHWBTasCUXGBtdJ8XKCUJqz7uKsMAq2I=; b=dA//Eebe+/BZ2yA8+YVZFZ/gUK+x3pDWykit/vXInsnq9TR+w6mwzQYHJS3WWvKvcGp1OIl7jAtSxaXmormtW3YtrP7tykV3Y/qFAVzCciua3Ki2Ivx13WpL0K17hU/kZet6H4tGFLFnirGcMQgjgCY/d8cLRmJYwkpRInhhQjEAmPLznGyJrgc+B7w79PSfVUJddL/q41EauWDPHBkd+eWmO4G+lK7IQGwvBQR8rtivlGB4ZgLVoZBI+983of4LM0uqo9Uk6RzhMhPfcNu+ZRAW7rxPxGN54ZYcZsra0EFrUIzIrdc1VTHlnWUts5u9XH0btKeQ6qxLYbUDIPi3lQ== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RsgmrHO6CN0IHWBTasCUXGBtdJ8XKCUJqz7uKsMAq2I=; b=lgPXNEJSTavrdHbznu8nAMEsFqrPoKczgmuCK0M0h764IUqhgKixirDaiKbm028ukBJ8THhlK8gdMedc5YFRBfBffxeVgmuyn8RfkwdxtfbCFFBVnX63bPlnytA+NPqsDFncdQrlPKItYm532mAScknVl3Cj6te68VIda/2vb50= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by DU0PR08MB8979.eurprd08.prod.outlook.com (2603:10a6:10:467::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8632.22; Thu, 10 Apr 2025 13:43:45 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::b366:6358:236e:352d]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::b366:6358:236e:352d%4]) with mapi id 15.20.8606.029; Thu, 10 Apr 2025 13:43:45 +0000 From: Wilco Dijkstra <Wilco.Dijkstra@arm.com> To: 'GNU C Library' <libc-alpha@sourceware.org> Subject: [PATCH] malloc: Count tcache entries downwards Thread-Topic: [PATCH] malloc: Count tcache entries downwards Thread-Index: AQHbqh4KZDukzzCag0SvhmoFVu4Ygg== Date: Thu, 10 Apr 2025 13:43:45 +0000 Message-ID: <PAWPR08MB8982F23E02BA7BBDC488369083B72@PAWPR08MB8982.eurprd08.prod.outlook.com> 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_|DU0PR08MB8979:EE_|DU2PEPF0001E9BF:EE_|AS8PR08MB10194:EE_ X-MS-Office365-Filtering-Correlation-Id: 53ba46c3-fbf1-4613-b634-08dd7835cb40 x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; X-Microsoft-Antispam-Message-Info-Original: =?iso-8859-1?q?v+GrRZmKocZpHRB29?= =?iso-8859-1?q?bfjn+hL+RPfnuVNOzit2t3tP4E/hF8HNRXmKfGNG63T/MAtCKP5cwT0N6fq9?= =?iso-8859-1?q?A0hSiqaWN+B5Zf9HI8+wgXZ7q5oyJgcg6CNS80IMaxNQH68t6E2cFjSz6E/m?= =?iso-8859-1?q?QR/WUpxVFijoGw+bStCDWV3Zb5FgkQ8m6wFp/HA7gyvJUG5MtgTfaeBCzeBq?= =?iso-8859-1?q?tHT7GEgCB5IPllqiFvjH5NlRFHI7GgYw+eLz1EetgZV6XHQXK0a2knE2vGfv?= =?iso-8859-1?q?/8kqbJtf+r0dElqZg6uoQ+YGiExvHrWphl+Bko1HIGlHzAH2DRYqw/iBJ4zh?= =?iso-8859-1?q?qu8VI7bDOc7WdrW7xTzHnuN5qrzwkOlS5rM7jDSYt32hHe/MExnY45QinHEf?= =?iso-8859-1?q?AbWlWOv4xnxalBFEQ1kRrUlHdgUgAhb0yoQDODhOqLWnWY8pw/swu5Q/zLM+?= =?iso-8859-1?q?Lx+G3761WIM750M5xePxs2guK1W3olvKXWrE9gSvBJses5dsNz+SZP/MzmQf?= =?iso-8859-1?q?FlRV4ZZ3c/+gRYXQkuvP/iCZHHpsr6GGaIjHgE9Z+vUhhaf10OA4HCJPNR9C?= =?iso-8859-1?q?RTmLKySRBrzAxbWu/DQUkoraQcMRdrA3WGUi/M4TldDSf+BB/x2Tt6pHrWTn?= =?iso-8859-1?q?/s90fqLZnpoM4U2ORZSf000vlC0DGDcWbjxui5T9+7KWRNFB2c0jflOADi73?= =?iso-8859-1?q?lYWVcgpWXM/ho9MaYIoENclMtIzx+qYdoHue2D4+t6uCUrm3NroqNyBL3l/B?= =?iso-8859-1?q?at20HE8s/CLrEC38i/KOm5dqpOrsuzlbfjdCQFmAvENbmCLoPmujSBvK78R5?= =?iso-8859-1?q?oIXnm9/rZuBuuU4LDp1Wh8aKlnOpgyLCJVB9tFEJlFA4s48piFKbxZW0GP6J?= =?iso-8859-1?q?SbfnYviSmyaiQh56SQR4BStHjdgRJ93xVP30VPsrhkgn/o5yKftWJG/hniXl?= =?iso-8859-1?q?kw7gi81u7JZ0m9hOXMxKi+s1f2PA+6AiAnaaJoucfDpOUdBtyPCCAECyykr3?= =?iso-8859-1?q?vrq3F9MAoJpCnh/TaIpVtickIIKN+wanEAoWljDOt+pjIS0BuRfPtG+mtTrn?= =?iso-8859-1?q?tZKf5cBjduQIQpAyxAyWamQ8nyNxUsHVojvxvIrZKAHOQFNWn/p7d76CNOu7?= =?iso-8859-1?q?kJ0+9au/WpjU4mZE6ozVcW1hP9NlkNsLinOGEAW7NtU+4kC7LJqGjuO7xoe7?= =?iso-8859-1?q?OlPhqj1JbHI4mO5zyMT7+jrbGd7LBFMi6zb85xx6yvfNIBfoIl9vnk0NRukv?= =?iso-8859-1?q?tKUawxTpv7yJrGRGRmm6Qf/AVBO+3no16QTooOzvrZSF38mWwb8IXK1uKhGa?= =?iso-8859-1?q?FR+XXjWJe4IvER9wDvXhBVQrcsEoqUbH9WhS+taX5MaaSbtFRpyNx9gn5/mQ?= =?iso-8859-1?q?Tsgmd+WVx6pC3ZUxW+ozviX1y9ALU4M+uYfsv1Y3LDwV2B7gYjg3uHU9dr/r?= =?iso-8859-1?q?7PJ1EgAfVU68XANJ1EoZtwvtbm5GPhSu2XNtyr7ndYO7K0ziuSCqpUQviz3e?= =?iso-8859-1?q?COrdqF4QLcPveXYG6BHcParJFMwWyFaiEfl+g=3D=3D?= 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:(13230040)(366016)(1800799024)(376014)(38070700018); 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: DU0PR08MB8979 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF0001E9BF.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c9a1b528-64cc-44df-cdcc-08dd7835b71c X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026|35042699022|14060799003; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?q?BwazqubL4ox3AjGwxBqAbITfIH?= =?iso-8859-1?q?e8SWe0czbPM1ufL5dC+FaXbtw4PxRvqHSvrZLy24YNtxF+B9vd94WRQL2MpK?= =?iso-8859-1?q?S5z4ztHMI2y66Pq5ZEKHikxm3jfC91DVuePcq2RN5oJhvXiZ4OfIT2V178+G?= =?iso-8859-1?q?CylNLT7kWcPF6BRjNmL7Uh5FCjCcysO3rt63KYD6l7TtmOjkNHgYJ0e22Wzm?= =?iso-8859-1?q?xG/8U3amhuXjpXqKqEGg9PJ4dcu1n7R9nKEAs3LYVnbwxnV2KpM0YPWIMZHj?= =?iso-8859-1?q?h+2PWzN9OHm+OyIhczInHlQvs+NqIkFSmeKv1nvn8rwCro2xLMEv50d0yekt?= =?iso-8859-1?q?OSg+DdWT2BNV395NOEe/Y6rInhPDqeJb+v6ZIhqxqfTzhBAHbMR9CxxhZIQw?= =?iso-8859-1?q?T92FTvF2wpIkPqhY4kzwCi4biKTShun4u/p5F1LkgI1qgB97EgL2xF1xp6Pq?= =?iso-8859-1?q?zddAo98+DYYihqz4tqBivJ0YVsaloicxp8PuqmrjFmgCpc2q389WYquIGr2U?= =?iso-8859-1?q?86FlmRT5vL5+Zmxddm5efdlTyeDBJxKo0yWs9PEY2EiEClLnAvF81ewQoCoN?= =?iso-8859-1?q?IOhNBywF+mGB2WrWK8FbBzT2ocZWiAsEqKJHxdVCz7oIMMomRB/mD3z9VBMx?= =?iso-8859-1?q?E5SvyZ0DDk5yjLkpqwKquZGx4mG/Gt5KyWSUz1PF66LubPeJRQ7DLH/qOTUV?= =?iso-8859-1?q?VV+PlI7ysrAtJHgxvp9yM0avEO6QqXIWeSkDa6q3bMHCzDa/Dk8LvW5XcCqe?= =?iso-8859-1?q?F+0UKAlMyW+G06DJ9HdzSnBSpT8aWqxUOV+KPpy/IEhsa7luM3YMfIKGVQ1g?= =?iso-8859-1?q?u2sgVK4PQK4NJhMAmFE2rAc14ruJ4ACRUOUBRtSpzIcfEoPS/xzddIs7ewd+?= =?iso-8859-1?q?RO+Z0UU2bXhWYgFnxtZLg9A1oEr/1w/tICblb2KPsr1TNLt5fq5InjXvM7b4?= =?iso-8859-1?q?S8RZUQzIqRKDrXyB20f4tb/QneALqf8in5vjVX4o+wwZj7Jy1iVySMA4EhfF?= =?iso-8859-1?q?zOn8oxPsY9xCIGXWq2JgGf9Wb/cJrYIJGBQfViDgXiU9pKL0bttdBDzR57+C?= =?iso-8859-1?q?8+sDTdjZ3A0Yh7qkid3+nQAqfl5H+L6rFrKA9wv4RSraKJcrALOiV55sT71W?= =?iso-8859-1?q?t96mupjhU2ptzp3ewHZcuXgwxOoCxdNxHUamGooKRRH30k0Y9oCoFpITFCvq?= =?iso-8859-1?q?bNAIbz2sWzowEYNvwogTZpPgIXgU24M0FJjOKxeSYGYpakRkdqyzh/Wt47Ls?= =?iso-8859-1?q?lRq0GXtDR1MoVCfzMOCxT90HGWpclo0uiBSx8vcxtqQEe/lxYKB569Ap6c2S?= =?iso-8859-1?q?WYKk+G+jHHWUK7a/DcTu04/AV2xopTTP254H/8k19CCdjXeperYPM+t5AT23?= =?iso-8859-1?q?DaU3/YL80ZQLeL6WU6xOLTTI6ILxkzySFXmZad8EVm6+cOhItDk3OzsDhnmZ?= =?iso-8859-1?q?5VXT17QSu0yB5X+IQvGw9UuPj18Dbzsyo00M2L8StS0/nTLfM8VHta6sBLg0?= =?iso-8859-1?q?GQkQS8wig4vTNjE/oZLxolCJ+O6CLyn+sKJOf7aamyfe1ldNM=3D?= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026)(35042699022)(14060799003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2025 13:44:19.4781 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53ba46c3-fbf1-4613-b634-08dd7835cb40 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF0001E9BF.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10194 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org |
Series |
malloc: Count tcache entries downwards
|
|
Checks
Context | Check | Description |
---|---|---|
redhat-pt-bot/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
linaro-tcwg-bot/tcwg_glibc_build--master-arm | success | Build passed |
linaro-tcwg-bot/tcwg_glibc_check--master-arm | success | Test passed |
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 | success | Build passed |
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 | success | Test passed |
redhat-pt-bot/TryBot-32bit | success | Build for i686 |
Commit Message
Wilco Dijkstra
April 10, 2025, 1:43 p.m. UTC
Currently tcache requires 2 global variable accesses to determine whether a block can be added to the tcache. Change the counts array to indicate the number of entries that could be added by counting downwards. If the count reaches zero, no more blocks can be added. If the entries pointer is not NULL, at least one block is available for allocation. Now each tcache bin can support a different maximum number of blocks, and they can be individually switched on or off (a zero initialized count+entry means the tcache bin is not available for free or malloc). Performance is neutral on current trunk (+1.4% on malloc-bench-thread 32), but after the outstanding improvements to free it gives ~5%. ---
Comments
Hi Wilco, On 10-04-2025 14:43, Wilco Dijkstra wrote: > > Currently tcache requires 2 global variable accesses to determine > whether a block can be added to the tcache. Change the counts array > to indicate the number of entries that could be added by counting > downwards. If the count reaches zero, no more blocks can be added. > If the entries pointer is not NULL, at least one block is available > for allocation. > > Now each tcache bin can support a different maximum number of blocks, > and they can be individually switched on or off (a zero initialized > count+entry means the tcache bin is not available for free or malloc). > > Performance is neutral on current trunk (+1.4% on malloc-bench-thread 32), > but after the outstanding improvements to free it gives ~5%. > > --- > > diff --git a/malloc/malloc.c b/malloc/malloc.c > index a0bc733482532ce34684d0357cb9076b03ac8a52..c3e46518c5335467bb9b6ba0f0e96c4d18ee25e6 100644 > --- a/malloc/malloc.c > +++ b/malloc/malloc.c > @@ -3169,7 +3169,7 @@ tcache_put (mchunkptr chunk, size_t tc_idx) > > e->next = PROTECT_PTR (&e->next, tcache->entries[tc_idx]); > tcache->entries[tc_idx] = e; > - ++(tcache->counts[tc_idx]); > + --(tcache->counts[tc_idx]); > } > > /* Caller must ensure that we know tc_idx is valid and there's > @@ -3192,7 +3192,7 @@ tcache_get_n (size_t tc_idx, tcache_entry **ep) > else > *ep = PROTECT_PTR (ep, REVEAL_PTR (e->next)); > > - --(tcache->counts[tc_idx]); > + ++(tcache->counts[tc_idx]); > e->key = 0; > return (void *) e; > } > @@ -3217,7 +3217,7 @@ tcache_available (size_t tc_idx) > { > if (tc_idx < mp_.tcache_bins > && tcache != NULL > - && tcache->counts[tc_idx] > 0) > + && tcache->entries[tc_idx] != NULL) This will not be Ok for the pointer sizzling, which sizzles the entries. Why not check for: tcache->counts[tc_idx] != 0 > return true; > else > return false; > @@ -3265,7 +3265,7 @@ tcache_free (mchunkptr p, INTERNAL_SIZE_T size) > if (__glibc_unlikely (e->key == tcache_key)) > tcache_double_free_verify (e, tc_idx); > > - if (tcache->counts[tc_idx] < mp_.tcache_count) > + if (tcache->counts[tc_idx] != 0) You do it here. > { > tcache_put (p, tc_idx); > done = true; > @@ -3337,6 +3337,8 @@ tcache_init(void) > { > tcache = (tcache_perthread_struct *) victim; > memset (tcache, 0, sizeof (tcache_perthread_struct)); > + for (int i = 0; i < TCACHE_MAX_BINS; i++) > + tcache->counts[i] = mp_.tcache_count; > } > > } > @@ -4006,8 +4008,7 @@ _int_malloc (mstate av, size_t bytes) > mchunkptr tc_victim; > > /* While bin not empty and tcache not full, copy chunks. */ > - while (tcache->counts[tc_idx] < mp_.tcache_count > - && (tc_victim = *fb) != NULL) > + while (tcache->counts[tc_idx] != 0 && (tc_victim = *fb) != NULL) > { > if (__glibc_unlikely (misaligned_chunk (tc_victim))) > malloc_printerr ("malloc(): unaligned fastbin chunk detected 3"); > @@ -4067,8 +4068,7 @@ _int_malloc (mstate av, size_t bytes) > mchunkptr tc_victim; > > /* While bin not empty and tcache not full, copy chunks over. */ > - while (tcache->counts[tc_idx] < mp_.tcache_count > - && (tc_victim = last (bin)) != bin) > + while (tcache->counts[tc_idx] != 0 && (tc_victim = last (bin)) != bin) > { > if (tc_victim != NULL) > { > @@ -4204,8 +4204,7 @@ _int_malloc (mstate av, size_t bytes) > #if USE_TCACHE > /* Fill cache first, return to user only if cache fills. > We may return one of these chunks later. */ > - if (tcache_nb > 0 > - && tcache->counts[tc_idx] < mp_.tcache_count) > + if (tcache_nb > 0 && tcache->counts[tc_idx] != 0) > { > tcache_put (victim, tc_idx); > return_cached = 1; > >
Hi Cupertino, > - && tcache->counts[tc_idx] > 0) > + && tcache->entries[tc_idx] != NULL) > This will not be Ok for the pointer sizzling, which sizzles the entries. > Why not check for: > tcache->counts[tc_idx] != 0 That checks for tcache not full rather than not empty, so it won't work. Pointer swizzling would need an extra swizzle here. >> - if (tcache->counts[tc_idx] < mp_.tcache_count) >> + if (tcache->counts[tc_idx] != 0) > You do it here. This checks whether tcache is not full. There are alternative schemes possible, eg. using combined dual counters that can give a zero for both full and empty, but those are more complex than this. Cheers, Wilco
On 4/11/25 6:52 AM, Wilco Dijkstra wrote: > Hi Cupertino, > >> - && tcache->counts[tc_idx] > 0) >> + && tcache->entries[tc_idx] != NULL) >> This will not be Ok for the pointer sizzling, which sizzles the entries. >> Why not check for: >> tcache->counts[tc_idx] != 0 > > That checks for tcache not full rather than not empty, so it won't work. > Pointer swizzling would need an extra swizzle here. > >>> - if (tcache->counts[tc_idx] < mp_.tcache_count) >>> + if (tcache->counts[tc_idx] != 0) >> You do it here. > > This checks whether tcache is not full. > > There are alternative schemes possible, eg. using combined > dual counters that can give a zero for both full and empty, > but those are more complex than this. ... and less complex is better. The implementation should be simple enough to debug, and obvious to understand when reading the code. It may not always easy to keep all the parts straight in your head, but it should be possible to write top-level documents like: https://sourceware.org/glibc/wiki/MallocInternals And keep them updated so anyone using or developing glibc can understand the top-level heuristics.
Hi Wilco, On 11-04-2025 11:52, Wilco Dijkstra wrote: > Hi Cupertino, > >> - && tcache->counts[tc_idx] > 0) >> + && tcache->entries[tc_idx] != NULL) >> This will not be Ok for the pointer sizzling, which sizzles the entries. >> Why not check for: >> tcache->counts[tc_idx] != 0 Right sorry, then maybe different from the value it should be when empty ? I mean it should always be better to compare with a constant value. Sizzling the entries will make it more complex, I think. > > That checks for tcache not full rather than not empty, so it won't work. > Pointer swizzling would need an extra swizzle here. > >>> - if (tcache->counts[tc_idx] < mp_.tcache_count) >>> + if (tcache->counts[tc_idx] != 0) >> You do it here. > > This checks whether tcache is not full. > > There are alternative schemes possible, eg. using combined > dual counters that can give a zero for both full and empty, > but those are more complex than this. > > Cheers, > Wilco Cheers, Cupertino
Hi Cupertino, >> - && tcache->counts[tc_idx] > 0) >> + && tcache->entries[tc_idx] != NULL) >> This will not be Ok for the pointer sizzling, which sizzles the entries. >> Why not check for: >> tcache->counts[tc_idx] != 0 > Right sorry, then maybe different from the value it should be when empty ? > I mean it should always be better to compare with a constant value. > Sizzling the entries will make it more complex, I think. We don't swizzle the first entry so that you can easily compare with NULL. Since the goal is to allow a different number of entries in each bin, there isn't a constant or global one can use either. You can easily unswizzle if you need to for the large tcache code - after [1] tcache_available is only used by _mid_memalign, so we can just inline it there. Using tcache_available is not really useful for large blocks anyway as a non-NULL pointer does not imply a block of the required size (or larger) is available. Cheers, Wilco [1] https://sourceware.org/pipermail/libc-alpha/2025-April/165720.html
Hi Wilco, I have no strong opinion on this. For what is worth, patch is Ok to me. Also I think it is possible to adapt pointer sizzling leaving the entry as NULL, and still do the sizzling on the entry. Will work on such patch on top of my pointer sizzling one. Cheers, Cupertino On 16-04-2025 18:19, Wilco Dijkstra wrote: > Hi Cupertino, > >>> - && tcache->counts[tc_idx] > 0) >>> + && tcache->entries[tc_idx] != NULL) >>> This will not be Ok for the pointer sizzling, which sizzles the entries. >>> Why not check for: >>> tcache->counts[tc_idx] != 0 >> Right sorry, then maybe different from the value it should be when empty ? >> I mean it should always be better to compare with a constant value. >> Sizzling the entries will make it more complex, I think. > > We don't swizzle the first entry so that you can easily compare with NULL. Since the > goal is to allow a different number of entries in each bin, there isn't a constant or > global one can use either. > > You can easily unswizzle if you need to for the large tcache code - after [1] tcache_available > is only used by _mid_memalign, so we can just inline it there. Using tcache_available is not > really useful for large blocks anyway as a non-NULL pointer does not imply a block of the > required size (or larger) is available. > > Cheers, > Wilco > > [1] https://sourceware.org/pipermail/libc-alpha/2025-April/165720.html
diff --git a/malloc/malloc.c b/malloc/malloc.c index a0bc733482532ce34684d0357cb9076b03ac8a52..c3e46518c5335467bb9b6ba0f0e96c4d18ee25e6 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -3169,7 +3169,7 @@ tcache_put (mchunkptr chunk, size_t tc_idx) e->next = PROTECT_PTR (&e->next, tcache->entries[tc_idx]); tcache->entries[tc_idx] = e; - ++(tcache->counts[tc_idx]); + --(tcache->counts[tc_idx]); } /* Caller must ensure that we know tc_idx is valid and there's @@ -3192,7 +3192,7 @@ tcache_get_n (size_t tc_idx, tcache_entry **ep) else *ep = PROTECT_PTR (ep, REVEAL_PTR (e->next)); - --(tcache->counts[tc_idx]); + ++(tcache->counts[tc_idx]); e->key = 0; return (void *) e; } @@ -3217,7 +3217,7 @@ tcache_available (size_t tc_idx) { if (tc_idx < mp_.tcache_bins && tcache != NULL - && tcache->counts[tc_idx] > 0) + && tcache->entries[tc_idx] != NULL) return true; else return false; @@ -3265,7 +3265,7 @@ tcache_free (mchunkptr p, INTERNAL_SIZE_T size) if (__glibc_unlikely (e->key == tcache_key)) tcache_double_free_verify (e, tc_idx); - if (tcache->counts[tc_idx] < mp_.tcache_count) + if (tcache->counts[tc_idx] != 0) { tcache_put (p, tc_idx); done = true; @@ -3337,6 +3337,8 @@ tcache_init(void) { tcache = (tcache_perthread_struct *) victim; memset (tcache, 0, sizeof (tcache_perthread_struct)); + for (int i = 0; i < TCACHE_MAX_BINS; i++) + tcache->counts[i] = mp_.tcache_count; } } @@ -4006,8 +4008,7 @@ _int_malloc (mstate av, size_t bytes) mchunkptr tc_victim; /* While bin not empty and tcache not full, copy chunks. */ - while (tcache->counts[tc_idx] < mp_.tcache_count - && (tc_victim = *fb) != NULL) + while (tcache->counts[tc_idx] != 0 && (tc_victim = *fb) != NULL) { if (__glibc_unlikely (misaligned_chunk (tc_victim))) malloc_printerr ("malloc(): unaligned fastbin chunk detected 3"); @@ -4067,8 +4068,7 @@ _int_malloc (mstate av, size_t bytes) mchunkptr tc_victim; /* While bin not empty and tcache not full, copy chunks over. */ - while (tcache->counts[tc_idx] < mp_.tcache_count - && (tc_victim = last (bin)) != bin) + while (tcache->counts[tc_idx] != 0 && (tc_victim = last (bin)) != bin) { if (tc_victim != NULL) { @@ -4204,8 +4204,7 @@ _int_malloc (mstate av, size_t bytes) #if USE_TCACHE /* Fill cache first, return to user only if cache fills. We may return one of these chunks later. */ - if (tcache_nb > 0 - && tcache->counts[tc_idx] < mp_.tcache_count) + if (tcache_nb > 0 && tcache->counts[tc_idx] != 0) { tcache_put (victim, tc_idx); return_cached = 1;