From patchwork Fri May 9 11:02:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cupertino Miranda X-Patchwork-Id: 111837 Return-Path: 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 D5B933857C58 for ; Fri, 9 May 2025 11:03:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5B933857C58 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2025-04-25 header.b=MR63hSbc; dkim=pass (1024-bit key, unprotected) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com header.b=OYnvDPKK X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 56A683858289 for ; Fri, 9 May 2025 11:02:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 56A683858289 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 56A683858289 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1746788559; cv=pass; b=obG/mcHDJ0I1uyE1odP+iO/N9qkjXnWemKYo0iwN2vOqFZoSJf8sFut/Y3gQW19B7eXu9uoLCTTTdmSnjiyp0Yws83ShuQrCs3ZUBiP12gcIcMLoMfj639Ua6+aR9m3RvTMRgiwzyEg1yArHIoVSdMM/eGhCWx1bz7rRe+Zvyko= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1746788559; c=relaxed/simple; bh=6c4xBkMf045ROqTnx7DgqeTIBe24Jr5XaEU2WfngSng=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=i0bwmau282lX0mgkuHm7OfbIUp+5kNN0hI2lq/UmzJrOAs2gC2tt4WlHooj7CRA/SXUrFW2P5tnQeDa92EaMHpJmRHsw0WeymMJja9REWn8+JRsjxjROIiEOgF4gBqrFU0bIPvdJ5X8WWoIkoje5g+MVZe4Dyx+i/zYQDtyCevg= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56A683858289 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 549AcDQl025751; Fri, 9 May 2025 11:02:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=corp-2025-04-25; bh=94jHA0L53yOsWJmT xq1N+5gfQlg+7dLnXKKU72NXhv0=; b=MR63hSbcFFR1xKhlS8mOi+V2mbIrMiqt Ul8CHrxIvM7y2WvCgz3VFS1jLunFQY9K8j7yRjoQNa3DdvURAUqa/LNNPKih++Ha VQfnL4czfX8uki/i2eJRhd4DZsvW/kSWHb8sDvlDdfUQIJPsmm6dU994MvK8OArN wxs+PDxyfxVM8tUrJYLvov83kjtWsNcXUL6XSUTlYwePdURu4UVyTPGotID9HHn6 roUW78KgGEQaD68dN4Jz42x8EJe3+ktzKpaw3w+yhQkV5y4TfN1WZNqXRl0fCU6U M/zDT9gsye1mlEB08EiuRz3ymeKHR9ULRjkYTDTJa6fx4cG9/6MeQw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 46hg3xg1c8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 May 2025 11:02:35 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 549Aqotm035995; Fri, 9 May 2025 11:02:33 GMT Received: from sj2pr03cu002.outbound.protection.outlook.com (mail-westusazlp17013077.outbound.protection.outlook.com [40.93.1.77]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 46d9kdm0n0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 May 2025 11:02:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cIIIIS3dUtw82AnEKPU5eWjBck+rTyUXqhLYY8eUtuOvCyG1083o4xuCBT2+bkm94mgqyWMaX6e8PYbepHjnsFKQ3X1JfGoYciyFCldrxOb/7BFbCbmpml2QxFp7+EPXxwySsxus/yH5A8NVXyFJPqtj82HhKC7Vjjl0us0ObvLhHGZei91w625OweKJP3nL0DQ3B/Rqn3E8UmTGXMbgIFbyot9N9PsIybHoL5J0IYTegM8YEB5euIPET6w1/T2FnppC1NLTHz1b+c4i0ydRWziQLUKvr6kc0CJiAuMhFZAUecvlbYRAN9bKUwdxnFSPAvxC0B+NQbZyW3rNBspNlw== 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=94jHA0L53yOsWJmTxq1N+5gfQlg+7dLnXKKU72NXhv0=; b=WEgf8ZsFwKUV6wP6rTDKsik37KdFiC+FIR/Pes4bnx+01PpuyY7By+L6JqcutdfeDMnfR8XGVIg2qkOAyQWnQ8CcUS9+vNXviULS9wJz43NXgS4VBHmD5sp1/+H24TznFCQ1l9ZD6y0CDc2va4gNhayvYeQHUaFiM9PNYq+oFEOuQWRl/PWuvY0YO37zvUVpzRLViDJbVGc13lG3Hu4wOOet6QO+xAQ8YWZbj6uAHQBpKMRChXKQw4HAdccMsYMGTb5V3wuW96Ldm9oCl9pE9SV/NzK8IDnl/4amLUMCPckrU2I/OsoDumICuWJGWmF2fDTmVzLWvPryL0V/O3sbaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=94jHA0L53yOsWJmTxq1N+5gfQlg+7dLnXKKU72NXhv0=; b=OYnvDPKKUN70vW2ZCJUyYytVON6NtrGQOGyRpoxdazGT8M8kiGYBzFv0dwUAumKxLLGvRsqpOCWgthj3G0pxwf7XQEoZVwHJd7Yx3pE4gc3YziplYOWbs0udMNJ+v2xHvcQGwQquom8sJfsz2CUtMgMI59CNAeH7qR4gREBmH8g= Received: from MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) by BN0PR10MB4886.namprd10.prod.outlook.com (2603:10b6:408:114::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8722.25; Fri, 9 May 2025 11:02:30 +0000 Received: from MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::5033:84a3:f348:fefb]) by MN2PR10MB4382.namprd10.prod.outlook.com ([fe80::5033:84a3:f348:fefb%4]) with mapi id 15.20.8722.024; Fri, 9 May 2025 11:02:30 +0000 From: Cupertino Miranda To: libc-alpha@sourceware.org Cc: jose.marchesi@oracle.com, elena.zannoni@oracle.com, Wilco.Dijkstra@arm.com, dj@redhat.com, Cupertino Miranda Subject: [PATCH v4] benchtest: malloc tcache hotpath benchtest. Date: Fri, 9 May 2025 12:02:22 +0100 Message-Id: <20250509110222.48664-1-cupertino.miranda@oracle.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: AS4P195CA0018.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5d6::15) To MN2PR10MB4382.namprd10.prod.outlook.com (2603:10b6:208:1d7::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR10MB4382:EE_|BN0PR10MB4886:EE_ X-MS-Office365-Filtering-Correlation-Id: ddafe400-b93b-4a3a-72c0-08dd8ee8fe11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|366016|13003099007; X-Microsoft-Antispam-Message-Info: kytYZVtrm2RLhPKYKdOlS/iRpiXVT0NgPoH66gpeBHXIQK7VakymRPaKrT8cRr1aTFaNUormQeND6b9hrn7DpmLn87DXzEUgmgg3JzMFBENT+ksZpxa2hkCi2mTilkE0zsi7zOhmYqARxLHEFVM9k9VjggOMjO1i3Su6H5BYBGlS+7VlQrnXedfjQvgWvQmMCmp/ZFa8L0LRbyBJ48tgi4JcfXZhdiwGefQCw2WfhC0GONf5BCBPgEZsMXi76OXstDSp9cIInhJcz/bRxlh3S4T/hZYTQhbxjoA1wewKz1u0wK7/aJbdzd4hhjjJQ5+7BuyM+bjwXYhIijVfnseuYBVsB7UXZpl/6rwGGAePfD+9YKMu7vRn6tm+qterWEcRfLar1TzgFAfWWirDFSMxQs01ASpBne3LE93uO8TpFw2Xu2KgO3u4lgtkt1ZduLdRy7/h4Xl/cBI7PKLuJL4kmCSsxWtJb0K1FG++kOAG3r7clQvglTU8jPJohynt++qYL+qKUXlc0GmSp/oFcfaSq8S7jJJ3zKtEOx5+KItOr1N9o4HiUofzwHbXxsar+dNANPQ5wFyd3wESfF0OUYN1iEdSGagZzesNGPpZ+NAuJ3n9ThSsDNwBs8paSPGuBDYiiU/e0hmyV7/oiH310I9AOX71mDLFYAMfmEAbCQYPNQ2D5vAnJUwdSsEHKKL1l9WDXuZJJZM7kFHouOCOX8ys7XUXWQrYuBcLYW23huSEQDiQclmY70K2SkHK7QZ8TNtcvaatUpZHhyu+5Hp7QDjyEQwSOs4GLrnSoEmt1rHIbUnuBS7LwhOjQu4ZdTdDNzvJzC5MSnYS7wimehHdn0nFMpaEmVZkgLXvgZ90NIjo1WQBDtZDXuTw31lCbMPpolhT55hTOqlugRN0aGMr8vtotP5CWvXxj9f/rskHS+tQxCNKKnmvpPO1X7bsgIhD1kWE3G0NBUCIj1g3GGD0pC0WW/7E0w8J+uMF/J+Hnrp/FEC60E0n8DXl4VlVU43aNxGjNM5+u7ZE284g/btm+RisSNm4yVCcdMA/eF/+HPI/+u/2v9sZYgR4aarwNwd/NxEREe4+kJCSF2biWbvdIuHYe4slLVs6gGdT0veGt3t1bWAwM9oH+aktSbrJ0wCYMUP+jCOmkkyp2950JwfvoLe+I8b6VxbbIfF828rYeoNEOiCv86ehMoXYzIOjCipm/MTwsU6tx252Hlg/kdSapew6p8V7BYHo8S9jRHhRW7eEAO3dJC1VhadoaTtQaDFcuX2iGxbVsjIGYYYINr+tF4kxrcD//dNcTW+FqTyDK6u9vH7W5N3P45CZ2S/EtOkeoFNqCpfV0zhU57gxDsaMOdosGyI7H95y5VgbnQqSuqyt4arnrzfsdui26haxrZtx5xjhtioGYK3QB3Q19GATQ/GeNUyU6DJaJoQMnNDx3tU2piQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4382.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(13003099007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7afOWu5Vrh/AnCC8AyOlYvKJuFnCbs3KXwY9UJsPWzlqQJ9mLhcgXnfKvcY6TpQii5U3z7HIXOBBlTNtyAMGN5Ry6DJ/Y88k3jTWNr7FRYcP3lNLth3ZCklC9/IrTpfx2JtcO2dEaZa72wJ9RXxUziABOu/iDUb/dtVhCUB2oeI6t1gOaAAR75g8fJmFabc3RpKzqb8KcdoOe8vjf4JcWVb2nsOQEesotHGOrf2qaE47M8RIX/disHhVGHwRjR7WcQMLrAxNdbG9lymk8baZmyKPqTruF3dpDwp7E9UXkygxA2iAYMvPB/61UW1uvZ4AzFUS+EuMQ9FQ17JPX9f0hk+e036IzSsOZKOvveTuVuQUxCtmKd3gPRtjmMPnshO1zBtuOfQQLRrLyRxV7yF5tdJUpvLwE5ml4aPqGYbDNDu7gER6grk0EgM86wOTxudEJ1VgHBD3F6MPIahDG/sPY8eZZNGnwcD5B6ZCzrEpdlU/+FbZWHKTs6C5OJ/YuBg/gzybKZxphewvmFtDrn7HYJuGAjUTuiyx5iJjv9W8iigLhCjLMmHvzZUUzu3IFBtKeB4mNGGntL9nI4uoHJcWL4bSTKuh2D+TbiFUVtaVDwNjGQl2QJLa+zkqg88Xlj+bN5NQL/bPWuqLlRYKS8catsj6WEi5/xqvFRsdcnghWfA0Lqhp2P6iPUen0MbNNyT9GgCrEm4pCc1A6SdjpQ56C+N3v9Dd5ZKZRu3eIAYbZ36p2D53ZEIPlydX8sEX+Wl56CqJC3NHsafu87KJihp/jGe0n5jlI2vPnIW9DEHX+nZps9jdmGsk/4O3zx+HIz/Mzhs0Kra2cAQYrIbxDoo8ticY8KtqM/DiPLAmbhRlQQNhDUikGFxBIMTrXpyKVUdXPKBKFTKttBHufRkoOZcMyl5czWBe2vwrD4CNyXvb7Y5gOzoOkYK4BLu8PYgt2LgCFj69vhermqlPL/qXwrFyqQt6uF28givqS+81vrYZhx1HFAgNyH0xOhER014wMWk2TZBOIvdmgdea+UUmzH/X69IJphKB+FttZ+uIDH7fgZzJTDARmwxwvIxsF3j/cZgEG9SgNGlbF6J46IMzDtyajmBVTBO+WiTgPU5TRs7ijGNc1NzTpurQbtV/yRxcD/VE+P44O0q5QjgQSiTMPNufNOqJ76Z3cg+ND7UYWV752Lnfj6kgmefyVjazQ79/jeT4muTwiEsQhciWT5Tx8vC6Tn15ZKHnXoUJdf/CWG5osDMKTDnuwOPnYEFJvYqJawHExylD5iaWuvAcGYFHReQxalnGOIM4Yh+l78+ARMyYt22nOfARf65qR6lwxTpTLc5lTWgGf+B+WufCL3eC17ZbdIrA+STt58k6S8I6h3bns6btdoP3cr7rwGAOveu7OcQ7ZZvREdR+i/JDCLud+h9ZoEHeKrmkShz2kcglr+LZhtMIXCsAG+WaVvA2G0iNiK3s08xSvwl99k8gzuXfpGNQzgBgsB0S5As1SDb4UrfOsfzcuQiLY3hazB0dIiZbnxrXeL5FgSaj0XwQfc6+I6E7rPfUnh0IYxGyII451hsLW8jS8AKZBab2VoV+DwERlx92C79D7TmAitdytqbH7ld4yw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: AFzlgP6Bzvj5mtXtm8wDECntmysn5y0Q8d1E6QbJcYRgca/s9PG2Db7D9Yyuzjb+iOm8WENktPIFCjLdc1E6oth9xYmAa5jIySrYHDB2nmP4lDAw04pp2KYXmb/PU2zmRB3F2oU3sxavYxjnI2nEgS7XXAjND+77dPG+TZTKFLs7Z/XLaWE7b6wBZaXOjVHDy4cddlghO2pytjU1QH6TjeVCEJKzGdW3L9Y85qfu7ZeYSY1pss1zgWttEDFNoZoRYHuvdFHh+lxAi0jXXA4W2aU1nm3gLrlB2a4DY25+995H+aavuvMlfPzDbLL6HHesZuPCqjHNwFkkLeahJO8foVbvHixw/+uQqrLimMaP/yP7c3cCqiBZKWdgxkmQjh6oKdRTVIuTCZ9uLF5V+e36ALP0O7rGfLydXTbQz37sqrMT/w0ZjsGdq7NSBWz5YECQRE9eJ2DH7SSX+ojfi3DfqOru7I5Q+cqU9KvwE04f1Vt80KL/dAc9THhhTDR3QO2X2S+rH6jYK6X7duIIFLSklm0h7/Se6Perq3WRDjHe4t7yVcIMttPfZTdOfb/+zAMvAYUQQvIFkQV4XpX/YKtm0vM2ayrZMxGn/3nSyH/DFVA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddafe400-b93b-4a3a-72c0-08dd8ee8fe11 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4382.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2025 11:02:30.7081 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UthlLuLnbeCYxcqadQQtpsgFGYVbVK8mFIFbd62V3+qS41FgDALH3KfrxZUbOCKxaFvO9/b3cctfnbEoGZalZ7Ks0DS5DESvLA623n8e6Gw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB4886 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-09_04,2025-05-08_04,2025-02-21_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2504070000 definitions=main-2505090106 X-Proofpoint-GUID: q3DLTCPryv3R33cQ6cA-Qmvfq3wr6YOT X-Authority-Analysis: v=2.4 cv=aelhnQot c=1 sm=1 tr=0 ts=681de0cb cx=c_pps a=OOZaFjgC48PWsiFpTAqLcw==:117 a=OOZaFjgC48PWsiFpTAqLcw==:17 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=dt9VzEwgFbYA:10 a=GoEa3M9JfhUA:10 a=mDV3o1hIAAAA:8 a=_jsDTZbLsUNdneBVyFgA:9 a=br55WurUj89AL1qEz8Q6:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTA5MDEwNiBTYWx0ZWRfX1eUflSEEm3Rc p3td3AbMwkGv3WsjAM/hRBPOqqtWGQcFLrGRD1UQ1RJhkdU536Z0UY9pGyT8jKvR/gWAr40M1H0 vTyPQisnnMb5Hg4hfl/IrjcvfiRGwx8Gr43Cap8lTJQzEqAVHHBRIeqUxl4v9i9l0QLuMmgYfzK r1zDiVri9L2YjpDN25/ZA+Cxz6ga91QekxWIW43pTYb2lQwvbfeo5z/AjHCcWYUV4yNzBf95qX2 vk3vQ/6jhIz8zT6Q5Rl6dat+tB6c5gGA8dWmNlpY0RBtkO4RB405S7Pv1zxW1tykP101k/Eb27R 48npic3QXP651MOwPwLPBHquuKzLNxRXSc2PlVUPJFoP+jdM+oYMPTsAR/CODHW1sp/Y1/Yms0u dMu5T6U/mpgo4cJsZaJEJzNwg48+BIf8DqpLCMackhjTaQWw2O922Lye596SOJVnZ5nRc5bU X-Proofpoint-ORIG-GUID: q3DLTCPryv3R33cQ6cA-Qmvfq3wr6YOT X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Hi everyone, New version with multiple small fixes. I noticed that there was an unexpected performance loss when alloc_size was 1024. While exploring I notice that for alloc_size 1016 I get: "time_per_iteration": 14.3453 and for 1017: "time_per_iteration": 16.3697. Could this be related to CPU cache effects? No idea! Values seem quiet stable both below/above alloc_size 1016/1017, respectively. Looking forward to your review. Cheers, Cupertino Changes from v1: - Changed block size randomizer to get proper distribution of allocations. - Drop pre-filling of tcaches. Changes from v2: - Simplified test to focus on performance of tcache hotpaths, ignoring any RSS measurements. Changes from v3: - Added call to bench_start to ramp up cpu. - Do a preload allocation and free to avoid measuring non tcache paths. Existing benchtests for malloc infrastructure seem to be rather generic to test global malloc implementation performance. This new benchtest focus on reducing any non tcache related side effects, allowing to more realistically predict performance impacts of tcache code changes. The test was inpired in bench-[cm]alloc-thread code, with severe simplifications: - forces single thread execution, reducing concurrency side-effects, like cache incoherence penalties due simultaneous writes to the same cache pages; - Focus on allocating and deallocating a single size for all the duration of the benchmark. Since all it does is allocate and deallocate, it will measure the tcache hotpath without any side-effects. - Allows to specify the allocation size as input argument. --- benchtests/Makefile | 9 ++ benchtests/bench-calloc-tcache.c | 22 +++++ benchtests/bench-malloc-tcache.c | 157 +++++++++++++++++++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 benchtests/bench-calloc-tcache.c create mode 100644 benchtests/bench-malloc-tcache.c diff --git a/benchtests/Makefile b/benchtests/Makefile index 74142da326..d4d2be0fde 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -329,8 +329,10 @@ ifeq (${BENCHSET},) bench-malloc := \ calloc-simple \ calloc-thread \ + calloc-tcache \ malloc-simple \ malloc-thread \ + malloc-tcache \ # bench-malloc else bench-malloc := $(filter malloc-%,${BENCHSET}) @@ -453,9 +455,11 @@ VALIDBENCHSETNAMES := \ bench-string \ calloc-simple \ calloc-thread \ + calloc-tcache \ hash-benchset \ malloc-simple \ malloc-thread \ + malloc-tcache \ math-benchset \ stdio-benchset \ stdio-common-benchset \ @@ -498,6 +502,11 @@ bench-malloc: $(binaries-bench-malloc) echo "Running $${run} $${thr}"; \ $(run-bench) $${thr} > $${run}-$${thr}.out; \ done;\ + elif basename $${run} | grep -q "bench-[cm]alloc-tcache"; then \ + for thr in 64 512 1024; do \ + echo "Running $${run} $${thr}"; \ + $(run-bench) $${thr} > $${run}-$${thr}.out; \ + done;\ else \ for thr in 8 16 32 64 128 256 512 1024 2048 4096; do \ echo "Running $${run} $${thr}"; \ diff --git a/benchtests/bench-calloc-tcache.c b/benchtests/bench-calloc-tcache.c new file mode 100644 index 0000000000..5303f872b8 --- /dev/null +++ b/benchtests/bench-calloc-tcache.c @@ -0,0 +1,22 @@ +/* Benchmark calloc and free functions. + Copyright (C) 2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define TEST_FUNC(size) calloc (1, size) +#define TEST_NAME "calloc" + +#include "bench-malloc-tcache.c" diff --git a/benchtests/bench-malloc-tcache.c b/benchtests/bench-malloc-tcache.c new file mode 100644 index 0000000000..43633f3ee2 --- /dev/null +++ b/benchtests/bench-malloc-tcache.c @@ -0,0 +1,157 @@ +/* Benchmark tcache hotpath allocations. + Copyright (C) 2013-2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef TEST_FUNC +# define TEST_FUNC(size) malloc(size) +# define TEST_NAME "malloc" +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include "bench-util.h" +#include "bench-util.c" +#include "bench-timing.h" +#include "json-lib.h" + +/* Benchmark duration in seconds. */ +#define BENCHMARK_DURATION 3 + +static volatile bool timeout; +size_t alloc_size; + +static void +alarm_handler (int signum) +{ + timeout = true; +} + +/* Allocate and free blocks in a random order. */ +static size_t +malloc_benchmark_loop (void *elem) +{ + size_t iters = 0; + while (!timeout) + { + elem = TEST_FUNC (alloc_size); + free (elem); + iters++; + } + + return iters; +} + +static timing_t +do_benchmark (size_t *iters) +{ + timing_t elapsed = 0; + timing_t start, stop; + void *elem = NULL; + + /* Ramp up cpu before measuring. */ + bench_start (); + + /* Preload tcache not to measure non tcache allocation time. */ + elem = TEST_FUNC (alloc_size); + free (elem); + + TIMING_NOW (start); + *iters = malloc_benchmark_loop (elem); + TIMING_NOW (stop); + + TIMING_DIFF (elapsed, start, stop); + + return elapsed; +} + +static void usage (const char *name) +{ + fprintf (stderr, "%s: \n", name); + exit (1); +} + +int +main (int argc, char **argv) +{ + timing_t cur; + size_t iters = 0; + json_ctx_t json_ctx; + double d_total_s, d_total_i; + struct sigaction act; + + if (argc == 1) + alloc_size = 1024; + else if (argc == 2) + { + long ret; + + errno = 0; + ret = strtol (argv[1], NULL, 10); + + if (errno || ret == 0) + usage (argv[0]); + + alloc_size = ret; + } + else + usage (argv[0]); + + json_init (&json_ctx, 0, stdout); + + json_document_begin (&json_ctx); + + json_attr_string (&json_ctx, "timing_type", TIMING_TYPE); + + json_attr_object_begin (&json_ctx, "functions"); + + json_attr_object_begin (&json_ctx, TEST_NAME); + + json_attr_object_begin (&json_ctx, ""); + + memset (&act, 0, sizeof (act)); + act.sa_handler = &alarm_handler; + + sigaction (SIGALRM, &act, NULL); + + alarm (BENCHMARK_DURATION); + + cur = do_benchmark (&iters); + + d_total_s = cur; + d_total_i = iters; + + json_attr_double (&json_ctx, "alloc_size", alloc_size); + json_attr_double (&json_ctx, "duration", d_total_s); + json_attr_double (&json_ctx, "iterations", d_total_i); + json_attr_double (&json_ctx, "time_per_iteration", d_total_s / d_total_i); + + json_attr_object_end (&json_ctx); + + json_attr_object_end (&json_ctx); + + json_attr_object_end (&json_ctx); + + json_document_end (&json_ctx); + + return 0; +}