lkml.org 
[lkml]   [2017]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v11 for 4.15 01/24] Restartable sequences system call
On Tue, Nov 14, 2017 at 03:03:51PM -0500, Mathieu Desnoyers wrote:
> +/*
> + * If parent process has a registered restartable sequences area, the
> + * child inherits. Only applies when forking a process, not a thread. In
> + * case a parent fork() in the middle of a restartable sequence, set the
> + * resume notifier to force the child to retry.
> + */
> +static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
> +{
> + if (clone_flags & CLONE_THREAD) {
> + t->rseq = NULL;
> + t->rseq_len = 0;
> + t->rseq_sig = 0;
> + } else {
> + t->rseq = current->rseq;
> + t->rseq_len = current->rseq_len;
> + t->rseq_sig = current->rseq_sig;
> + rseq_set_notify_resume(t);
> + }
> +}

This hurts my brain... what happens if you fork a multi-threaded
process?

Do we fully inherit the TLS state of the calling thread?
\
 
 \ /
  Last update: 2017-11-17 17:18    [W:0.355 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site