[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1405360291.2970.702.camel@schen9-DESK>
Date: Mon, 14 Jul 2014 10:51:31 -0700
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: tkhai@...dex.ru
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
"H. Peter Anvin" <hpa@...or.com>,
"David S.Miller" <davem@...emloft.net>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Chandramouli Narayanan <mouli@...ux.intel.com>,
Vinodh Gopal <vinodh.gopal@...el.com>,
James Guilford <james.guilford@...el.com>,
Wajdi Feghali <wajdi.k.feghali@...el.com>,
Jussi Kivilinna <jussi.kivilinna@....fi>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 6/7] sched: add function nr_running_cpu to expose
number of tasks running on cpu
On Sat, 2014-07-12 at 13:25 +0400, Kirill Tkhai wrote:
> >
> > +unsigned long nr_running_cpu(int cpu)
> > +{
> > + if (cpumask_test_cpu(cpu, cpu_online_mask))
> > + return cpu_rq(cpu)->nr_running;
> > + else
> > + return 0;
> > +}
> > +
>
> Offline cpu should have nr_running equal to 0. We park last
> enqueued thread (migration_thread) at the end of take_cpu_down().
>
> So, it's enough to return cpu_rq(cpu)->nr_running.
Thanks. This seems reasonable.
Tim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists