Messages in this thread | | | Date | Fri, 14 Feb 2020 07:50:45 +0000 | From | Mel Gorman <> | Subject | Re: [PATCH 08/11] sched/numa: Bias swapping tasks based on their preferred node |
| |
On Fri, Feb 14, 2020 at 12:12:32PM +0800, Hillf Danton wrote: > > + if (cur->numa_preferred_nid == env->dst_nid) > > + imp -= imp / 16; > > + > > + /* > > + * Encourage picking a task that moves to its preferred node. > > + * This potentially makes imp larger than it's maximum of > > + * 1998 (see SMALLIMP and task_weight for why) but in this > > + * case, it does not matter. > > + */ > > + if (cur->numa_preferred_nid == env->src_nid) > > + imp += imp / 8; > > + > > if (maymove && moveimp > imp && moveimp > env->best_imp) { > > imp = moveimp; > > cur = NULL; > > goto assign; > > } > > > > + /* > > + * If a swap is required then prefer moving a task to its preferred > > + * nid over a task that is not moving to a preferred nid. > > after checking if imp is above SMALLIMP. >
It is preferable to move a task to its preferred node over one that does not even if the improvement is lsss than SMALLIMP. The reasoning is that NUMA balancing retries moving tasks to their preferred node periodically and moving "now" reduces the chance of a task having to retry its move later.
-- Mel Gorman SUSE Labs
| |