Ankita Proposed that:
We have been seeing failures in the prio-wake testcase for a while now. Digged closer into the testcase to find if there was an error lurking in the testcase itself. Did hit a few, which this patch aims to fix. But the failures persist, indicating that something is amiss in the kernel. This patch does the following:
o Make the output of the test more readable. It is now time ordered.
o Bases the pass/fail not only on the order in which the waking up threads update the 'wakeup.arr' but also on the time they woke up. This reduced chances of error.
o Remove an extra lock and unlock on mutex when updating wakeup.arr.

Chirag Jog <chirag@linux.vnet.ibm.com> commented:
I am not convinced that adding a check for wake up time is going to reduce the chances for error. Whichever thread wakes up first, takes the lock,updates priority and time fields. Hence the time field will always be updated in wakeup order. So this is not really adding another useful check. I am ready to be conviced otherwise :)

Ankita Replied:
Yep I agree that now it would not make any difference. But before this patch, we were unlocking the mutex after only updating the running_threads and noting down the wakeup time and try and acquire the lock again to update the wakeup order in wakeup.arr So, there were chances the wakeup time did not match the order in which the wakeup.arr was updated. But yes, with the lock changes, this change would not be required. Shall send the patch again. Thanks for the review :-). So here is the updated patch which takes Chirag's comments into account.
Signed-off-by: Ankita Garg <ankita@in.ibm.com>
Signed-off-by: Chandan Kumar B V <cbhuvana@in.ibm.com>
1 file changed