Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp481588ybk; Fri, 15 May 2020 05:56:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu5ETcdcaluflPzIOS1+fDFIdPKiEgcJ+zLzZ2sxYN2LwxaoZ41lEm1g1IfXO6QRkDc8xH X-Received: by 2002:a50:d9cb:: with SMTP id x11mr2643036edj.88.1589547362012; Fri, 15 May 2020 05:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589547362; cv=none; d=google.com; s=arc-20160816; b=rEMqiYDMhmt/mi7RglcejA0U0xT2NlvaoWI0A/6PTLfmg6WGXYtMfhFV47p7Of6TcG TDEVy5pjK2ZxfDJOBkoJbyoQ7HdCaUXZoNt6fUVabbMMaDwdDXKX/CD2tXAhzuoGc73z c+fYHvxRWNP6ObrFcVP353v4yi6gk4Yp0wuFp35VH9ZHRkdgAhdXSseoZcj/Wggss/7n 3oOrjkp+RFXnbeRdhT+RJip99zBLt89NUb2g2W3xDdW4o6TXGykOIrZlRUHpUQbxvbaj krh76iUdkKyqGquMsYIEpdV0EpQ7XRLCTRv+V1iUjYYphHVhbG/HBDHjodlnyfbqXtuL Y2SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Z+Jyvc8F629bU/MQ39LYHqG/QpmGLVqISbuPj5aTL40=; b=C1Jtdf+ckQTTnYGQamJSv2kjsUgHd7K+9FdIBXCucfR4iezormmOcQSDs3JSrdINA9 Ue8OXLo8gDLkfjpwmQU8OC+ITRAr1dTc0sBk+1IXOgvifQgTjG6FQIjhwGYO56kNKOq9 pN+klZrDxBA5vOrzIABAtV0sQyYy4MVj/ISvSkRiGYnAWxlkoBv1DTaQSu9Ug9XnsheH J+cY86y1iDDqE4jXhcpSQALVFxLxNWXJ+qk6exLLEJxvBgE7XsOlC+KKpNaSyCInPt8v 9JUk6gvKM+fRJ+IEPu4eS3Keuadge5l7YoCvub9ujFR24VwqTMGYG2wG+RuSZEc1BEeB hU+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=e+hvs8n9; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si1111970ejg.101.2020.05.15.05.55.39; Fri, 15 May 2020 05:56:01 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=e+hvs8n9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726189AbgEOMwN (ORCPT + 99 others); Fri, 15 May 2020 08:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726162AbgEOMwM (ORCPT ); Fri, 15 May 2020 08:52:12 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7329FC061A0C for ; Fri, 15 May 2020 05:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Z+Jyvc8F629bU/MQ39LYHqG/QpmGLVqISbuPj5aTL40=; b=e+hvs8n9Dg9ggBJp+KqoFUET0H TE7G3GkwOLilDJKeaCbMjHlSL/D5ETMzqn5faToSoSfVKXLEbhNwFxZ2GdvmS7bK57wwnv3k3YjTd xb3xecfKQu76MkGdigffM/5uD7RKKuu9OsrBHSooYg1zopCrW1AXz6BM1eCEMSYCiLgywFGsK4FRa ixsxT/5DUJzfnqiBRWHKLZY9GujDwK5J01IY5XxQjoD/q8lteWYIFvoEKhhufhKZYK5Jpl5xluVDY Klbqyt4n7yKOOSqvLgzfTShfW2LPWcRQM02qJaxEAfTedDlNEACPqsLE7v4uE7iec0Z4xaMezSp3z 9kAbxyDw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZZoK-0008NQ-0Q; Fri, 15 May 2020 12:51:32 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 86A4B300261; Fri, 15 May 2020 14:51:28 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 71825202E0F9C; Fri, 15 May 2020 14:51:28 +0200 (CEST) Date: Fri, 15 May 2020 14:51:28 +0200 From: Peter Zijlstra To: Mel Gorman Cc: Jirka Hladky , Phil Auld , Ingo Molnar , Vincent Guittot , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Valentin Schneider , Hillf Danton , LKML , Douglas Shakshober , Waiman Long , Joe Mario , Bill Gray Subject: Re: [PATCH 00/13] Reconcile NUMA balancing decisions with the load balancer v6 Message-ID: <20200515125128.GU2957@hirez.programming.kicks-ass.net> References: <20200507155422.GD3758@techsingularity.net> <20200508092212.GE3758@techsingularity.net> <20200513153023.GF3758@techsingularity.net> <20200514153122.GE2978@hirez.programming.kicks-ass.net> <20200515084740.GJ3758@techsingularity.net> <20200515112815.GT2957@hirez.programming.kicks-ass.net> <20200515122231.GL3758@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200515122231.GL3758@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 01:22:31PM +0100, Mel Gorman wrote: > On Fri, May 15, 2020 at 01:28:15PM +0200, Peter Zijlstra wrote: > > > + if (val & _TIF_POLLING_NRFLAG) > > > + goto activate; > > > > I'm completely confused... the result here is that if you're polling you > > do _NOT_ queue on the wake_list, but instead immediately enqueue. > > > > (which kinda makes sense, since if the remote CPU is idle, it doesn't > > have these lines in its cache anyway) > > > > Crap, I rushed this and severely confused myself about what is going Hehe, and here I though I was confused :-) > on. It is definitely the case that flipping this check does not give > any benefit. The patch shows a benefit but I'm failing to understand > exactly why. How I ended up here was perf indicating a lot of time spent > on smp_cond_load_acquire() which made me look closely at ttwu_remote() > and looking at function graphs to compare the different types of wakeups > and their timings. So the raisin we did this remote wakeup thing in the first place was that Oracle was having very heavy rq->lock cache-line contention. By farming off the enqueue to the CPU that was going to run the task anyway, the rq->lock (and the other runqueue structure lines) could stay in the CPU that was using them (hard). Less cacheline ping-pong, more win. The observation here is that if a CPU is idle, it's rq will not be contended.