From: Peter W. <pe...@au...> - 2004-02-27 08:27:44
|
John Lee wrote: > 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. OK BTW Should we think about doing something similar for capped tasks? Or is it unnecessary? Peter -- Dr Peter Williams, Chief Scientist pe...@au... Aurema Pty Limited Tel:+61 2 9698 2322 PO Box 305, Strawberry Hills NSW 2012, Australia Fax:+61 2 9699 9174 79 Myrtle Street, Chippendale NSW 2008, Australia http://www.aurema.com |