[PATCH 2/3] selftests/powerpc: Add test for forking inside transaction

Anshuman Khandual khandual at linux.vnet.ibm.com
Tue Dec 1 19:11:43 AEDT 2015


On 12/01/2015 10:38 AM, Rashmica Gupta wrote:
> +int test_fork(void)
> +{
> +	SKIP_IF(!have_htm());
> +
> +	asm __volatile__(
> +		"tbegin.;"
> +		"blt    1f; "
> +		"li     0, 2;"  /* fork syscall */
> +		"sc  ;"
> +		"tend.;"
> +		"1: ;"
> +		: : : "memory", "r0");
> +	/* If we reach here, we've passed.  Otherwise we've probably crashed
> +	 * the kernel */

The transaction inside the parent process will abort. What
is expected inside the child process ? Why should the kernel
crash ?



More information about the Linuxppc-dev mailing list