From patchwork Thu Oct 12 09:35:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 23492 Received: (qmail 11949 invoked by alias); 12 Oct 2017 09:35:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 11934 invoked by uid 89); 12 Oct 2017 09:35:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1255 X-HELO: EUR03-DB5-obe.outbound.protection.outlook.com From: Wilco Dijkstra To: "libc-alpha@sourceware.org" CC: nd Subject: [PATCH 1/5] Inline tcache functions Date: Thu, 12 Oct 2017 09:35:17 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6SPR00MB2500; 6:Ut8+RX6QPWV8/0E2G2Gj39hkLJXlbSYWYoSY0EHtG2YVRT29/CWA5xMu5Gt8BhqTeHGhddhZawpxbY426KGUqEp38nok5/cPxgkqZbiXQF7hh4g+W/oTiPDTOaEV2EXKNO7HDypAarVPzt3or94GZ1DbcAbItL1WXT0s91qDZ1WdUCIsN14SXPoJABH425e+fJ+oyBpoIO+SqQyMS7tMw1m2suXyrd+2gL2PZ2rTbVL4Qbbkn7OPQ1Do+wwbGR/PAoob4yUo9pe9C4LV0tCW82YfO1wgjLW+6s4EhFQ6eXlpbUiYm4wWiTH84fZyVBL2hW1d3r5aEPSA2oas1YsGYQ==; 5:hqwV5H+jiKYjOLsnwb86z1ANlqnLv2t3dJRDemFcZwJ80Igf49MNvA/IG0O1RZ/B5v9Uovsn6XNQCQnctx8ZohjPqY6iz9JVG4B0VXgO1VaWOkcoPnns1DoyTeD1aBU3Fk4p//n0G9o1RnG+qA2xsw==; 24:9MdB0UAs5Rz67lMNNzWjfrw44QFwIQHxPo/7eP8us6O8lUxxUUMXY3P9Fktx4hoE3ICaVArUOPiHXRceFkekuYUXwvWfW7HGAyfsIIJJIbk=; 7:M4KaIfiijmml5nld7uTcJJuwClYy6S+6AhshuiMAWoSlV2ODeT7tNp2kpm31LMiypTsvDQFSR1cuCCZsk+oFS5YL2rniky6ckenTmHfLsZa/iqV0MlBpsaejVWmImFVxjHb8Ya3ulWMXs2YoPOH2ptROysbc36rAiGU09XBy210wYbEbArj8oQ2vlJiSSzSOxHyKaIdJtWSYDqo60SiM91NGCAk/tbgWxboVGGlSv8k= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: fc2c77c7-e37c-4f17-5a96-08d511548c80 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6SPR00MB2500; x-ms-traffictypediagnostic: DB6SPR00MB2500: nodisclaimer: True x-exchange-antispam-report-test: UriScan:(180628864354917); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6SPR00MB2500; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6SPR00MB2500; x-forefront-prvs: 04583CED1A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(189002)(377424004)(199003)(54534003)(68736007)(189998001)(99286003)(2900100001)(14454004)(2351001)(5660300001)(6116002)(3846002)(102836003)(8676002)(105586002)(106356001)(5640700003)(53936002)(6436002)(2501003)(81156014)(6506006)(8936002)(86362001)(3280700002)(3660700001)(81166006)(97736004)(5250100002)(478600001)(101416001)(74316002)(305945005)(66066001)(7736002)(50986999)(6916009)(54356999)(72206003)(33656002)(4326008)(4001150100001)(9686003)(55016002)(25786009)(7696004)(2906002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6SPR00MB2500; H:DB6PR0801MB2053.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2017 09:35:17.4159 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6SPR00MB2500 The functions tcache_get and tcache_put show up in profiles as they are a critical part of the tcache code. Inline them to give tcache a 16% performance gain. Since this improves multi-threaded cases as well, it helps offset any potential performance loss due to adding single-threaded fast paths. Passes GLIBC tests, OK for commit? ChangeLog: 2017-10-11 Wilco Dijkstra * malloc/malloc.c (tcache_put): Inline. (tcache_get): Inline. diff --git a/malloc/malloc.c b/malloc/malloc.c index cdaeedcc96dbad890b28aebd85eb5327e4fed32e..0dd095cb79e2bc2a4e111155bb9cb115e7f92d50 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -2911,7 +2911,7 @@ static __thread tcache_perthread_struct *tcache = NULL; /* Caller must ensure that we know tc_idx is valid and there's room for more chunks. */ -static void +static inline void tcache_put (mchunkptr chunk, size_t tc_idx) { tcache_entry *e = (tcache_entry *) chunk2mem (chunk); @@ -2923,7 +2923,7 @@ tcache_put (mchunkptr chunk, size_t tc_idx) /* Caller must ensure that we know tc_idx is valid and there's available chunks to remove. */ -static void * +static inline void * tcache_get (size_t tc_idx) { tcache_entry *e = tcache->entries[tc_idx];