Thread (37 messages) flat view 37 messages, 7 authors, 2016-02-29

Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread

From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: 2016-02-24 17:18:07
Also in: lkml

----- On Feb 24, 2016, at 6:11 AM, Thomas Gleixner tglx@linutronix.de wrote:
On Tue, 23 Feb 2016, Mathieu Desnoyers wrote:
quoted
+/*
+ * 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.
quoted
+/*
+ * 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.
quoted
+	switch (cmd) {
+	case GETCPU_CACHE_GET:
Other than that: Reviewed-by: Thomas Gleixner [off-list ref]
Thanks! Will do those changes for v5 and add your Reviewed-by tag.

Mathieu


-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help