Commit 0bafd214 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds
Browse files

[PATCH] rtmutex: Modify rtmutex-tester to test the setscheduler propagation



Make test suite setscheduler calls asynchronously.  Remove the waits in the
test cases and add a new testcase to verify the correctness of the
setscheduler priority propagation.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e74c69f4
Loading
Loading
Loading
Loading
+18 −14
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ enum test_opcodes {

static int handle_op(struct test_thread_data *td, int lockwakeup)
{
	struct sched_param schedpar;
	int i, id, ret = -EINVAL;

	switch(td->opcode) {
@@ -63,17 +62,6 @@ static int handle_op(struct test_thread_data *td, int lockwakeup)
	case RTTEST_NOP:
		return 0;

	case RTTEST_SCHEDOT:
		schedpar.sched_priority = 0;
		ret = sched_setscheduler(current, SCHED_NORMAL, &schedpar);
		if (!ret)
			set_user_nice(current, 0);
		return ret;

	case RTTEST_SCHEDRT:
		schedpar.sched_priority = td->opdata;
		return sched_setscheduler(current, SCHED_FIFO, &schedpar);

	case RTTEST_LOCKCONT:
		td->mutexes[td->opdata] = 1;
		td->event = atomic_add_return(1, &rttest_event);
@@ -310,9 +298,10 @@ static int test_func(void *data)
static ssize_t sysfs_test_command(struct sys_device *dev, const char *buf,
				  size_t count)
{
	struct sched_param schedpar;
	struct test_thread_data *td;
	char cmdbuf[32];
	int op, dat, tid;
	int op, dat, tid, ret;

	td = container_of(dev, struct test_thread_data, sysdev);
	tid = td->sysdev.id;
@@ -334,6 +323,21 @@ static ssize_t sysfs_test_command(struct sys_device *dev, const char *buf,
		return -EINVAL;

	switch (op) {
	case RTTEST_SCHEDOT:
		schedpar.sched_priority = 0;
		ret = sched_setscheduler(threads[tid], SCHED_NORMAL, &schedpar);
		if (ret)
			return ret;
		set_user_nice(current, 0);
		break;

	case RTTEST_SCHEDRT:
		schedpar.sched_priority = dat;
		ret = sched_setscheduler(threads[tid], SCHED_FIFO, &schedpar);
		if (ret)
			return ret;
		break;

	case RTTEST_SIGNAL:
		send_sig(SIGHUP, threads[tid], 0);
		break;
+1 −0
Original line number Diff line number Diff line
@@ -18,4 +18,5 @@ testit t3-l1-pi-steal.tst
testit t3-l2-pi.tst
testit t4-l2-pi-deboost.tst
testit t5-l4-pi-boost-deboost.tst
testit t5-l4-pi-boost-deboost-setsched.tst
+0 −2
Original line number Diff line number Diff line
@@ -57,9 +57,7 @@ W: opcodeeq: 0: 0

# Set schedulers
C: schedfifo:		0: 	80
W: opcodeeq:		0: 	0
C: schedfifo:		1: 	80
W: opcodeeq:		1: 	0

# T0 lock L0
C: locknowait:		0: 	0
+0 −2
Original line number Diff line number Diff line
@@ -57,9 +57,7 @@ W: opcodeeq: 0: 0

# Set schedulers
C: schedother:		0: 	0
W: opcodeeq:		0: 	0
C: schedfifo:		1: 	80
W: opcodeeq:		1: 	0

# T0 lock L0
C: locknowait:		0: 	0
+0 −2
Original line number Diff line number Diff line
@@ -57,9 +57,7 @@ W: opcodeeq: 0: 0

# Set schedulers
C: schedother:		0: 	0
W: opcodeeq:		0: 	0
C: schedother:		1: 	0
W: opcodeeq:		1: 	0

# T0 lock L0
C: locknowait:		0: 	0
Loading