[PATCH] selftests/powerpc: Do not fail on TM_CAUSE_RESCHED

Gustavo Romero gromero at linux.vnet.ibm.com
Wed Aug 29 09:08:33 AEST 2018


Hi Breno,

On 08/21/2018 03:56 PM, Breno Leitao wrote:
> There are cases where the test is not expecting to have the transaction
> aborted, but, the test process might have been rescheduled, either in the OS
> level or by KVM (if it is running on a KVM guest machine). The process
> reschedule will cause a treclaim/recheckpoint which will cause the transaction
> to doom, failing as soon as the process is rescheduled back to the CPU. This
> might cause the test to fail, but this is not a failure in essence.
> 
> If that is the case, TEXASR[FC] is indicated with either
> TM_CAUSE_RESCHEDULE or TM_CAUSE_KVM_RESCHEDULE for KVM interruptions.
> 
> In this scenario, ignore these two failures and avoid the whole test to return
> failure.
> 
> Signed-off-by: Breno Leitao <leitao at debian.org>

Thanks for improving the code.

I understand that filtering out the aborts caused by the re-schedules is correct.

Only a nit:

> @@ -244,9 +245,12 @@ void *tm_una_ping(void *input)
> 
>   	/*
>   	 * Check if TM failed due to the cause we were expecting. 0xda is a
> -	 * TM_CAUSE_FAC_UNAV cause, otherwise it's an unexpected cause.
> +	 * TM_CAUSE_FAC_UNAV cause, otherwise it's an unexpected cause, unless
> +	 * it was caused by a reschedule.
>   	 */
> -	if (is_failure(cr_) && !failure_is_unavailable()) {
> +
> +	if (is_failure(cr_) && !failure_is_unavailable()
> +	    & !failure_is_reschedule()) {

             ^---

It should read a short-circuit operator here instead of a bitwise operator.

Otherwise it LGTM.

Reviewed-by: Gustavo Romero <gromero at linux.ibm.com>


Best regards,
Gustavo



More information about the Linuxppc-dev mailing list