From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754329AbdEQMqm (ORCPT ); Wed, 17 May 2017 08:46:42 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35138 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754175AbdEQMqi (ORCPT ); Wed, 17 May 2017 08:46:38 -0400 Date: Wed, 17 May 2017 13:46:35 +0100 From: Matt Fleming To: Peter Zijlstra Cc: mingo@kernel.org, tglx@linutronix.de, riel@redhat.com, hpa@zytor.com, efault@gmx.de, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, lvenanci@redhat.com, xiaolong.ye@intel.com, kitsunyan@inbox.ru, clm@fb.com Subject: Re: hackbench vs select_idle_sibling; was: [tip:sched/core] sched/fair, cpumask: Export for_each_cpu_wrap() Message-ID: <20170517124635.GB3229@codeblueprint.co.uk> References: <20170414122005.o35me2h5nowqkxbv@hirez.programming.kicks-ass.net> <20170517105350.hk5m4h4jb6dfr65a@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170517105350.hk5m4h4jb6dfr65a@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 May, at 12:53:50PM, Peter Zijlstra wrote: > On Mon, May 15, 2017 at 02:03:11AM -0700, tip-bot for Peter Zijlstra wrote: > > sched/fair, cpumask: Export for_each_cpu_wrap() > > > -static int cpumask_next_wrap(int n, const struct cpumask *mask, int start, int *wrapped) > > -{ > > > - next = find_next_bit(cpumask_bits(mask), nr_cpumask_bits, n+1); > > > -} > > OK, so this patch fixed an actual bug in the for_each_cpu_wrap() > implementation. The above 'n+1' should be 'n', and the effect is that > it'll skip over CPUs, potentially resulting in an iteration that only > sees every other CPU (for a fully contiguous mask). > > This in turn causes hackbench to further suffer from the regression > introduced by commit: > > 4c77b18cf8b7 ("sched/fair: Make select_idle_cpu() more aggressive") > > So its well past time to fix this. > > Where the old scheme was a cliff-edge throttle on idle scanning, this > introduces a more gradual approach. Instead of stopping to scan > entirely, we limit how many CPUs we scan. > > Initial benchmarks show that it mostly recovers hackbench while not > hurting anything else, except Mason's schbench, but not as bad as the > old thing. > > It also appears to recover the tbench high-end, which also suffered like > hackbench. > > I'm also hoping it will fix/preserve kitsunyan's interactivity issue. > > Please test.. Tests queued up at SUSE. I'll let you know the results as soon as they're ready -- it'll be at least a couple of days.