Message ID | 57b96253346fe679c82b7f88e2398ec21553b52c.1616155129.git.szabolcs.nagy@arm.com |
---|---|
State | New |
Headers | show
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=EJ+TZ+pO; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F24TP3SpNz9s1l for <incoming@patchwork.ozlabs.org>; Sat, 20 Mar 2021 00:28:09 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 30E54386F457; Fri, 19 Mar 2021 13:28:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30E54386F457 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616160487; bh=6Y7WKWafDXkhASTua4V1RJ9vQV85q2KqQ0RQ1Ddr81E=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=EJ+TZ+pO7tD9HRYbsUOrhz2h5y9Q8OJsvLwu7H+UNi4d5wPKR51lXEDTTENJDRf0o THrmkRu8gMS/aj3W/Uz6N2nReksdTA4lbp9OYHXDbs6v1pB9Gh1xrdf3dOCo/LDKVe x4h+np8yblYboDGcEWCYOHKUWlcUs28z1/5lNpuU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2045.outbound.protection.outlook.com [40.107.20.45]) by sourceware.org (Postfix) with ESMTPS id 10246385142A for <libc-alpha@sourceware.org>; Fri, 19 Mar 2021 13:28:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 10246385142A Received: from AM5PR0701CA0023.eurprd07.prod.outlook.com (2603:10a6:203:51::33) by AM9PR08MB6771.eurprd08.prod.outlook.com (2603:10a6:20b:30b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Fri, 19 Mar 2021 13:28:03 +0000 Received: from VE1EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:51:cafe::c3) by AM5PR0701CA0023.outlook.office365.com (2603:10a6:203:51::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.10 via Frontend Transport; Fri, 19 Mar 2021 13:28:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT048.mail.protection.outlook.com (10.152.19.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Fri, 19 Mar 2021 13:28:03 +0000 Received: ("Tessian outbound 04b74cf98e3c:v87"); Fri, 19 Mar 2021 13:28:02 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b41267de04082e50 X-CR-MTA-TID: 64aa7808 Received: from 33d5756778d6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8A1E3650-FB3F-4688-BE8F-78CD05AEE5AA.1; Fri, 19 Mar 2021 13:27:52 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 33d5756778d6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 Mar 2021 13:27:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5n8Gz0N6UO3MY6FfU8vHC+84XOXJXf7FIg8IWSP2kFMh1rFv7yJTvxHKQ6L2IhJB/taY9tnGBiOolml4xrAXHQrraci5A7C35RgMCon6S2wkYIr0mbNqy5bIvoEXon8oJT+gHU+bcd2h3JQ4Y96Vw1NwVcq2M34TtLoWqCqVmnZzupmpDLddZ0bEk4JfGMf6wX2lgCTVEOeHaFUaY18c9pAvWMj53BFX5GWgplYZVz6No5DbT/J4Hp5JoJsfr7DfJosUsa7+bOpLyMhzuIvZfb/1YOe8ZF+i8zd7zaqdkuYCohmpvOe7ynA9i4sOS3QRTswG+qamj7qj122oYXy+A== 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-SenderADCheck; bh=6Y7WKWafDXkhASTua4V1RJ9vQV85q2KqQ0RQ1Ddr81E=; b=d5pjtbByK2YtBJo7XHOfYTsH98IqEA3A8zGvPsdiGofJsdfFVjD3CUIZxgCelgSX78ezxSLF9yLXjgnxN0fvzvavAPjP/uL1YaBaIsuJOm2Y9BhneN3BL8zGCZR6TAfza3sBp7+tUQ4P9VafY70UW5TNut/jZG4eQr9MBpXWGf2eHwBdo8te0cyaH3Op+n7Rr9KxA7u7PcpfTreCjeVM/2/0CRFw6plaj488euHDLHPrExYoSQlBebEWKAdS6GLNJDLn2HS+fpZP02d1EhUIwPxaeWAM+PQMekPS50Kv7WdfnfnsjRJ9xaa9DLmE490TpsWG+LXGflwkM4o0c+LjYw== 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 Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) by PA4PR08MB5966.eurprd08.prod.outlook.com (2603:10a6:102:ee::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Fri, 19 Mar 2021 13:27:51 +0000 Received: from PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::60f0:3773:69b8:e336]) by PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::60f0:3773:69b8:e336%2]) with mapi id 15.20.3955.018; Fri, 19 Mar 2021 13:27:51 +0000 To: libc-alpha@sourceware.org, DJ Delorie <dj@redhat.com> Subject: [PATCH 6/6] malloc: Ensure mtag code path in checked_request2size is cold Date: Fri, 19 Mar 2021 13:27:44 +0000 Message-Id: <57b96253346fe679c82b7f88e2398ec21553b52c.1616155129.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <cover.1616155129.git.szabolcs.nagy@arm.com> References: <cover.1616155129.git.szabolcs.nagy@arm.com> Content-Type: text/plain X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: MR2P264CA0138.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:30::30) To PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.49) by MR2P264CA0138.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:30::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18 via Frontend Transport; Fri, 19 Mar 2021 13:27:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1f7f309d-5fa1-4dbc-d2b2-08d8eadad2b5 X-MS-TrafficTypeDiagnostic: PA4PR08MB5966:|AM9PR08MB6771: X-Microsoft-Antispam-PRVS: <AM9PR08MB6771882698D3A6D1DE4E1AC6ED689@AM9PR08MB6771.eurprd08.prod.outlook.com> x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: /V6MmDV8B/PH95SlIKHaRWGIW0g2lkr9Hm0hrdcC89yoCdxWlqnEDU/T6UCD8acgJOu93v/zm8vqd10oJCPIYOCQxG+x1tLbL7ARy2b6zhuX/yJ1H2KUeNYBpQO7eyKoTS0L27O2OSmzHU1p54ekXebmOCNMI6fgMQ1Ee79cuNa8oYCYMZcQxjBObRmqCSNAOXKOP1362xbaTvvvKjaJjPrO7p+JEZ8mcHWzsnAReiY18WkGuBwYvLj8e6GLjNCCA8he/vYXOxz+DnMXn4OLrYyvFiFQRlbmRdsq2bxktBmIAIqNzdndkxxOXFt9bV1N2L5W0OpVZKF0zd3yWJQ7f6raZJFxIWGR/8JXVrLyRog2A5R+8pORw9cllyFOvSEHogr8AIeVP6LawYlqrSXEFEDb/MwuXcdnHgsiVBu37GzJxvDVdAPHu1+QIgDDQqfAl9WzHLcuyQVYL0N2SJ/6H06vufYWZg6ZFNxSoUtfOVlQbmaza5Sg1k+vODp3IHuHQkXDYkZiy4vnuGQoZUOXrKq6ngm2aEdwNxUPIfUQrE6fFzoWjFxYnYs6seAhnXtNwc8oeCeLFaLThxYd3xuCfCc4n2yfDHPf/bfLj87H8QRalYzya81U4mmyKF00sBpWC7PPy/9e1MkIvRd8fq5iWHMBHuY38rEO5xKc4E0uywOqpOYmWTP/bbFzjFLtb7Rx X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR08MB6320.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(136003)(376002)(366004)(346002)(2616005)(6916009)(26005)(316002)(36756003)(8936002)(6512007)(44832011)(5660300002)(8676002)(66556008)(66476007)(186003)(2906002)(6666004)(6506007)(66946007)(69590400012)(16526019)(86362001)(6486002)(83380400001)(52116002)(4744005)(478600001)(38100700001)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: fqkDpTl8qnn4giEmBI2WF5EPBAkgKn2MH38FJlTEjOanuAe3lI272/Qip+unYrWaRm7IcAwdWydh0ryRrEA3BGun1KpNmBQpQQuMdcWlMDuvo6UDOq51Q99r52B8xOloVDRYZ4qZG7ObAoV87ngnXHDt+z9QF+dhKHoKGk7MAT69l1Gc9kqsSox4EQxkjL1LlgPHuRQ/BsOW+0NacByLaxX218s4AJVNwcEQzgd2buIFi/HjhJMMtKuR6VeSihBHtW6GNKCcvBmlTWyyTkmNZWMoBWrj9WEMBxZOkdiLej4xiFKup2fgOsl2d0W4pugb2FOSV6leni926nXOTx/XcaDCVKVcuKbSL1EnHHJvPCN9JDrkak6T1Wwgk/7hNB19aftZoW2zxAOtu+PQ4YsoXWH5WpiEs3rbP+aDk4AmVB9aoZqGCrS7gTsXLBH0ROPTjSpzQXIvDs7QWMZrymPBqegMaOT6tIbzfnJLZfVi901dT2rC7mZXgu1v5LTB8VgMcuaDZBa+LAS/nTwKuQO//Qw8dNO+w59K6K3KDyDifXdHSy7lUlWeEkPunT/R9ucdekuNcaw4BaAVNB7QGeViCzUqz5hnzKFiiAtrcyp24SCbHHVAYMRkkR3pS7LYjNOEGJiDP5OO9MWHyg1P7bGTmxAve+YyMEMHG/65YgSCDllTwa000YxrrR3i8iGuxfOrjiHikqAft4F3lmX8Ul5TPmhwkwOCPzLKLheVRh3+sWItBVe2zQP6A+j8msWGKYR+pHkFc5OHZ6JbZ+kXmhGxMK/TNamwbO4x656hqPqpOjA3phoCf5yPWGDzhstEkurEUQ2DEiYjdHQdftaCV2USbWexPRgRH/tnl61NNPGnhMNSJBDaw3O2pbiqRMX7NciGr05miMUC5cUNO0yySFaiZHuyXoQsTUlFGc+S2QcA9nHNVvCsf+qieBs3ILGVMlqrOhlhuE7WHvLF9AtI/sk3jpi4vVVI+el6CEpThYm3wLTuMPlvzVdp2BTqzPznnJf1jmPCUfczecdL90eszX2oKxqlsuSE5O/twuTGAo75PeBI0etDVXwjy2gXyg5+au7G76MKuj5dKbOxgcqBVB4d63cuc1khPdBCB8tRjDNNZMUqFuWdZLNuSJPdlbaCRJlRELSW2onX2IxH+o8q/Gm9DdNtSaHqpIz9PhKbilUcYNagiWfoLdG4phLsgvInWv+itmhCpiaBh/jbIUt5DWBnNPlBPVTKs4cAQDba33PBuLA4uvt5OV4mXGjlrSidapjO/qfm+iaB4TGTG3vy1AFTnP4WpMAZ2ne/suYgbMl13EP5h8uOUeBHjY4hHouN1EqU X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5966 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: e218263a-35ab-4d82-d358-08d8eadacb47 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dMQYwS9NVOEBKxASg3YTmjoMp+LXQDRPdAqjSkl46MDc6WPiuAFY5MUTjRyS11aQVJAB2WvYdHHlC3rdK0FrsHuCzTlHBpMEOl0xvYaxv4uK7YQ+VOE9vC28aP79VP4UqkhJGpPireL87asYVsiOEyw0su7frdC798RE1xwAw55D7zOB0hXAdBDVzE4LVORFb8S5F++b3wO3VnGOU6MTaR3Xm6YDwQnCTxCBXf2rft7Pmr6OavUEOOVtHZJVO1qFLQHkENRkPmjisrvC+EBLSRHr/ecPthUby5XAucIhI6A8XOgiGsyqNKtolXIVobSBqWT2S1nitu09rq7v48Bw5WSTRQGSNsvTS1e+JQLM5i2KmdJZU1mXG9PURaUXscBeOsTHKE+z4JSCrCBAKpEMM/JUtY22eepStSjVfQdmWHyvFi8U8mm39r4OfBsklvXTtbWgNjqcfC0P4OEhYDhovV0ahBnCOXINflk5imnqDO39ko8vK4XhymAcGv9Y705Kmt9pUNbZIJnErzlWZlVxGSly6L33GJ8SiavPc4ogslUVDME8nRpQfe27EnrviWQQ/evT17Xah2HZxqpZ8U1MQ8PjcZA1Yl9aSQxOXsFUFpq3Shl7KoRSn6fn7MoiZKBDp8E1VOBSZKeU02rgvwYY3qE3TYltln/Lh6rRhL6CvMOy7Biapc2SmMN/FricZ9d7 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:(4636009)(396003)(376002)(39860400002)(346002)(136003)(36840700001)(46966006)(36860700001)(356005)(6862004)(82310400003)(86362001)(956004)(2616005)(83380400001)(44832011)(6486002)(70206006)(5660300002)(81166007)(8936002)(6512007)(82740400003)(36756003)(70586007)(47076005)(6666004)(6506007)(478600001)(336012)(8676002)(26005)(316002)(16526019)(69590400012)(2906002)(186003)(4744005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2021 13:28:03.0477 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f7f309d-5fa1-4dbc-d2b2-08d8eadad2b5 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: VE1EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6771 X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 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> From: Szabolcs Nagy via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Szabolcs Nagy <szabolcs.nagy@arm.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
malloc: more memory tagging optimizations
|
expand
|
diff --git a/malloc/malloc.c b/malloc/malloc.c index cb1837d0d7..ef1f5b1621 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1357,8 +1357,13 @@ checked_request2size (size_t req, size_t *sz) __nonnull (1) must be a macro that produces a compile time constant if passed a constant literal. */ if (__glibc_unlikely (mtag_enabled)) - req = (req + (__MTAG_GRANULE_SIZE - 1)) & - ~(size_t)(__MTAG_GRANULE_SIZE - 1); + { + /* Ensure this is not evaluated if !mtag_enabled, see gcc PR 99551. */ + asm (""); + + req = (req + (__MTAG_GRANULE_SIZE - 1)) & + ~(size_t)(__MTAG_GRANULE_SIZE - 1); + } *sz = request2size (req); return true;