From: John L. <jo...@au...> - 2004-02-27 08:00:49
|
On Fri, 27 Feb 2004, Peter Williams wrote: > I think that a "flag" based solution to this problem would probably be > inadequate as there's no guarantee that a task only holds one semaphore > at a time. So I think that we should investigate a "count" based > solution. Wouldn't a better solution to this problem be to ensure that a background task running in kernel mode always get a highish priority? It can then finish its work in the kernel, be given its background priority back and call schedule(). I don't know whether the user_mode() macro could be used within sched_normal_effective_prio(), but if it could solving this problem could simply be: static inline int sched_normal_effective_prio(task_t *p, runqueue_t *rq) { uint32_t eps; if (unlikely(0 == p->cpu_rate_cap_per_share)) { if (user_mode(regs)) return EBS_BGND_PRI; else return EBS_MEAN_PRI; } .... Of course 'regs' is undefined above. I'll take a closer look at user_mode() and struct pt_regs. John |