Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753228AbbGIOqV (ORCPT ); Thu, 9 Jul 2015 10:46:21 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:37731 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207AbbGIOqN (ORCPT ); Thu, 9 Jul 2015 10:46:13 -0400 Message-ID: <1436453169.3922.8.camel@gmail.com> Subject: Re: [patch] sched: beef up wake_wide() From: Mike Galbraith To: Peter Zijlstra Cc: Josef Bacik , riel@redhat.com, mingo@redhat.com, linux-kernel@vger.kernel.org, morten.rasmussen@arm.com, kernel-team Date: Thu, 09 Jul 2015 16:46:09 +0200 In-Reply-To: <1436450846.3477.98.camel@gmail.com> References: <1436025462.17152.37.camel@gmail.com> <1436080661.22930.22.camel@gmail.com> <1436159590.5850.27.camel@gmail.com> <559A91F4.7000903@fb.com> <1436207790.2940.30.camel@gmail.com> <559AD9CE.4090309@fb.com> <1436241678.1836.29.camel@gmail.com> <1436262224.1836.74.camel@gmail.com> <559C0700.6090009@fb.com> <1436336026.3767.53.camel@gmail.com> <20150709132654.GE3644@twins.programming.kicks-ass.net> <1436450846.3477.98.camel@gmail.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 Content-Length: 1780 Lines: 39 On Thu, 2015-07-09 at 16:07 +0200, Mike Galbraith wrote: > On Thu, 2015-07-09 at 15:26 +0200, Peter Zijlstra wrote: > > On Wed, Jul 08, 2015 at 08:13:46AM +0200, Mike Galbraith wrote: > > > > > > +/* > > > + * Detect 1:N waker/wakee relationship via a switching-frequency heuristic. > > > + * A waker of many should wake a different task than the one last awakened > > > + * at a frequency roughly N times higher than one of its wakees. In order > > > + * to determine whether we should let the load spread vs consolodating to > > > + * shared cache, we look for a minimum 'flip' frequency of llc_size in one > > > + * partner, and a factor of lls_size higher frequency in the other. With > > > + * both conditions met, we can be relatively sure that we are seeing a 1:N > > > + * relationship, and that load size exceeds socket size. > > > + */ > > > static int wake_wide(struct task_struct *p) > > > { > > > + unsigned int waker_flips = current->wakee_flips; > > > + unsigned int wakee_flips = p->wakee_flips; > > > int factor = this_cpu_read(sd_llc_size); > > > > > > + if (waker_flips < wakee_flips) > > > + swap(waker_flips, wakee_flips); > > > > This makes the wakee/waker names useless, the end result is more like > > wakee_flips := client_flips, waker_flips := server_flips. > > True, perhaps a rename is in order. I should perhaps add that waker/wakee_flips does make sense to me in the sense that the task who's flips end up in the waker_flips bucket is our waker of many vs being one its many wakees. -Mike -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/