Subject: Re: Small scheduler tweak for MP systems
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: enami tsugutomo <enami@sm.sony.co.jp>
List: tech-kern
Date: 01/15/2003 10:27:24
Jason R Thorpe <thorpej@wasabisystems.com> writes:
> --uAKRQypu60I7Lcqm
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
>
> The following fixes a problem in the not-quite-right very-weak-affinity
> handling in setrunnable(), and also encapsulates the operation into a
> new inline, so that resetpriority() can share the same code.
Is changing the test in resetpriority() from against p->p_usrpri to
p->p_priority correct?
enami.
> ***************
> *** 990,1002 ****
> newpriority = PUSER + p->p_estcpu + NICE_WEIGHT * (p->p_nice - NZERO);
> newpriority = min(newpriority, MAXPRI);
> p->p_usrpri = newpriority;
> ! if (newpriority < curcpu()->ci_schedstate.spc_curpriority) {
> ! /*
> ! * XXXSMP
> ! * Same applies as in setrunnable() above.
> ! */
> ! need_resched((p->p_cpu != NULL) ? p->p_cpu : curcpu());
> ! }
> }
>
> /*
> --- 1014,1020 ----
> newpriority = PUSER + p->p_estcpu + NICE_WEIGHT * (p->p_nice - NZERO);
> newpriority = min(newpriority, MAXPRI);
> p->p_usrpri = newpriority;
> ! resched_proc(p);
> }
>
> /*
>
>
> --uAKRQypu60I7Lcqm--