Re: [PATCH 1/3] sched: add sched_task_call()

From: Jiri Kosina
Date: Thu Feb 19 2015 - 16:26:16 EST

On Thu, 19 Feb 2015, Josh Poimboeuf wrote:

> How about with a TIF_IN_USERSPACE thread flag? It could be cleared/set
> right at the border. Then for running tasks it's as simple as:
> if (test_tsk_thread_flag(task, TIF_IN_USERSPACE))
> klp_switch_task_universe(task);

That's in principle what CONTEXT_TRACKING is doing, i.e. the condition
we'd be interested in would be

__this_cpu_read(context_tracking.state) == IN_USER

But it has overhead.

Jiri Kosina
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at