Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp505066imm; Fri, 28 Sep 2018 02:06:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV63G4phsehKllpXL06K2FzyoAYDOg0UcnsEaVOh1N8VGr97H8VqoUeM7GLK66lP7xk4udLYU X-Received: by 2002:a62:6414:: with SMTP id y20-v6mr15689198pfb.213.1538125588779; Fri, 28 Sep 2018 02:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538125588; cv=none; d=google.com; s=arc-20160816; b=zbygESNMHlu3LLGqMHZQOxYuUfHCrAkwt6HiuuW+/Amx6o+loeTSY+xZBY6mEqjwbC osBEqmehAXIz4ODY2SrleSpjNJAHCvDLnmVrwwCQ9d/FLjXKaKrkVhTsZsMoD5D1feSy BUpBMZWcmV+/hVrPkJwkN4rudUVaAAJcO/Bg5qXOoZT5/bVCgxRtjQZjyFczz8yASbLc Vj65RDUBsaw/Hje3SmbgmIzETSnrI0hrNdZApjR52lSdGlbCU0qM6KTiUt02NrliSft/ LAB6PMZWewNGiScrs+YWD16SEMde2Xnf7i0+7jkWs8ZGyA451UcBhMng55MvL24nzE5q vXqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ezt6Dr3U7YQtRBIxxvSDf2Nv8rQml+j/vjZD9R9YSMk=; b=YpCR2xsZY1eGL6xujwtv/IA00yR0HHuPD8p0x39JwhM4adgg7CpxvPe42YM8lQHW7Y rT6Hh3+8+xgxYl0p9ERcdygLODClxXAXILLUdr+f5cmJdgTONotn2yXN2bVMwle6dmNF qrl2ZTPb87WoG4EKS5RIxH0CcOag28glDKsiS8Wfnaw1cFTAV44lo84J0x+rA8IMolzD sz7rlJk0jNzDB+zQtkDNshfAUxWDZNSP4Zjra3IwLp3DrO8tv/PWRIrWJQOotQU4d+3M iwESspK77xqnFDfVugDD/JP7TbNKXgyNSF17fQu5EyUDHNp41e4CDVv7k8v25uAceiAa Hrvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9-v6si3981668plk.153.2018.09.28.02.06.12; Fri, 28 Sep 2018 02:06:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729221AbeI1P2O (ORCPT + 99 others); Fri, 28 Sep 2018 11:28:14 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:54029 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728944AbeI1P2O (ORCPT ); Fri, 28 Sep 2018 11:28:14 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1g5oiA-00049Y-Fl; Fri, 28 Sep 2018 11:05:22 +0200 Date: Fri, 28 Sep 2018 11:05:22 +0200 From: Kurt Kanzenbach To: Thomas Gleixner Cc: Will Deacon , Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Daniel Wagner , Peter Zijlstra , x86@kernel.org, Linus Torvalds , "H. Peter Anvin" , Boqun Feng , "Paul E. McKenney" , Mark Rutland Subject: Re: [Problem] Cache line starvation Message-ID: <20180928090521.mj5elgqnla6qcz2r@linutronix.de> References: <20180921120226.6xjgr4oiho22ex75@linutronix.de> <20180926125301.GE2979@brain-police> <20180927142547.ucgh5elb7pxs46dq@linutronix.de> <20180927144127.qdkem4juhztxdkdb@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, On Thu, Sep 27, 2018 at 04:47:47PM +0200, Thomas Gleixner wrote: > On Thu, 27 Sep 2018, Kurt Kanzenbach wrote: > > On Thu, Sep 27, 2018 at 04:25:47PM +0200, Kurt Kanzenbach wrote: > > > However, the issue still triggers fine. With stress-ng we're able to > > > generate latency in millisecond range. The only workaround we've found > > > so far is to add a "delay" in cpu_relax(). > > > > It might interesting for you, how we added the delay. We've used: > > > > static inline void cpu_relax(void) > > { > > volatile int i = 0; > > > > asm volatile("yield" ::: "memory"); > > while (i++ <= 1000); > > } > > > > Of course it's not efficient, but it works. > > I wonder if it's just the store on the stack which makes it work. I've seen > that when instrumenting x86. When the careful instrumentation just stayed > in registers it failed. Once it was too much and stack got involved it > vanished away. I've performed more tests: Adding a store to a global variable just before calling cpu_relax() doesn't help. Furthermore, adding up to 20 yield instructions (just like you did on x86) didn't work either. Thanks, Kurt