From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751090AbdHRHzl (ORCPT ); Fri, 18 Aug 2017 03:55:41 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:39187 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750926AbdHRHzk (ORCPT ); Fri, 18 Aug 2017 03:55:40 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Fri, 18 Aug 2017 16:55:33 +0900 From: Byungchul Park To: "Joel Fernandes (Google)" Cc: Peter Zijlstra , mingo@kernel.org, Linux Kernel Mailing List , juri.lelli@gmail.com, rostedt@goodmis.org, kernel-team@lge.com, Joel Fernandes Subject: Re: [PATCH v7 1/2] sched/deadline: Add support for SD_PREFER_SIBLING on find_later_rq() Message-ID: <20170818075533.GC20323@X58A-UD3R> References: <1503036313-15044-1-git-send-email-byungchul.park@lge.com> <1503036313-15044-2-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 18, 2017 at 12:21:46AM -0700, Joel Fernandes (Google) wrote: > Hi Byungchul, > > On Thu, Aug 17, 2017 at 11:05 PM, Byungchul Park wrote: > > It would be better to avoid pushing tasks to other cpu within > > a SD_PREFER_SIBLING domain, instead, get more chances to check other > > siblings. > > > > Signed-off-by: Byungchul Park > > --- > > kernel/sched/deadline.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++--- > > 1 file changed, 52 insertions(+), 3 deletions(-) > > > > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > > index 0223694..8f69a37 100644 > > --- a/kernel/sched/deadline.c > > +++ b/kernel/sched/deadline.c > > @@ -1319,12 +1319,35 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu > > > > static DEFINE_PER_CPU(cpumask_var_t, local_cpu_mask_dl); > > > > +/* > > + * Find the first cpu in: mask & sd & ~prefer > > + */ > > +static int find_cpu(const struct cpumask *mask, > > + const struct sched_domain *sd, > > + const struct sched_domain *prefer) > > +{ > > + const struct cpumask *sds = sched_domain_span(sd); > > + const struct cpumask *ps = prefer ? sched_domain_span(prefer) : NULL; > > + int cpu = -1; > > + > > + while ((cpu = cpumask_next(cpu, mask)) < nr_cpu_ids) { > > This can be simplified to for_each_cpu(cpu, mask) ? Indeed, exactly. I will use that, thank you.