From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758351AbcBXRSH (ORCPT ); Wed, 24 Feb 2016 12:18:07 -0500 Received: from mail.efficios.com ([78.47.125.74]:42498 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757263AbcBXRSD (ORCPT ); Wed, 24 Feb 2016 12:18:03 -0500 Date: Wed, 24 Feb 2016 17:17:57 +0000 (UTC) From: Mathieu Desnoyers To: Thomas Gleixner Cc: Andrew Morton , Russell King , Ingo Molnar , "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-api , Paul Turner , Andrew Hunter , Peter Zijlstra , Andy Lutomirski , Andi Kleen , Dave Watson , Chris Lameter , Ben Maurer , rostedt , "Paul E. McKenney" , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk Message-ID: <1095889878.7102.1456334277472.JavaMail.zimbra@efficios.com> In-Reply-To: References: <1456270120-7560-1-git-send-email-mathieu.desnoyers@efficios.com> <1456270120-7560-2-git-send-email-mathieu.desnoyers@efficios.com> Subject: Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread 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_1178 (ZimbraWebClient - FF44 (Linux)/8.6.0_GA_1178) Thread-Topic: getcpu_cache system call: cache CPU number of running thread Thread-Index: jbzOJpOp+1aAx7qOcFfGUoMPOGp9pg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Feb 24, 2016, at 6:11 AM, Thomas Gleixner tglx@linutronix.de wrote: > On Tue, 23 Feb 2016, Mathieu Desnoyers wrote: >> +/* >> + * If parent process has a thread-local ABI, the child inherits. Only applies >> + * when forking a process, not a thread. >> + */ >> +void getcpu_cache_fork(struct task_struct *t) >> +{ >> + t->cpu_cache = current->cpu_cache; >> +} >> + >> +void getcpu_cache_execve(struct task_struct *t) >> +{ >> + t->cpu_cache = NULL; >> +} >> + >> +void getcpu_cache_exit(struct task_struct *t) >> +{ >> + t->cpu_cache = NULL; >> +} > > That's hardly worth a function call. Please inline. > >> +/* >> + * sys_getcpu_cache - setup getcpu cache for caller thread >> + */ >> +SYSCALL_DEFINE3(getcpu_cache, int, cmd, int32_t __user * __user *, cpu_cachep, >> + int, flags) >> +{ >> + if (unlikely(flags)) >> + return -EINVAL; > > New line for readability sake. > >> + switch (cmd) { >> + case GETCPU_CACHE_GET: > > Other than that: Reviewed-by: Thomas Gleixner Thanks! Will do those changes for v5 and add your Reviewed-by tag. Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com