From: John L. <jo...@au...> - 2004-02-28 05:53:23
|
On Fri, 27 Feb 2004, Peter Williams wrote: > > 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. > > OK > > BTW Should we think about doing something similar for capped tasks? Or > is it unnecessary? I think doing it for capped tasks won't be necessary. They'll at least get to run again sooner or later. However, even if user_mode() could be used, the above is not the complete solution. To force a background task to call schedule() when it leaves the kernel, we'll have to ensure that a background task _always_ has need_resched set when executing in the kernel. If kernel preemption has been enabled, this will require that every time schedule() chooses a BG task in kernel mode to run, need_resched will need to be set for it. Which then necessitates changing that need_resched() check at the end of schedule() to account for BG tasks... The alternative would be to make changes to the low level kernel entry/exit code for each architecture to explicitly handle BG tasks - probably not the way to go :-). John |