sched_setparam/9-1: fix hang on -rt kernel

As mentioned in [1], the testcase hangs on -rt kernel,
because alarm(2) will never fire. The testcase runs with
FIFO scheduling of higher priority than ksoftirqd.

This patch changes testcase in following way:
1. In good case, where child process preempts parent,
   child is able to detect this condition and terminate.
2. In bad case, where preemption fails, testcase doesn't
   rely on softirq (alarm), but hrtimer (time).
3. removes unnecessary sleep

[1] https://lkml.org/lkml/2006/1/10/481

Reported-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
1 file changed