On Fri, Jul 17, 2015 at 10:49:19AM +0000, Ben Maurer 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?

"saving a branch" doesn't seem like a good reason to do that; however,
it *is* the convention across other calls: if you pass 0, the pointer
is ignored, but if you pass non-zero, the pointer must be valid or you
get -EFAULT (or an actual segfault).

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to