Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757958AbbGQKuG (ORCPT ); Fri, 17 Jul 2015 06:50:06 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:26271 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757581AbbGQKuE convert rfc822-to-8bit (ORCPT ); Fri, 17 Jul 2015 06:50:04 -0400 From: Ben Maurer To: Mathieu Desnoyers , Paul Turner CC: "linux-kernel@vger.kernel.org" , "Andrew Hunter" , Peter Zijlstra , Ingo Molnar , Steven Rostedt , "Paul E. McKenney" , Josh Triplett , "Linus Torvalds" , Andrew Morton , "linux-api@vger.kernel.org" Subject: RE: [RFC PATCH] thread_local_abi system call: caching current CPU number (x86) Thread-Topic: [RFC PATCH] thread_local_abi system call: caching current CPU number (x86) Thread-Index: AQHQwAIrY5xZQGOIHUyTrlNIF/eb4p3feNS6 Date: Fri, 17 Jul 2015 10:49:19 +0000 Message-ID: <5CDDBDF2D36D9F43B9F5E99003F6A0D48D616ED9@PRN-MBX02-1.TheFacebook.com> References: <1437076851-14848-1-git-send-email-mathieu.desnoyers@efficios.com> In-Reply-To: <1437076851-14848-1-git-send-email-mathieu.desnoyers@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:5.14.151,1.0.33,0.0.0000 definitions=2015-07-17_05:2015-07-17,2015-07-17,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 813 Lines: 17 Mathieu Desnoyers wrote: > Expose a new system call allowing threads to register a userspace memory > area where to store the current CPU number. Scheduler migration sets the I really like that this approach makes it easier to add a per-thread interaction between userspace and the kernel in the future. >+ if (!tlap || t->thread_local_abi_len < >+ offsetof(struct thread_local_abi, cpu) >+ + sizeof(tlap->cpu)) Could you save a branch here by enforcing that thread_local_abi_len = 0 if thread_local_abi = null? -b-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/