lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 20 Feb 2014 09:50:17 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Lei Wen <adrian.wenl@...il.com>
Cc:	Lei Wen <leiwen@...vell.com>, mingo@...hat.com,
	preeti.lkml@...il.com, daniel.lezcano@...aro.org,
	viresh.kumar@...aro.org, xjian@...vell.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched: keep quiescent cpu out of idle balance loop

On Thu, Feb 20, 2014 at 10:42:51AM +0800, Lei Wen wrote:
> >> -     int ilb = cpumask_first(nohz.idle_cpus_mask);
> >> +     int ilb;
> >> +     int cpu = smp_processor_id();
> >> +     struct sched_domain *tmp;
> >>
> >> -     if (ilb < nr_cpu_ids && idle_cpu(ilb))
> >> -             return ilb;
> >> +     for_each_domain(cpu, tmp) {
> >> +             ilb = cpumask_first_and(nohz.idle_cpus_mask,
> >> +                             sched_domain_span(tmp));
> >> +             if (ilb < nr_cpu_ids && idle_cpu(ilb))
> >> +                     return ilb;
> >> +     }
> >
> > The ILB code is bad; but you just made it horrible. Don't add pointless
> > for_each_domain() iterations.
> >
> > I'm thinking something like:
> >
> >   ilb = cpumask_first_and(nohz.idle_cpus_mask, this_rq()->rd.span);
> >
> > Should work just fine, no?
> 
> Yes, it has the same result as my previous patch did.
> 
> >
> > Better still would be to maybe not participate in the ILB in the first
> > place and leave this selection loop alone.
> 
> Not quitely get your point here...
> Do you mean that you want idle cpu selection be put in earlier place
> than current find_new_ilb is?

I meant that if you stop an idle CPU setting its bit in
nohz.idle_cpus_mask, you don't have to mask it out either.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ