Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp820170pxy; Wed, 28 Apr 2021 15:02:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy9b02BQSzQVtNg3gRePGexkTfVueYP1o8NZdsIiCK6C9gqZwl5zzAqQnrxQd4JNq5NetT X-Received: by 2002:a17:902:7201:b029:ec:b5c2:571c with SMTP id ba1-20020a1709027201b02900ecb5c2571cmr32448934plb.55.1619647331589; Wed, 28 Apr 2021 15:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619647331; cv=none; d=google.com; s=arc-20160816; b=Terd9Pldh4APVGTsAmn+u73ipkkgljUllBeoek0A4pu1YyALytUoEqMIbNkCMa7HG+ +JWCb5WArwCviyEVyFQRf+5JOPYVIJiKY7LKT7jAXUUVRIvrNzz+Is5OamzDlGCiO9pX QmN4BTgqJDNOM8W4tXxLiHyody9lPovwXFQ5mVNM2vLjL7rLDQ/7ryGywIFExrwF/0W3 hlcRnbtxtuAdI+QmrTrvy6nCyzrlt8HAX/nNxnknPBoIwVvNGbC0pFPC862UVabsSvRc nxjch1zQ0R+akq2roFag/M4JGo5QHQ+/XRVMenbJUix0TWlfWmbdNiTTyDUinRtsY0E3 a+bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=uHQICK8BBkD+n7tPtZn31tEK793/nNqp5Xj0UyZ7+js=; b=Q+Ozf079+baWDxImdy9f+6VHElT2Y0QhKj+qBF4U9l+xbzO86PdjTdekLUYqfupSo3 wNdYm2Qf2ABpwjavVLquPIXlsRnmllMuwKmwOLFbgtXSTA8ZSrfHUr/fnEJCxCLM3Of1 bmiTcKzbY+epLeXJzHmqtvkrMieMRPN8kd/zAqOoGq6rhuyriwPKeJ7o+co9V5ZOVtKp 0gwPkAnXnG3rDK1bWrY8GqlmwaoCzncCOnUiMJ3Oq0XxoP96lCpDS/tSvIDm2tezZvwl +MO9PqmeRXmNXT493Idy61ZCW4sBhmI7ZQZcT1BP3Jj4ohmkZ60/s2/Cgwlkp9vcN9zx XgSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx13si1129277pjb.10.2021.04.28.15.01.22; Wed, 28 Apr 2021 15:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbhD1WBD (ORCPT + 99 others); Wed, 28 Apr 2021 18:01:03 -0400 Received: from foss.arm.com ([217.140.110.172]:57180 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbhD1WBC (ORCPT ); Wed, 28 Apr 2021 18:01:02 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CC4E7ED1; Wed, 28 Apr 2021 15:00:16 -0700 (PDT) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5ACC63F694; Wed, 28 Apr 2021 15:00:14 -0700 (PDT) From: Valentin Schneider To: Oliver Sang Cc: 0day robot , Vincent Guittot , Dietmar Eggemann , LKML , lkp@lists.01.org, ying.huang@intel.com, feng.tang@intel.com, zhengjun.xing@intel.com, Lingutla Chandrasekhar , Peter Zijlstra , Ingo Molnar , Morten Rasmussen , Qais Yousef , Quentin Perret , Pavan Kondeti , Rik van Riel , aubrey.li@linux.intel.com, yu.c.chen@intel.com, Mel Gorman Subject: Re: [sched/fair] 38ac256d1c: stress-ng.vm-segv.ops_per_sec -13.8% regression In-Reply-To: <87mttqt5jc.mognet@arm.com> References: <20210414052151.GB21236@xsang-OptiPlex-9020> <87im4on5u5.mognet@arm.com> <20210421032022.GA13430@xsang-OptiPlex-9020> <87bla8ue3e.mognet@arm.com> <20210422074742.GE31382@xsang-OptiPlex-9020> <87wnsutzi9.mognet@arm.com> <87mttqt5jc.mognet@arm.com> Date: Wed, 28 Apr 2021 23:00:07 +0100 Message-ID: <87k0omxe6w.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/04/21 21:42, Valentin Schneider wrote: > On 22/04/21 10:55, Valentin Schneider wrote: >> I'll go find myself some other x86 box and dig into it; >> I'd rather not leave this hanging for too long. > > So I found myself a dual-socket Xeon Gold 5120 @ 2.20GHz (64 CPUs) and > *there* I get a somewhat consistent ~-6% regression. As I'm suspecting > cacheline shenanigans, I also ran that with Peter's recent > kthread_is_per_cpu() change, and that brings it down to ~-3% > Ha ha ho ho, so that was a red herring. My statistical paranoia somewhat paid off, and the kthread_is_per_cpu() thing doesn't really change anything when you stare at 20+ iterations of that vm-segv thing. As far as I can tell, the culprit is the loss of LBF_SOME_PINNED. By some happy accident, the load balancer repeatedly iterates over PCPU kthreads, sets LBF_SOME_PINNED and causes a group to be classified as group_imbalanced in a later load-balance. This, in turn, forces a 1-task pull, and repeating this pattern ~25 times a sec ends up increasing CPU utilization by ~5% over the span of the benchmark. schedstats are somewhat noisy but seem to indicate the baseline had many more migrations at the NUMA level (test machine has SMT, MC, NUMA). Because of that I suspected b396f52326de ("sched/fair: Allow a small load imbalance between low utilisation SD_NUMA domains") but reverting that actually makes things worse. I'm still digging, though I'm slowly heading towards: https://www.youtube.com/watch?v=3L6i5AwVAbs