Received: by 10.213.65.68 with SMTP id h4csp3008070imn; Mon, 9 Apr 2018 12:37:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx487Z/0mHOKKyNCRBvL6TKkfkQp7nSNX/4lr2Nc9pheEhyus1F1YMYqTy+kKx7yD9S7Ky/N8 X-Received: by 2002:a17:902:758d:: with SMTP id j13-v6mr6043710pll.334.1523302662026; Mon, 09 Apr 2018 12:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523302661; cv=none; d=google.com; s=arc-20160816; b=SaJdBO4anePTndc1Iyvw1birefaDgmHqeXdA0lsI8/LHKyH0TsoOh3mknP/TtiAfdX 3mdyhXygfNx2WW5S11d0vzN4FahwUgzZXT+6GCDI5GoiJ2jkuXpYBqF0gRF7fy+vXvVm X5j4OZ8lKZAAdp+1QU5I26wKyFjQ1K/mbOcN3XqsRqlCrmb1yBYtX+/kRKkJG+YzM3kO DZ6KvujwdwC68/5XOrOyiTCL7YflZp81S9A4m5lOmc883nYHvGOWDySPq8mrYSG7Edgs A0VeRao5ANjDYx/YI0vyW/wmh0ReVTnnattBg9OhIpYlfBWJwgPCmikVS7+o+B21lkV2 Fpdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=ythQQ+O9oILQWyi9+7TVzXebU3XY/ipbsf4PJB0sm0U=; b=klrU9aYelQ5FVkNgSXXLSYrsOjviewsSxVWeVaCPswBKi2LpXnwK4p+xCpe+AsWZgb AXicbWH/qYqnjX9y6tU40Rb5eG+qt3K+wsEBLcxX6BQLTJ2S13zyZrc6aUUG1HpUIc4Q NGEwL8Z2dYqav5xg+voOCpTsTQCAhFSWAxCy17DepC3Aw105U2Bf3WOOyrctvP1lUZqw JJWev/UMD5DhZfn6DLCyMaonUtUtIw/HjBGeZ+klTLDPKJZo58YHpm6BacgX37oTqnIq +xDCQq9eADFG0Up4aTs3pLvbaXuxMcFpsJ5nSF8PlScdxd5MLrw6+VXcutSL8IFGC87Y Et0w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j62si613933pgc.175.2018.04.09.12.37.05; Mon, 09 Apr 2018 12:37:41 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754144AbeDITdX (ORCPT + 99 others); Mon, 9 Apr 2018 15:33:23 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46220 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753056AbeDITdW (ORCPT ); Mon, 9 Apr 2018 15:33:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3F4D34068024; Mon, 9 Apr 2018 19:33:22 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-164.bos.redhat.com [10.18.17.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0617F215CDC6; Mon, 9 Apr 2018 19:33:21 +0000 (UTC) Subject: Re: [PATCH 02/10] locking/qspinlock: Remove unbounded cmpxchg loop from locking slowpath To: Will Deacon Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peterz@infradead.org, mingo@kernel.org, boqun.feng@gmail.com, paulmck@linux.vnet.ibm.com, catalin.marinas@arm.com References: <1522947547-24081-1-git-send-email-will.deacon@arm.com> <1522947547-24081-3-git-send-email-will.deacon@arm.com> <20180409105835.GC23134@arm.com> <20180409145409.GA9661@arm.com> From: Waiman Long Organization: Red Hat Message-ID: <5e7211d4-43f0-297e-dbbc-8e87721f96b8@redhat.com> Date: Mon, 9 Apr 2018 15:33:21 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180409145409.GA9661@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 09 Apr 2018 19:33:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 09 Apr 2018 19:33:22 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/09/2018 10:54 AM, Will Deacon wrote: > >>> I am not against this patch, but we certainly need to find out a way to >>> bring the performance number up closer to what it is before applying >>> the patch. >> We certainly need to *understand* where the drop is coming from, because >> the two-threaded case is still just a CAS on x86 with and without this >> patch series. Generally, there's a throughput cost when ensuring fairness >> and forward-progress otherwise we'd all be using test-and-set. > Whilst I think we still need to address my questions above, I've had a > crack at the diff below. Please can you give it a spin? It sticks a trylock > on the slowpath before setting pending and replaces the CAS-based set > with an xchg (which I *think* is safe, but will need to ponder it some > more). > > Thanks, > > Will > Unfortunately, this patch didn't help. pending count = 777 queuing count = 9,991,272 locking rate = 4,087 kop/s -Longman