From patchwork Thu Apr 2 13:56:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 132625 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 337694BA23FA for ; Thu, 2 Apr 2026 13:58:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 337694BA23FA 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=oZt74fJC; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=oZt74fJC X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazon11011038.outbound.protection.outlook.com [40.107.130.38]) by sourceware.org (Postfix) with ESMTPS id E35164BA2E15 for ; Thu, 2 Apr 2026 13:57:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E35164BA2E15 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 E35164BA2E15 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.130.38 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1775138256; cv=pass; b=k4YjnRmUr+6uKcKVRbCYc3HpVsEg5zvffa50Am5RNrqlbt2dC7yhkQSkh/9D+VSdViiyuuTmEthdejda/VBGMSNH8HQoSsIM+sEp30+3aOYWMXCRl81xg9QqaFxiG54YH6vtdIQL+GwUl54cBgS5EIny7vR1bHrnyK3AgLlLwDI= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1775138256; c=relaxed/simple; bh=kZPbj5m9so0mZIcyUjXt5DFbeAfI78i6ts/URPzVtsI=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=hLOF/KKEWu1AU0rx4keV4zsYyVoSidp3em8NWmU5DJu9UjeFSG2CK3YDLpju7rPVVRpsyw8YV0NvfUClx98KO8B37EN5m5JwJSBYrbElQL3mEMTehqf4/tj4znvodsYhHmLO0jFnz1hxiY5NQ/e+aSDoZ9obKtU6Oa44QpjaHEc= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E35164BA2E15 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=KMTKVgPt2dQDIi8oqPIzbSZuyleGrgNWBp+EkkbGcwr4CmfF1fhFIGqfgMvKVRIz0Vza45gSkWoTwm3H2ZDfUvwgKeFB3VhZ/PVWQ3aZN6IkW/MJr3k3CudCIs48f6IgKxvQ2O50W2xw533RHTWz9XS8/+pOwpcioO+1xgclUd4z4pi6UvdeRDSywH+mOEntW+QyTsGciJ6Zj5iLJmF2O9uHTjPdafalmUfQq43tXob8QgugWipJY0na6Io6YRiFRIPUA9ucF++cti8i/n48ma1OVuTuUGNuUY1GC1+tfdonWTFZgmDJS87RF5F0atjze2Pki8lfRCM0eDhBw0pDVA== 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=H9OEOBAvxPZGFSRbElpbCT8Ob3Niy3haefVLLJ7kgmg=; b=KHgHyUJNgWNjsaL1UpUu4zc5E+Jnwg87nq3YZYRN4BXdqfNX6MYr0tUN6mkaHBnMb2acmw+6npOxPHSWDQOX2Td6jBe0jldA8WD5Ourn82NOEE0kXHwTUZBK/ifRIptHTYG8raqU/7NljhrPFCXlo1m44MgkEezAe7znfYa5BHsnNu8ksiIJY8EqQ3Jbhme/c47dUnpeaQB5+SZ1lhdf8ZoLyhEX5XTwROzg2F8FE8acPiSHI57cM+YCuzhgPBBUkeuntjLP9e8AF57HmQic1e8wdE/F2kCh8+pBMRGV4qqY6wFqSdlBghqZ4KbM/O/gV0h6ONwb6JNs4Hy5/oHYKA== 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=H9OEOBAvxPZGFSRbElpbCT8Ob3Niy3haefVLLJ7kgmg=; b=oZt74fJC9V1dXP9jktI3Ims52auPeQ0ZFznbZtR6yLl6rr25jUgOZDgVHpA4HSHgK1z1v9ciYMJ9ycfN2hhzgAsj/FgjzKsAvmUhHylm7HS2Su6f8SMqbLWbniUlPqNfJw/g4G9Tsf7nvm351MVKpny+1X400dp2fivGB2SQYSY= Received: from AS9PR05CA0356.eurprd05.prod.outlook.com (2603:10a6:20b:490::22) by GVXPR08MB10836.eurprd08.prod.outlook.com (2603:10a6:150:155::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17; Thu, 2 Apr 2026 13:57:14 +0000 Received: from AM3PEPF0000A792.eurprd04.prod.outlook.com (2603:10a6:20b:490:cafe::7) by AS9PR05CA0356.outlook.office365.com (2603:10a6:20b:490::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.30 via Frontend Transport; Thu, 2 Apr 2026 13:57:11 +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 AM3PEPF0000A792.mail.protection.outlook.com (10.167.16.121) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.17 via Frontend Transport; Thu, 2 Apr 2026 13:57:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jz/oNtppOc/EHlb309URmIAzu9UXjG0yoviABHKPw4sntCU+enW2tsGyjNd/cIJTKjeIew3O3q7Zh2AnfU/US3y7EgxO0S/HvruSCCTmmc4mfQP2PP9W9PFDZoYrmRnECjpuhfSN2Y76WHnJoAMzMMonnbWwidvJ2Cs9hbj9fOqgxMoSIwglygm9zecRmUXnInMjt4+YWz+mmyXV0fQeZe16QnCLPeYnpJoDUOLKqzmUibVq6GttPdvpxSopwVxpS+2oissC5DKRByMPLFi/n7i2OErOIXFsFVz41pfQENarjX4NM5aU3PsesQ3dkzjhhmuYEKQg1XrHHNx25agHHg== 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=H9OEOBAvxPZGFSRbElpbCT8Ob3Niy3haefVLLJ7kgmg=; b=IoL+Be9Tr04MR1meYtnpiX+8enGtgr7SeTwqzDHDmbIRkopRyxPMOD1kQiIHyRFlnheiaw2viZXE//5xjNqi64fCuBok2R8uevzy39KDQk0ILW9c6FoN34EYrWlUCrJk+8rR3wYNCmzATAsvB7Gu1Nvkd/ELGJQB0SROnNrXXLnEc1zcvqOcSj8DPAxCpqAGovsexV4mf5Jy9FvBHny1W7tcsRNfyZtJ8yZjqLYCm34AWsC1OUwt9mBDIHaF4/9YkZ/LRHSW0US78sq27NmUCjpt4kZnQivQm4H7jGS07p+ZrxHszXmFdDE9TxiiYiNfO//R+Kzg12v8g8tCXkm0pA== 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=H9OEOBAvxPZGFSRbElpbCT8Ob3Niy3haefVLLJ7kgmg=; b=oZt74fJC9V1dXP9jktI3Ims52auPeQ0ZFznbZtR6yLl6rr25jUgOZDgVHpA4HSHgK1z1v9ciYMJ9ycfN2hhzgAsj/FgjzKsAvmUhHylm7HS2Su6f8SMqbLWbniUlPqNfJw/g4G9Tsf7nvm351MVKpny+1X400dp2fivGB2SQYSY= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by DU4PR08MB11771.eurprd08.prod.outlook.com (2603:10a6:10:63d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.18; Thu, 2 Apr 2026 13:56:11 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::5821:707a:c30b:dd9a]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::5821:707a:c30b:dd9a%5]) with mapi id 15.20.9769.016; Thu, 2 Apr 2026 13:56:10 +0000 From: Wilco Dijkstra To: glibc developers CC: Florian Weimer Subject: [PATCH v2] malloc: Remove dynamic mmap/trim threshold [BZ #30769] Thread-Topic: [PATCH v2] malloc: Remove dynamic mmap/trim threshold [BZ #30769] Thread-Index: AQHcwqhNTGtBVMPhHEmyqYXiGfTmbw== Date: Thu, 2 Apr 2026 13:56:10 +0000 Message-ID: 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_|DU4PR08MB11771:EE_|AM3PEPF0000A792:EE_|GVXPR08MB10836:EE_ X-MS-Office365-Filtering-Correlation-Id: 43e540d6-71cf-42cc-70f1-08de90bfbdde 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|38070700021|56012099003|18002099003; X-Microsoft-Antispam-Message-Info-Original: wiZ4HG4sKj0MhwjmXVsY6JP0l/XxhzhcFofuRvVG6FqZi/AWfUlHT3MOzaf+OWKboJCjDXKb6qP0W1gMZEkuOHydXOUmf0AW3W1q9HuZ8IBPYL+87G1RORorAJKV298YuRNOLEYh6BG4YUPBh+pZTzsddI/fHT5jMKkBRmYjdANrOMfCKUbD7pU91DgJyzRdbxBlCSi+6Evzc0OsZAKFaf51h5Hq65XdGg5ZsTTjgHMmTQLutpGoawhsilF3ovIr0V7/D00oCKV9+PnbPW3UMO8GGCiLg2C/OYsEzMd0XpDME9Q3hCwcg/5C+PZ4ouRcy4nH3Sr/1Rclw+RwHlSjhROaswC40yYrmlBTOmpWrUpvg7o4RPETupbDWp4JYfIJ0f2Qt9pOIzCAtNDtR6HBgr2Z+sadt0tpm+DjXDU5VgOyYyKF7YSGH7ei/eJ8Q8in4RJq+YutZftsZ8mzUGSxIIZuSwSVMI5GeZpIZghLpS2VN48NoBauHZDL59FGUjLdUYsncYBb5cOsTANyUAVsJYHGsjbPPKWQEGMrp8hLl3EumOOz9Ip4zVLLxiQ9lLD8JqA7s4YS6Fx9pceQZdGz4mQ+oVJ9hfVe7DFkaYDe6RC1fAU2jeI7sMaz4mJ8HwOnI36Etf1u4KSVNoNXDopQl24z8TQTjfPPxe8Ev/Q4rpPPaN98X/AdwgqtI8aapx9GM1GsGylf+RZba1IvgHYVkSsQ3PbZ4KZrABmvLxMDr7YUpmsLLHVNJocxlG+xlsFxJlsigNXQuSITSdTdi/0kkkQHMlFAQ8dIte1x/73q84c= 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)(38070700021)(56012099003)(18002099003); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: FtLjiPUFpS23jgwqFbueW6p/7AH2EmNuyjraE7ynzHsGnn0uaTKQMIo/SzO9J+QIKFRDzCVtVJBTIPHzDvj+jBUK7C3qoaJqvPunHJ32ETJzkMkf4bM/moysCktGtsyBwdWNEMF40WpkpRrpWNbIjawAymStfFhtK/ajQhNs2E1NGucUcWDXo0ojOX5Dx9extm8mvGyOZEbDrQiDmUZfSVyeDISyBz8JAQvqhALgXowDTLujhyc+/8DrSdplLHQGmHbFCVCdFwCiJL0zb1YDMXrwTQO5mGXiU82no4PRc/dEpL4DBbyCuo9dV1KNcii1ajM4CzqVD141MOGdxKj9bQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR08MB11771 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF0000A792.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 109ff7f8-2870-48b0-225a-08de90bf98bf X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|376014|35042699022|36860700016|1800799024|82310400026|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: 1Aex/Nuo92qbTQL0ckpqVlI8jeb2VYIj3Jm7gnb8nG097hkSs6K3t4AlBlzHd/rPS9JjNuScGaQPYVTAoQ45pk9H88me1eLo8Dc1m3f7Jk4SXpZf88SkfasmDmnEIsMVbBLhbrADPbLmmYkQQDTt7ZpPGeOU4W+4XXYPsX4AnEAKCXkGqJ762VXb6WkojKBenVwEDcWcuDkafj+T+zDmtcBNYtIurA0X+jBfu5MSw2bAE0cVfE6Af0g+DRKy2hti8iSecpIzNgy4YyxzmAb4/WkrxxR4ZSGP+0zRJ3FOyRQF/Z+q1MwPkZOGbHGmcq8MqaN/45LeZnDj10lfuepQLiv01nnxzWNzV/n2VV7D+wtO52LN/8PMQAvfTNaq+4ynNbwkT42YCsXfD5Wieox4Gj+x19Tp9hVsstT19BfxGEJxh6JZh+YTeWwasm2ytjDmSCbFpIb1uRdXGyyDpBqXpDNFPuQXjvVDTGx3NHYlSeBAj7Nco5bMv37CN8Vk3XfDJGNLWmVbcFeuA+Twu1CmzKZKKGNbaMDZD0zO7tqSbwMy/yRSvc7Mw6UDBTjbC8VjXWDnUFioqt+viHX9DdzcYVVf7cXBmp9hpFLDEz9UhAUTgb19MxuFDxVzAIDgdYg0ZglMrs8HhzIzzj1scPOns+dpwMVK48ZqW3kCQkmUfk8ZYV+lY4/MznTxOD4Irzdlo5gS/ZRZIxhkEXO1LPN3+GqnWtrAbzpeZ4htFYdhF13UhT5Ua11wukHfJVij3iBxpayvBjt+J/k6HS+MCHCOHA== 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)(14060799003)(376014)(35042699022)(36860700016)(1800799024)(82310400026)(18002099003)(56012099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kaaPppbHGDKncMz8O02BH7zIBE5KYGcLOc7dTWM7PaMNzIFVdHLqPaE/bqKHuGJy2wePTn3Um8iHiJnIL8s/m07gZkgR+pd7sCabFdYR57aIBfKGHKENTo75QPtVKaaoTunBMe14R+ea4BDCMejaJ5S9g1XlkF6LgyB8XmM65lJ1Q3uhlwpNU8nfdd8j7i5JTOO5zFP/IjAQLTWOlbnLAyeBAHLjOCGClqrbI9jMIcTQeU3ZzqioCubDzzjv9bSHMkstKTQti178xu+fFwt7PBwszZlIkAkVRGMlKYEPYLA+QUcwfQEMEl23ccZwk5Se0Qfj9TveL1+SDflU5sbBIwHDyJ58ZqZQXpHwkmWBQhtgwUVi9sbep0zHUjUhqYZJaSas8IJmu73gUTouaj0FqaWDoa56vtxSdFTFYqVOq+62Shy3fFdx5g/+VGXMvmME X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2026 13:57:13.1332 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43e540d6-71cf-42cc-70f1-08de90bfbdde 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: AM3PEPF0000A792.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB10836 X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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 sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org v2: Update documentation Whenever a large mmap is released the mmap and trim thresholds are updated. As a result these thresholds grow ever larger which means huge allocations are always served by arenas rather than mmap. The thresholds can end up as large as an arena, which completely stops all trimming of the top block. Remove the code completely - the default thresholds seem way too low for modern 64-bit targets, but they can be increased seperately. Passes regress - OK for commit? Reviewed-by: Adhemerval Zanella diff --git a/malloc/malloc.c b/malloc/malloc.c index 6a888b0eb7de53ae7b814275e86d2bd2f06b5e53..8b7a414ab8d2c0f84ba7be7449a7909d1930d325 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1770,10 +1770,6 @@ struct malloc_par int n_mmaps; int n_mmaps_max; int max_n_mmaps; - /* the mmap_threshold is dynamic, until the user sets - it manually, at which point we need to disable any - dynamic behavior. */ - int no_dyn_threshold; /* Statistics */ INTERNAL_SIZE_T mmapped_mem; @@ -4291,18 +4287,6 @@ _int_free_chunk (mstate av, mchunkptr p, INTERNAL_SIZE_T size, int have_lock) /* Preserve errno in case munmap sets it. */ int err = errno; - /* See if the dynamic brk/mmap threshold needs adjusting. - Dumped fake mmapped chunks do not affect the threshold. */ - if (!mp_.no_dyn_threshold - && chunksize_nomask (p) > mp_.mmap_threshold - && chunksize_nomask (p) <= DEFAULT_MMAP_THRESHOLD_MAX) - { - mp_.mmap_threshold = chunksize (p); - mp_.trim_threshold = 2 * mp_.mmap_threshold; - LIBC_PROBE (memory_mallopt_free_dyn_thresholds, 2, - mp_.mmap_threshold, mp_.trim_threshold); - } - munmap_chunk (p); __set_errno (err); @@ -4901,40 +4885,32 @@ __malloc_stats (void) static __always_inline int do_set_trim_threshold (size_t value) { - LIBC_PROBE (memory_mallopt_trim_threshold, 3, value, mp_.trim_threshold, - mp_.no_dyn_threshold); + LIBC_PROBE (memory_mallopt_trim_threshold, 2, value, mp_.trim_threshold); mp_.trim_threshold = value; - mp_.no_dyn_threshold = 1; return 1; } static __always_inline int do_set_top_pad (size_t value) { - LIBC_PROBE (memory_mallopt_top_pad, 3, value, mp_.top_pad, - mp_.no_dyn_threshold); + LIBC_PROBE (memory_mallopt_top_pad, 2, value, mp_.top_pad); mp_.top_pad = value; - mp_.no_dyn_threshold = 1; return 1; } static __always_inline int do_set_mmap_threshold (size_t value) { - LIBC_PROBE (memory_mallopt_mmap_threshold, 3, value, mp_.mmap_threshold, - mp_.no_dyn_threshold); + LIBC_PROBE (memory_mallopt_mmap_threshold, 2, value, mp_.mmap_threshold); mp_.mmap_threshold = value; - mp_.no_dyn_threshold = 1; return 1; } static __always_inline int do_set_mmaps_max (int32_t value) { - LIBC_PROBE (memory_mallopt_mmap_max, 3, value, mp_.n_mmaps_max, - mp_.no_dyn_threshold); + LIBC_PROBE (memory_mallopt_mmap_max, 2, value, mp_.n_mmaps_max); mp_.n_mmaps_max = value; - mp_.no_dyn_threshold = 1; return 1; } diff --git a/manual/memory.texi b/manual/memory.texi index 4f0ef51514057136c14ceb6811face0117e69272..f8b6be6ee781cafda1774598585b50524d6cdca0 100644 --- a/manual/memory.texi +++ b/manual/memory.texi @@ -1333,10 +1333,7 @@ that the memory for these chunks can be returned to the system on @code{free}. Note that requests smaller than this threshold might still be allocated via @code{mmap}. -If this parameter is not set, the default value is set as 128 KiB and the -threshold is adjusted dynamically to suit the allocation patterns of the -program. If the parameter is set, the dynamic adjustment is disabled and the -value is set statically to the input value. +If this parameter is not set, the default value is set as 128 KiB. This parameter can also be set for the process at startup by setting the environment variable @env{MALLOC_MMAP_THRESHOLD_} to the desired value. @@ -1371,10 +1368,7 @@ environment variable @env{MALLOC_TOP_PAD_} to the desired value. This is the minimum size (in bytes) of the top-most, releasable chunk that will trigger a system call in order to return memory to the system. -If this parameter is not set, the default value is set as 128 KiB and the -threshold is adjusted dynamically to suit the allocation patterns of the -program. If the parameter is set, the dynamic adjustment is disabled and the -value is set statically to the provided input. +If this parameter is not set, the default value is set as 128 KiB. This parameter can also be set for the process at startup by setting the environment variable @env{MALLOC_TRIM_THRESHOLD_} to the desired value. diff --git a/manual/probes.texi b/manual/probes.texi index 23340e8e0774ae080bc6cecf0a916902c490f629..82d234f4b8ee0be489ef56918b536fedf252531d 100644 --- a/manual/probes.texi +++ b/manual/probes.texi @@ -161,37 +161,33 @@ value, and @var{$arg2} is the previous value of this @code{malloc} parameter. @end deftp -@deftp Probe memory_mallopt_trim_threshold (int @var{$arg1}, int @var{$arg2}, int @var{$arg3}) +@deftp Probe memory_mallopt_trim_threshold (int @var{$arg1}, int @var{$arg2}) This probe is triggered shortly after the @code{memory_mallopt} probe, when the parameter to be changed is @code{M_TRIM_THRESHOLD}. Argument @var{$arg1} is the requested value, @var{$arg2} is the previous value of -this @code{malloc} parameter, and @var{$arg3} is nonzero if dynamic -threshold adjustment was already disabled. +this @code{malloc} parameter. @end deftp -@deftp Probe memory_mallopt_top_pad (int @var{$arg1}, int @var{$arg2}, int @var{$arg3}) +@deftp Probe memory_mallopt_top_pad (int @var{$arg1}, int @var{$arg2}) This probe is triggered shortly after the @code{memory_mallopt} probe, when the parameter to be changed is @code{M_TOP_PAD}. Argument @var{$arg1} is the requested value, @var{$arg2} is the previous value of -this @code{malloc} parameter, and @var{$arg3} is nonzero if dynamic -threshold adjustment was already disabled. +this @code{malloc} parameter. @end deftp -@deftp Probe memory_mallopt_mmap_threshold (int @var{$arg1}, int @var{$arg2}, int @var{$arg3}) +@deftp Probe memory_mallopt_mmap_threshold (int @var{$arg1}, int @var{$arg2}) This probe is triggered shortly after the @code{memory_mallopt} probe, when the parameter to be changed is @code{M_MMAP_THRESHOLD}, and the requested value is in an acceptable range. Argument @var{$arg1} is the requested value, @var{$arg2} is the previous value of this @code{malloc} -parameter, and @var{$arg3} is nonzero if dynamic threshold adjustment -was already disabled. +parameter. @end deftp -@deftp Probe memory_mallopt_mmap_max (int @var{$arg1}, int @var{$arg2}, int @var{$arg3}) +@deftp Probe memory_mallopt_mmap_max (int @var{$arg1}, int @var{$arg2}) This probe is triggered shortly after the @code{memory_mallopt} probe, when the parameter to be changed is @code{M_MMAP_MAX}. Argument @var{$arg1} is the requested value, @var{$arg2} is the previous value of -this @code{malloc} parameter, and @var{$arg3} is nonzero if dynamic -threshold adjustment was already disabled. +this @code{malloc} parameter. @end deftp @deftp Probe memory_mallopt_perturb (int @var{$arg1}, int @var{$arg2}) @@ -217,12 +213,6 @@ requested value, and @var{$arg2} is the previous value of this @code{malloc} parameter. @end deftp -@deftp Probe memory_mallopt_free_dyn_thresholds (int @var{$arg1}, int @var{$arg2}) -This probe is triggered when function @code{free} decides to adjust the -dynamic brk/mmap thresholds. Argument @var{$arg1} and @var{$arg2} are -the adjusted mmap and trim thresholds, respectively. -@end deftp - @deftp Probe memory_tunable_tcache_max_bytes (int @var{$arg1}, int @var{$arg2}) This probe is triggered when the @code{glibc.malloc.tcache_max} tunable is set. Argument @var{$arg1} is the requested value, and