From patchwork Mon Mar 18 15:03:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 1913160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=ftLIP2ZL; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=ftLIP2ZL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tyyn84RKfz23sG for ; Tue, 19 Mar 2024 02:04:28 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 923C53858C98 for ; Mon, 18 Mar 2024 15:04:26 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2047.outbound.protection.outlook.com [40.107.21.47]) by sourceware.org (Postfix) with ESMTPS id 323CE3858CD1 for ; Mon, 18 Mar 2024 15:03:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 323CE3858CD1 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 323CE3858CD1 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.21.47 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710774248; cv=pass; b=BTdFfEEb8WQH9QeEpr+RE5AME2dlGyp1NBeW0wJWve0vwVDwWy1ictPs6E/E/CmgmcTj8Sq1IpU/V2MNBOqeaCogOMtvuzcom41dmaJo8MXxUwsKeKw6kzbsoq8mTvGIiJPkqNqFJM4cve7rZDb3EYNR2mnHfhi+miOapep5B9M= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710774248; c=relaxed/simple; bh=3rqZIOqaArLyp9X0IhD/wkJpAAD4DQI1Py6/64LR3Uc=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=SE6hr2NidGMX+O/X9KEDtla178TnaxWvs87piadniij2L7dddu5RmHormffKPKfGj8w6SGYJoAVyMB7cVzwmE5/WqR125AvyS2c+2N/e8vgaNVA/7g+L+VPCwIghzMR+O21+Bxuw/Nn415OYN9NV5dw6BHSUsQl0XEE7NPMxCMo= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=VXnEz5hk7HjkT39h2c+iMrBLXpcv9QDvIDMqfTaG3kf3s8IRzd6SYdVuQvu63xvnab1FSRgRXy9YCMFHiBuT3RainanDeuXdprFPMwENNiVbbGbk7BI6b1qYh7oQHsffmlHEn6/4cY51oB8AG76KmtAbjS2Dn9qDKCMluTXCTpCzNDLyucdKFgbMTPCv5/AMQ5/B72nFeKNdGe5H3NM6jbVHjnTZOHRN6FJEAuYImxW8mjbii4f7L0D2eJJMHM3tvKdY4TlwuZl9r9VcROxb/6H8X3Pg1KE/xNTeukoaQciI/OH94IeJ6mPDdA9jKUSZTzXZCKUii2y6Aaopf7cuSA== ARC-Message-Signature: i=2; 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=AS1KiYJp5ohUww+azgP8/v6LrKNbyo9usZ8rJHfCwVc=; b=ePVSPtjZdohAEFFQFJtgcr0vX9Da1DUsOtv4rTgzwglinUFmiop3C9RlVvlKqCdmYrV+Joprpwq9pcuaikNn6Z4A42DWqL7y2qzp47HLora6E4pgxh4g8HFfhy9xb8AxZkYQmj5veqLEnHzYOxQaCITJijCrXKDBorJ0WWRfriGbH258RrjnbIhRaQ8N0NlJG+JDXjSM8LygT0dDpoWncgbiQNko5owQpc24ywZWe13dOvy/ZlcvAZc/P0GqTiGmIs/Kmf5WhtbE8z098GuOo6d1JW1vZ9rtGtB85f53wBw22eodzwIaHF65fVRLQjtzNgHQ4rUTpq/5N5uRRdjF2Q== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) 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=armh.onmicrosoft.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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AS1KiYJp5ohUww+azgP8/v6LrKNbyo9usZ8rJHfCwVc=; b=ftLIP2ZLagmnSsN8ZgMdFYf6jbheauPnR9wZ+kXdSwsA35D5oA25MRcQ0+GbNKnP4GBsY6HoTDJfBVxV+76jQL6DTAh1Y7PEH8uYVtgXfy0fOYI/8syTdKD73DjZMe57L0mI/mspP+8KYgVODzb/OsX1pzdR7mLSdPIdcxbihBo= Received: from DU7PR01CA0048.eurprd01.prod.exchangelabs.com (2603:10a6:10:50e::17) by DU5PR08MB10802.eurprd08.prod.outlook.com (2603:10a6:10:526::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26; Mon, 18 Mar 2024 15:03:51 +0000 Received: from DU2PEPF00028D0A.eurprd03.prod.outlook.com (2603:10a6:10:50e:cafe::b6) by DU7PR01CA0048.outlook.office365.com (2603:10a6:10:50e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.27 via Frontend Transport; Mon, 18 Mar 2024 15:03:51 +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 DU2PEPF00028D0A.mail.protection.outlook.com (10.167.242.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.10 via Frontend Transport; Mon, 18 Mar 2024 15:03:50 +0000 Received: ("Tessian outbound 9d16f63426bd:v300"); Mon, 18 Mar 2024 15:03:49 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2b6df60f72ce467d X-CR-MTA-TID: 64aa7808 Received: from 956e73676867.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9481C9AA-A3E2-4635-A0CD-DB1C65DCC270.1; Mon, 18 Mar 2024 15:03:44 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 956e73676867.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 18 Mar 2024 15:03:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AxMWKXujfJLlIZctf2setrRIpuNCp36Yjwunu46VyrsCFqWKEXA8ZGxm0w7s9pyhdr23M6E3mKcH/l1WwqbDMbQjw+V2S88X9qILUUKNIjnMoZEkcO+qPlr0k5vQ7wSZgdDpZ92dP7fx+hQqynbX+ByJGWnYBsPdlOECshYlXmtC0zMF+a1DA8pjGgDw8gJBMnHCFThsLuvyYCQMe3+pOyLfKyeoQGXZ0C9Y+FmXeVlr7EJYGTwVT+3cmFPCc78q/MgSTaomBTKK6VGF3RoigP1klMkY4tr9j/APXt2qgqUUIzFJ3BuzVuAxro+GhXcg+JBbyJN4iWfjU9o4b88rAA== 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=AS1KiYJp5ohUww+azgP8/v6LrKNbyo9usZ8rJHfCwVc=; b=AtByyAV5LVmaCV62zEkuuNUWMa0E+cGBSO5m/7prDFG2vnvte4XxjvWIzFMkKnU4X9RfHAqQ3MbxYEzB7CEmMeN76VXEmTNSVdGDg4HJEr7gF4C0Ln7xrpZruCmxr3DwC8ilu/XNvK4dORjC+5s7VsvkxSx29DDkv7c/JeBRq6yy3jgk/+K0R8nj0a495IgQCdSZCeIIwOWreefLFcxsmrogRP/QlsOgriIbR/xQhxEuKxOf1CTndotqbOeIjNtimlKdBX9zHHhsh+8q7tBzYTfzO57Ra74Pbowhh+RRt7hsEH7EiguGf92njiC+umezAejPpEyPzJQpcRf8keSGWA== 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=AS1KiYJp5ohUww+azgP8/v6LrKNbyo9usZ8rJHfCwVc=; b=ftLIP2ZLagmnSsN8ZgMdFYf6jbheauPnR9wZ+kXdSwsA35D5oA25MRcQ0+GbNKnP4GBsY6HoTDJfBVxV+76jQL6DTAh1Y7PEH8uYVtgXfy0fOYI/8syTdKD73DjZMe57L0mI/mspP+8KYgVODzb/OsX1pzdR7mLSdPIdcxbihBo= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by PAWPR08MB8934.eurprd08.prod.outlook.com (2603:10a6:102:33e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26; Mon, 18 Mar 2024 15:03:42 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::8b1b:5f28:5006:ac18]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::8b1b:5f28:5006:ac18%4]) with mapi id 15.20.7386.023; Mon, 18 Mar 2024 15:03:42 +0000 From: Wilco Dijkstra To: 'GNU C Library' Subject: [PATCH] Benchtests: Remove broken walk benchmarks Thread-Topic: [PATCH] Benchtests: Remove broken walk benchmarks Thread-Index: AQHaeUVZdgN1vhkzaUmOomUizrMEqw== Date: Mon, 18 Mar 2024 15:03:42 +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_|PAWPR08MB8934:EE_|DU2PEPF00028D0A:EE_|DU5PR08MB10802:EE_ X-MS-Office365-Filtering-Correlation-Id: cefd5880-6ad4-4fb2-73b4-08dc475c9e6b 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: OqrLPfQL9Dke34CBmMSCNzArU41YrpjvIK/ZowXbp0zWYnyvb3byCnVZ7XO3dc7UAaMtiLqQgkLavVsEjGGAjc6OMOKUzUOhD9qpf/fnAMsMQsqVLObzUcZmvq0hu0OeQMKX5IPB/sNQ7VoLXiRDLnFtHJFDU0r0qz1M+Wzismm+DCCXjgN6+s6qfCzhs5zc3MFJ5LWDj9o7OrUhklBw44MwQQH2bES3Lz37S3f1u+cqRzsLvnmlV7ByvKxvcQluHkgqwBqjCbpKEbSXNY9j4TTPlwrWYugPeSV78klx/yRqkZR/1mE5plyF1baXRXBQEo/h0F7wNLbEy17kpmbLvhGSfclK+sl4E5JKI/GfJ9fBOPLJeGA5VKYVOAHkx0i0Aa5dkaEpYv4CWdYN5LnNr33XcFAckXjFzwW4eRUWD3rhDtRmwIBpjhQXtIozroevd/SzsR/uKiNXFXfCq+3e56e+XLeQQs0t3Z7MyKB54CrHrJVg39Ttcp/PWbe3oY/6Qg/ZiY4xSKwi7XS0DnGWmX70V65qf/dTBKhYld+44+qQzCeXQ1KGICejxeL4icJ9PydGHOdTk4ToS6UL4X+RY9HStXHWr7b4OGxk+vODK1q2xNWBbn9SrwMRy0XOYr5CscsLM5TguprIr1SuB7LCXvlG2dN3lnzIPD7nNRo48X8= 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:(13230031)(366007)(376005)(1800799015)(38070700009); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB8934 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: DU2PEPF00028D0A.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2e3b3d82-ca7e-4c7b-ab1e-08dc475c99c8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fWleXSCO4NtRlop1qy0Vuo53173OdpZBlkBu/jAjUHrSZIFfAnFYulnpRHARVP1PtuzjBmSfGixjxJCmLefZLom/WhIscc9o0skol9CWPPcmkwvFeHdv4Ks1lAg9RfSxjM4BQqN50ltLilCNtRJezDmo1PqA/tNSlNfjzorzatFNkpX7Vzm+BvliMoTuGEDikG2b/B4WDPx+p1CrugpzIS/7WKuJ5uvyjYGY4XpAQ8hL+GUKcYzcDoOf7gdgAgl9ZHpVDyNk4BPVJ2/reZX0ZpiS6e46gy/ZAdnAbgpaQ9dsRc2fHVuhLxheIE/hrCwcvZoZz+OkBzKiMnST93HZmvJNJt6o5ht3MEPhmj9k1qOzuOr5xv/nZ5lxY7qgfY486dIrAZExJ+tcDpatKvBjoKn+YR9CnRb3uu1w/CIsFUZLFWD0XQmDQrBze+YQE6SsyOa9NjeRoVM3DqUW53Nqq/O/6Q1zNk2PFFv1kMeuqqRSAsMY23he3EiudUKj43Jd1nFPwKFDyrN39zaerh7kqTs+3S9BIeu36RwGF1wWJ6iD2KStLKGMTQRcc3YMMfweJCZGDcTldZNKzB59v8H1hXtOFdF2+FycUkUPCG7w+QtJUHtq6wdIMIDIHl6PNQsAMkWyRA/YQWa1M5bePB1qVnAeUHzzq1uXk9YYFyGI8o8zZVKRnwYP2ipMALqWaI9PlCcMj88SJmtPdGIX49n6sQ== 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:(13230031)(1800799015)(376005)(36860700004)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2024 15:03:50.0016 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cefd5880-6ad4-4fb2-73b4-08dc475c9e6b 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: DU2PEPF00028D0A.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU5PR08MB10802 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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+incoming=patchwork.ozlabs.org@sourceware.org The walk benchmarks don't measure anything useful - memory is not initialized properly so doing a single walk in 32MB just measures reading the 4KB zero page for reads and clear_page overhead for writes. The memset variants don't even manage to do a walk in the 32MB region due to using incorrect pointer increments... Neither is it clear why it is walking backwards since this won't confuse modern prefetchers. If you fix the benchmark and print the bandwidth, the results are identical for all sizes larger than ~1KB since it is just testing memory bandwidth of a single 32MB block. This case is already tested by the large benchmark, so overall it doesn't seem useful to keep these. OK for commit? diff --git a/benchtests/Makefile b/benchtests/Makefile index 05b8751c55e7eb862efef9d99421fbbf2f4febb2..76fa33535ef1b1cc4fa4f32ed4299ad7fbbcbf11 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -139,7 +139,6 @@ bench-string := \ string-benchset := \ bzero \ bzero-large \ - bzero-walk \ memccpy \ memchr \ memcmp \ @@ -147,19 +146,15 @@ string-benchset := \ memcpy \ memcpy-large \ memcpy-random \ - memcpy-walk \ memmem \ memmove \ memmove-large \ - memmove-walk \ mempcpy \ memrchr \ memset \ memset-large \ - memset-walk \ memset-zero \ memset-zero-large \ - memset-zero-walk \ rawmemchr \ stpcpy \ stpcpy_chk \ diff --git a/benchtests/bench-bzero-walk.c b/benchtests/bench-bzero-walk.c deleted file mode 100644 index 48df0d77c34f82435d2ffb963067dc8d9a81ff6f..0000000000000000000000000000000000000000 --- a/benchtests/bench-bzero-walk.c +++ /dev/null @@ -1,143 +0,0 @@ -/* Measure memset function throughput with large data sizes. - Copyright (C) 2017-2024 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_MAIN -#ifdef DO_MEMSET -# define TEST_NAME "memset" -#else -# define TEST_NAME "bzero" -#endif -#define START_SIZE 128 -#define MIN_PAGE_SIZE (getpagesize () + 32 * 1024 * 1024) -#define TIMEOUT (20 * 60) -#include "bench-string.h" - -#include "json-lib.h" - -#ifdef DO_MEMSET -void *generic_memset (void *, int, size_t); - -typedef void *(*proto_t) (void *, int, size_t); - -IMPL (memset, 1) -IMPL (generic_memset, 0) - -#else -static void -memset_zero (void * s, size_t len) -{ - memset (s, '\0', len); -} - -typedef void (*proto_t) (void *, size_t); - -IMPL (bzero, 1) -IMPL (memset_zero, 0) -#endif - -static void -do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s, CHAR *s_end, - size_t n) -{ - size_t i, iters = MIN_PAGE_SIZE / n; - timing_t start, stop, cur; - - TIMING_NOW (start); - for (i = 0; i < iters && s <= s_end; s_end -= n, i++) -#ifdef DO_MEMSET - CALL (impl, s, 0, n); -#else - CALL (impl, s, n); -#endif - TIMING_NOW (stop); - - TIMING_DIFF (cur, start, stop); - - /* Get time taken per function call. */ - json_element_double (json_ctx, (double) cur / i); -} - -static void -do_test (json_ctx_t *json_ctx, size_t len) -{ - json_element_object_begin (json_ctx); - json_attr_uint (json_ctx, "length", len); - json_array_begin (json_ctx, "timings"); - - FOR_EACH_IMPL (impl, 0) - { - do_one_test (json_ctx, impl, (CHAR *) buf1, - (CHAR *) buf1 + MIN_PAGE_SIZE - len, len); - alloc_bufs (); - } - - json_array_end (json_ctx); - json_element_object_end (json_ctx); -} - -int -test_main (void) -{ - json_ctx_t json_ctx; - size_t i; - - test_init (); - - 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_string (&json_ctx, "bench-variant", "walk"); - - json_array_begin (&json_ctx, "ifuncs"); - FOR_EACH_IMPL (impl, 0) - json_element_string (&json_ctx, impl->name); - json_array_end (&json_ctx); - - json_array_begin (&json_ctx, "results"); - for (i = 1; i <= 64; i++) - do_test (&json_ctx, i); - - for (i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) - { - do_test (&json_ctx, i); - do_test (&json_ctx, i + 1); - } - - json_array_end (&json_ctx); - json_attr_object_end (&json_ctx); - json_attr_object_end (&json_ctx); - json_document_end (&json_ctx); - - return ret; -} - -#include - -#ifdef DO_MEMSET -# define libc_hidden_builtin_def(X) -# define libc_hidden_def(X) -# define libc_hidden_weak(X) -# define weak_alias(X,Y) -# undef MEMSET -# define MEMSET generic_memset -# include -#endif diff --git a/benchtests/bench-memcpy-walk.c b/benchtests/bench-memcpy-walk.c deleted file mode 100644 index 661a40ccd1fe6a669f717319b676f60b39cb56af..0000000000000000000000000000000000000000 --- a/benchtests/bench-memcpy-walk.c +++ /dev/null @@ -1,131 +0,0 @@ -/* Measure memcpy function combined throughput for different alignments. - Copyright (C) 2017-2024 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 - . */ - -/* This microbenchmark measures the throughput of memcpy for various sizes from - 1 byte to 32MiB, doubling every iteration and then misaligning by 0-15 - bytes. The copies are done from source to destination and then back and the - source walks forward across the array and the destination walks backward by - one byte each, thus measuring misaligned accesses as well. The idea is to - avoid caching effects by copying a different string and far enough from each - other, walking in different directions so that we can measure prefetcher - efficiency (software or hardware) more closely than with a loop copying the - same data over and over, which eventually only gives us L1 cache - performance. */ - -#ifndef MEMCPY_RESULT -# define MEMCPY_RESULT(dst, len) dst -# define START_SIZE 128 -# define MIN_PAGE_SIZE (getpagesize () + 32 * 1024 * 1024) -# define TEST_MAIN -# define TEST_NAME "memcpy" -# define TIMEOUT (20 * 60) -# include "bench-string.h" - -IMPL (memcpy, 1) -#endif - -#include "json-lib.h" - -typedef char *(*proto_t) (char *, const char *, size_t); - -static void -do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, char *src, - size_t len) -{ - size_t i = 0; - timing_t start, stop, cur; - - char *dst_end = dst + MIN_PAGE_SIZE - len; - char *src_end = src + MIN_PAGE_SIZE - len; - - TIMING_NOW (start); - /* Copy the entire buffer backwards, LEN at a time. */ - for (; src_end >= src && dst_end >= dst; src_end -= len, dst_end -= len, i++) - CALL (impl, src_end, dst_end, len); - TIMING_NOW (stop); - - TIMING_DIFF (cur, start, stop); - - /* Get time taken per function call. */ - json_element_double (json_ctx, (double) cur / i); -} - -static void -do_test (json_ctx_t *json_ctx, size_t len, int both_ways) -{ - - char *s1, *s2; - size_t repeats; - s1 = (char *) (buf1); - s2 = (char *) (buf2); - - for (repeats = both_ways ? 2 : 1; repeats; --repeats) - { - json_element_object_begin (json_ctx); - json_attr_uint (json_ctx, "length", (double) len); - json_attr_uint (json_ctx, "dst > src", (double) (s2 > s1)); - json_array_begin (json_ctx, "timings"); - - FOR_EACH_IMPL (impl, 0) - do_one_test (json_ctx, impl, s2, s1, len); - - json_array_end (json_ctx); - json_element_object_end (json_ctx); - - s1 = (char *) (buf2); - s2 = (char *) (buf1); - } -} - -int -test_main (void) -{ - json_ctx_t json_ctx; - - test_init (); - - 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, "memcpy"); - json_attr_string (&json_ctx, "bench-variant", "walk"); - - json_array_begin (&json_ctx, "ifuncs"); - FOR_EACH_IMPL (impl, 0) - json_element_string (&json_ctx, impl->name); - json_array_end (&json_ctx); - - json_array_begin (&json_ctx, "results"); - for (size_t i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) - { - do_test (&json_ctx, i, 1); - do_test (&json_ctx, i + 1, 1); - } - - json_array_end (&json_ctx); - json_attr_object_end (&json_ctx); - json_attr_object_end (&json_ctx); - json_document_end (&json_ctx); - - return ret; -} - -#include diff --git a/benchtests/bench-memmove-walk.c b/benchtests/bench-memmove-walk.c deleted file mode 100644 index 94b394eb8b22c1d82490002061a4eae469e29dbd..0000000000000000000000000000000000000000 --- a/benchtests/bench-memmove-walk.c +++ /dev/null @@ -1,160 +0,0 @@ -/* Measure memmove function combined throughput for different alignments. - Copyright (C) 2017-2024 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 - . */ - -/* This microbenchmark measures the throughput of memmove for various sizes from - 1 byte to 32MiB, doubling every iteration and then misaligning by 0-15 - bytes. The copies are done from source to destination and then back and the - source walks forward across the array and the destination walks backward by - one byte each, thus measuring misaligned accesses as well. The idea is to - avoid caching effects by copying a different string and far enough from each - other, walking in different directions so that we can measure prefetcher - efficiency (software or hardware) more closely than with a loop copying the - same data over and over, which eventually only gives us L1 cache - performance. */ - -#ifndef MEMMOVE_RESULT -# define MEMMOVE_RESULT(dst, len) dst -# define START_SIZE 128 -# define MIN_PAGE_SIZE (getpagesize () + 32 * 1024 * 1024) -# define TEST_MAIN -# define TEST_NAME "memmove" -# define TIMEOUT (20 * 60) -# include "bench-string.h" - -#define NO_OVERLAP 0 -#define PARTIAL_OVERLAP 1 -#define COMPLETE_OVERLAP 2 - -IMPL (memmove, 1) -#endif - -#include "json-lib.h" - -typedef char *(*proto_t) (char *, const char *, size_t); - -static void -do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, char *src, - size_t len) -{ - size_t i = 0; - timing_t start, stop, cur; - - char *dst_end = dst + MIN_PAGE_SIZE - len; - char *src_end = src + MIN_PAGE_SIZE - len; - - TIMING_NOW (start); - /* Copy the entire buffer backwards, LEN at a time. */ - for (; src_end >= src && dst <= dst_end; dst += len, src_end -= len, i++) - CALL (impl, dst, src_end, len); - TIMING_NOW (stop); - - TIMING_DIFF (cur, start, stop); - - /* Get time taken per function call. */ - json_element_double (json_ctx, (double) cur / i); -} - -static void -do_test (json_ctx_t *json_ctx, size_t len, int overlap, int both_ways) -{ - char *s1, *s2, *tmp; - size_t repeats; - - s1 = (char *) (buf1); - s2 = (char *) (buf2); - if (overlap != NO_OVERLAP) - s2 = s1; - if (overlap == PARTIAL_OVERLAP) - s2 += len / 2; - - for (repeats = both_ways ? 2 : 1; repeats; --repeats) - { - json_element_object_begin (json_ctx); - json_attr_uint (json_ctx, "length", (double) len); - json_attr_string(json_ctx, "overlap", - overlap == NO_OVERLAP ? "none" - : overlap == PARTIAL_OVERLAP ? "partial" - : "complete"); - json_attr_uint (json_ctx, "dst > src", (double) (s2 > s1)); - json_array_begin (json_ctx, "timings"); - - - FOR_EACH_IMPL (impl, 0) - do_one_test (json_ctx, impl, (char *) buf2, (char *) buf1, len); - - json_array_end (json_ctx); - json_element_object_end (json_ctx); - - tmp = s1; - s1 = s2; - s2 = tmp; - } -} - -int -test_main (void) -{ - json_ctx_t json_ctx; - - test_init (); - - 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, "memmove"); - json_attr_string (&json_ctx, "bench-variant", "walk"); - - json_array_begin (&json_ctx, "ifuncs"); - FOR_EACH_IMPL (impl, 0) - json_element_string (&json_ctx, impl->name); - json_array_end (&json_ctx); - - json_array_begin (&json_ctx, "results"); - /* Non-overlapping buffers. */ - for (size_t i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) - { - do_test (&json_ctx, i, NO_OVERLAP, 1); - do_test (&json_ctx, i + 1, NO_OVERLAP, 1); - } - - /* Partially-overlapping buffers. */ - for (size_t i = START_SIZE; i <= MIN_PAGE_SIZE / 2; i <<= 1) - { - do_test (&json_ctx, i, PARTIAL_OVERLAP, 1); - do_test (&json_ctx, i + 1, PARTIAL_OVERLAP, 1); - } - - /* Complete-overlapping buffers. */ - for (size_t i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) - { - do_test (&json_ctx, i, COMPLETE_OVERLAP, 0); - do_test (&json_ctx, i + 1, COMPLETE_OVERLAP, 0); - } - - json_array_end (&json_ctx); - json_attr_object_end (&json_ctx); - json_attr_object_end (&json_ctx); - json_document_end (&json_ctx); - - return ret; -} - -#include diff --git a/benchtests/bench-memset-walk.c b/benchtests/bench-memset-walk.c deleted file mode 100644 index 7be904a4507db60b5fc46dee03f5a681da960de5..0000000000000000000000000000000000000000 --- a/benchtests/bench-memset-walk.c +++ /dev/null @@ -1,122 +0,0 @@ -/* Measure memset function throughput with large data sizes. - Copyright (C) 2017-2024 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_MAIN -#define TEST_NAME "memset" -#define START_SIZE 128 -#define MIN_PAGE_SIZE (getpagesize () + 32 * 1024 * 1024) -#define TIMEOUT (20 * 60) -#include "bench-string.h" - -#include "json-lib.h" - -void *generic_memset (void *, int, size_t); -typedef void *(*proto_t) (void *, int, size_t); - -IMPL (MEMSET, 1) -IMPL (generic_memset, 0) - -static void -do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s, CHAR *s_end, - int c __attribute ((unused)), size_t n) -{ - size_t i, iters = MIN_PAGE_SIZE / n; - timing_t start, stop, cur; - - TIMING_NOW (start); - for (i = 0; i < iters && s <= s_end; s_end -= n, i++) - CALL (impl, s, c, n); - TIMING_NOW (stop); - - TIMING_DIFF (cur, start, stop); - - /* Get time taken per function call. */ - json_element_double (json_ctx, (double) cur / i); -} - -static void -do_test (json_ctx_t *json_ctx, int c, size_t len) -{ - json_element_object_begin (json_ctx); - json_attr_uint (json_ctx, "length", len); - json_attr_uint (json_ctx, "char", c); - json_array_begin (json_ctx, "timings"); - - FOR_EACH_IMPL (impl, 0) - { - do_one_test (json_ctx, impl, (CHAR *) buf1, - (CHAR *) buf1 + MIN_PAGE_SIZE - len, c, len); - alloc_bufs (); - } - - json_array_end (json_ctx); - json_element_object_end (json_ctx); -} - -int -test_main (void) -{ - json_ctx_t json_ctx; - size_t i; - - test_init (); - - 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_string (&json_ctx, "bench-variant", "walk"); - - json_array_begin (&json_ctx, "ifuncs"); - FOR_EACH_IMPL (impl, 0) - json_element_string (&json_ctx, impl->name); - json_array_end (&json_ctx); - - json_array_begin (&json_ctx, "results"); - for (i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) - { - do_test (&json_ctx, 65, i); - do_test (&json_ctx, 65, i + 1); - } - - for (i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) - { - do_test (&json_ctx, 0, i); - do_test (&json_ctx, 0, i + 1); - } - - json_array_end (&json_ctx); - json_attr_object_end (&json_ctx); - json_attr_object_end (&json_ctx); - json_document_end (&json_ctx); - - return ret; -} - -#include - -#define libc_hidden_builtin_def(X) -#define libc_hidden_def(X) -#define libc_hidden_weak(X) -#define weak_alias(X,Y) -#undef MEMSET -#define MEMSET generic_memset -#include diff --git a/benchtests/bench-memset-zero-walk.c b/benchtests/bench-memset-zero-walk.c deleted file mode 100644 index 200a17f128f08cf18cddb2b31c331dc9cad3899c..0000000000000000000000000000000000000000 --- a/benchtests/bench-memset-zero-walk.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Measure memset functions for zeroing throughput with large data sizes. - Copyright (C) 2022-2024 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 DO_MEMSET 1 -#include "bench-bzero-walk.c"