From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754525AbcALVD1 (ORCPT ); Tue, 12 Jan 2016 16:03:27 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:54561 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915AbcALVDZ convert rfc822-to-8bit (ORCPT ); Tue, 12 Jan 2016 16:03:25 -0500 From: Ben Maurer To: Mathieu Desnoyers CC: Josh Triplett , Shane M Seymour , Thomas Gleixner , Paul Turner , Andrew Hunter , Peter Zijlstra , "linux-kernel@vger.kernel.org" , linux-api , "Andy Lutomirski" , Andi Kleen , "Dave Watson" , Chris Lameter , Ingo Molnar , rostedt , "Paul E. McKenney" , Linus Torvalds , Andrew Morton , Russell King , Catalin Marinas , "Will Deacon" , Michael Kerrisk Subject: RE: [RFC PATCH 0/3] Implement getcpu_cache system call Thread-Topic: [RFC PATCH 0/3] Implement getcpu_cache system call Thread-Index: AQHRR4cGvK1Ai2CjXUGdGoSQqME6XJ73eKIAgAAG4gCAAB2sAIAAII6A//+WaJG363QifcgVoL/h Date: Tue, 12 Jan 2016 21:02:12 +0000 Message-ID: <5CDDBDF2D36D9F43B9F5E99003F6A0D49A1426A5@PRN-MBX02-1.TheFacebook.com> References: <1451977320-4886-1-git-send-email-mathieu.desnoyers@efficios.com> <20160111230306.GC28717@cloud> <137700396.343696.1452559758752.JavaMail.zimbra@efficios.com> <20160112024549.GA6488@x> <9F8D25C2-B5EE-479D-BD61-0FE466962B9E@fb.com>,<467525713.343916.1452604549209.JavaMail.zimbra@efficios.com> In-Reply-To: <467525713.343916.1452604549209.JavaMail.zimbra@efficios.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.52.123] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-01-12_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > One idea I have would be to let the kernel reserve some space either after the > first stack address (for a stack growing down) or at the beginning of the > allocated TLS area for each thread in copy_thread_tls() by fiddling with > sp or the tls base address when creating a thread. Could this be implemented by having glibc use a well known symbol name to define the per-thread TLS area? If an high performance application wants to avoid any relocations in accessing this variable it would define it and that definition would override glibc's. This is how things work with malloc. glibc has a default malloc implementation but we link jemalloc directly into our binaries. in addition to changing the malloc implementation this means that calls to malloc don't go through the PLT. -b