Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7860471ybi; Thu, 6 Jun 2019 02:43:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEdxht8/wUpzcIIJsq5rpdENVthPHObRKdVSNm60GqlD74wwqv8gH+esNZiIQuO+iqvhYC X-Received: by 2002:a63:205b:: with SMTP id r27mr2599613pgm.330.1559814219488; Thu, 06 Jun 2019 02:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559814219; cv=none; d=google.com; s=arc-20160816; b=ky+bEfZw3+L0BezY0Cz/I3Zt8KkYPg7SK9NoDs/pqhvkn1nMUThi6aBuKLbaEnh/rc QNmTdJ7ipfhWb/wqm8GW6UUYXCD54p4cn7A8KsAKp4mJSP3kw/qxIZCvN9/AcZcvGFAi DgMRGeQbyK9hQVvf9GoJUFsJHphJS7VZNH9RIJOKZnAQIGpuZ52Fv8IVRVtm7lVQ/M+B 4ERCGEf4sHRsr7YKLGhAHefxSvrCe8MUJ0KqwgmUSCKWw9E9YUE7laZNhUMMt24F1IDp FBLlkxKwTJAjo36pXfDOtRD67u/Yr/yfHdGQk4VbBlvhOW3OBT9NACahZ/+uiZ5KxoJa byiw== 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=MHqBiXo71U7W2nJ7Cpi7jzsYidFTIH8LNOvCK3909CE=; b=wxZuV8TYu+kVNrozb++D0mah3tnXRhZBhsCsymuTChXYxvW21dkipxfqGVTVa06ra8 faxz9nFI7SANhwsS9eg0Tmbu+n7cGqXTMHHmXJKZw2U4EykQ6euI1vAA+Owy6VjkTpNL AK7C37APwaOK8SGRg7lW5npQYV7MHnefcNEBYO5T7P3BISifo4TQnvRw4F04Dc7g3AJc q8OSH7aq4BmwyW0pNEKZJGbEwFBomqqv7DHtu+MeeYOrjhTXIsVjCJsWPrYEPQoUwS9o h9jVq2tGmsyTexL9qvAZpHMtFVB5ZXNCw344taKNzALC+4sH3HxTe9c02kdXqgvtpiu5 JcyA== 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 f1si1709489pgi.432.2019.06.06.02.43.22; Thu, 06 Jun 2019 02:43:39 -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 S1728023AbfFFJl6 (ORCPT + 99 others); Thu, 6 Jun 2019 05:41:58 -0400 Received: from foss.arm.com ([217.140.101.70]:44012 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727740AbfFFJl6 (ORCPT ); Thu, 6 Jun 2019 05:41:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E5C26341; Thu, 6 Jun 2019 02:41:57 -0700 (PDT) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8E2E53F690; Thu, 6 Jun 2019 02:41:56 -0700 (PDT) Date: Thu, 6 Jun 2019 10:41:54 +0100 From: Will Deacon To: Jan Glauber Cc: Linus Torvalds , Jan Glauber , Linux List Kernel Mailing , Catalin Marinas , Linux ARM , Jayachandran Chandrasekharan Nair Subject: Re: [PATCH] lockref: Limit number of cmpxchg loop retries Message-ID: <20190606094154.GB6795@fuggles.cambridge.arm.com> References: <20190605134849.28108-1-jglauber@marvell.com> <20190606080317.GA10606@hc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190606080317.GA10606@hc> User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 06, 2019 at 08:03:27AM +0000, Jan Glauber wrote: > On Wed, Jun 05, 2019 at 01:16:46PM -0700, Linus Torvalds wrote: > > On Wed, Jun 5, 2019 at 6:49 AM Jan Glauber wrote: > > > > > > Add an upper bound to the loop to force the fallback to spinlocks > > > after some time. A retry value of 100 should not impact any hardware > > > that does not have this issue. > > > > > > With the retry limit the performance of an open-close testcase > > > improved between 60-70% on ThunderX2. > > > > Btw, did you do any kind of performance analysis across different > > retry limit values? > > I tried 15/50/100/200/500, results were largely identical up to 100. > For SMT=4 a higher retry value might be better, but unless we can add a > sysctl value 100 looked like a good compromise to me. Perhaps I'm just getting confused pre-morning-coffee, but I thought the original complaint (and the reason for this patch even existing) was that when many CPUs were hammering the lockref then performance tanked? In which case, increasing the threshold as the number of CPUs increases seems counter-intuitive to me because it suggests that the larger the system, the harder we should try to make the cmpxchg work. Will