As far as I'm aware, the kernel used to crash when forking inside a transaction (see powerpc/tm: Fix crash when forking inside a transaction). So this is to check that the transaction aborts rather than your whole kernel crashing.

On 01/12/15 19:11, Anshuman Khandual wrote:
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 ?


_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to