Re: [PATCH 09/18] io-wq: fork worker threads from original task

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jens,

> +static pid_t fork_thread(int (*fn)(void *), void *arg)
> +{
> +	unsigned long flags = CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|
> +				CLONE_IO|SIGCHLD;
> +	struct kernel_clone_args args = {
> +		.flags		= ((lower_32_bits(flags) | CLONE_VM |
> +				    CLONE_UNTRACED) & ~CSIGNAL),
> +		.exit_signal	= (lower_32_bits(flags) & CSIGNAL),
> +		.stack		= (unsigned long)fn,
> +		.stack_size	= (unsigned long)arg,
> +	};
> +
> +	return kernel_clone(&args);
> +}

Can you please explain why CLONE_SIGHAND is used here?

Will the userspace signal handlers executed from the kernel thread?

Will SIGCHLD be posted to the userspace signal handlers in a userspace
process? Will wait() from userspace see the exit of a thread?

Thanks!
metze



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux