Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbbGQQM5 (ORCPT ); Fri, 17 Jul 2015 12:12:57 -0400 Received: from mail.efficios.com ([78.47.125.74]:46510 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752345AbbGQQMz (ORCPT ); Fri, 17 Jul 2015 12:12:55 -0400 Date: Fri, 17 Jul 2015 16:12:47 +0000 (UTC) From: Mathieu Desnoyers To: Ben Maurer Cc: Paul Turner , linux-kernel@vger.kernel.org, Andrew Hunter , Peter Zijlstra , Ingo Molnar , rostedt , "Paul E. McKenney" , Josh Triplett , Linus Torvalds , Andrew Morton , linux-api Message-ID: <466417291.1018.1437149567296.JavaMail.zimbra@efficios.com> In-Reply-To: <5CDDBDF2D36D9F43B9F5E99003F6A0D48D616ED9@PRN-MBX02-1.TheFacebook.com> References: <1437076851-14848-1-git-send-email-mathieu.desnoyers@efficios.com> <5CDDBDF2D36D9F43B9F5E99003F6A0D48D616ED9@PRN-MBX02-1.TheFacebook.com> Subject: Re: [RFC PATCH] thread_local_abi system call: caching current CPU number (x86) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [78.47.125.74] X-Mailer: Zimbra 8.6.0_GA_1153 (ZimbraWebClient - FF39 (Linux)/8.6.0_GA_1153) Thread-Topic: [RFC PATCH] thread_local_abi system call: caching current CPU number (x86) Thread-Index: AQHQwAIrY5xZQGOIHUyTrlNIF/eb4p3feNS6Hr3vZFY= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1005 Lines: 31 ----- On Jul 17, 2015, at 6:49 AM, Ben Maurer bmaurer@fb.com wrote: > 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? Yes, good idea! Will do. Thanks! Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com -- 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/