lkml.org 
[lkml]   [2013]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/8] sched: Reschedule task on preferred NUMA node once selected
On Thu, Jun 27, 2013 at 04:54:58PM +0200, Peter Zijlstra wrote:
> On Wed, Jun 26, 2013 at 03:38:05PM +0100, Mel Gorman wrote:
> > +static int
> > +find_idlest_cpu_node(int this_cpu, int nid)
> > +{
> > + unsigned long load, min_load = ULONG_MAX;
> > + int i, idlest_cpu = this_cpu;
> > +
> > + BUG_ON(cpu_to_node(this_cpu) == nid);
> > +
> > + for_each_cpu(i, cpumask_of_node(nid)) {
> > + load = weighted_cpuload(i);
> > +
> > + if (load < min_load) {
> > + struct task_struct *p;
> > +
> > + /* Do not preempt a task running on its preferred node */
> > + struct rq *rq = cpu_rq(i);
> > + local_irq_disable();
> > + raw_spin_lock(&rq->lock);
>
> raw_spin_lock_irq() ?
>

/me slaps self

Fixed. Thanks.

> > + p = rq->curr;
> > + if (p->numa_preferred_nid != nid) {
> > + min_load = load;
> > + idlest_cpu = i;
> > + }
> > + raw_spin_unlock(&rq->lock);
> > + local_irq_disable();
> > + }
> > + }
> > +
> > + return idlest_cpu;
> > +}

--
Mel Gorman
SUSE Labs


\
 
 \ /
  Last update: 2013-06-28 16:21    [W:0.109 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site