From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932514AbbFCQxN (ORCPT ); Wed, 3 Jun 2015 12:53:13 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:34294 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752997AbbFCQxJ (ORCPT ); Wed, 3 Jun 2015 12:53:09 -0400 Message-ID: <1433350386.3996.15.camel@gmail.com> Subject: Re: [PATCH RESEND] sched: prefer an idle cpu vs an idle sibling for BALANCE_WAKE From: Mike Galbraith To: Josef Bacik Cc: Peter Zijlstra , Rik van Riel , mingo@redhat.com, linux-kernel@vger.kernel.org, morten.rasmussen@arm.com, kernel-team Date: Wed, 03 Jun 2015 18:53:06 +0200 In-Reply-To: <556F23E5.5020107@fb.com> References: <1432761736-22093-1-git-send-email-jbacik@fb.com> <20150528102127.GD3644@twins.programming.kicks-ass.net> <20150528110514.GR18673@twins.programming.kicks-ass.net> <5568D43D.20703@fb.com> <556CB4A8.1050509@fb.com> <1433191354.11346.22.camel@twins> <556DE3FB.9020400@fb.com> <556F0B5E.6030805@redhat.com> <1433341448.1495.4.camel@twins> <1433345444.3343.21.camel@gmail.com> <556F23E5.5020107@fb.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-06-03 at 11:57 -0400, Josef Bacik wrote: > On 06/03/2015 11:30 AM, Mike Galbraith wrote: > > On Wed, 2015-06-03 at 16:24 +0200, Peter Zijlstra wrote: > >> On Wed, 2015-06-03 at 10:12 -0400, Rik van Riel wrote: > >> > >>> There is a policy vs mechanism thing here. Ingo and Peter > >>> are worried about the overhead in the mechanism of finding > >>> an idle CPU. Your measurements show that the policy of > >>> finding an idle CPU is the correct one. > >> > >> For his workload; I'm sure I can find a workload where it hurts. > >> > >> In fact, I'm fairly sure Mike knows one from the top of his head, seeing > >> how he's the one playing about trying to shrink that idle search :-) > > > > Like anything where scheduling latency doesn't heavily dominate. Even > > if searching were free, bounces aren't, even for the very light. > > > > If scheduling latency doesn't hurt then making the search shouldn't > matter should it? I get that migrations aren't free, but it seems like > they can't hurt that much. Nah, they don't hurt much :) commit e0a79f529d5ba2507486d498b25da40911d95cf6 Author: Mike Galbraith Date: Mon Jan 28 12:19:25 2013 +0100 sched: Fix select_idle_sibling() bouncing cow syndrome If the previous CPU is cache affine and idle, select it. The current implementation simply traverses the sd_llc domain, taking the first idle CPU encountered, which walks buddy pairs hand in hand over the package, inflicting excruciating pain. 1 tbench pair (worst case) in a 10 core + SMT package: pre 15.22 MB/sec 1 procs post 252.01 MB/sec 1 procs > This application is huge, it's our > webserver, we're doing like 400 requests per second on these things, and > hands down moving stuff to idle cpus is beating the pants off of staying > on the same cpu. Is there a specific workload I could build a test for > that you think this approach would hurt? Thanks, Search cost hurts fast movers, as does dragging even a small footprint all over the place, as you can see above. -Mike