Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62ab616d authored by Kenneth W Chen's avatar Kenneth W Chen Committed by Linus Torvalds
Browse files

[PATCH] sched: optimize activate_task for RT task



RT task does not participate in interactiveness priority and thus shouldn't
be bothered with timestamp and p->sleep_type manipulation when task is
being put on run queue.  Bypass all of the them with a single if (rt_task)
test.

Signed-off-by: default avatarKen Chen <kenneth.w.chen@intel.com>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 06066714
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -940,6 +940,9 @@ static void activate_task(struct task_struct *p, struct rq *rq, int local)
{
	unsigned long long now;

	if (rt_task(p))
		goto out;

	now = sched_clock();
#ifdef CONFIG_SMP
	if (!local) {
@@ -961,7 +964,6 @@ static void activate_task(struct task_struct *p, struct rq *rq, int local)
				     (now - p->timestamp) >> 20);
	}

	if (!rt_task(p))
	p->prio = recalc_task_prio(p, now);

	/*
@@ -987,7 +989,7 @@ static void activate_task(struct task_struct *p, struct rq *rq, int local)
		}
	}
	p->timestamp = now;

out:
	__activate_task(p, rq);
}