From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BFD5FA372A for ; Wed, 16 Oct 2019 17:45:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D686A2082C for ; Wed, 16 Oct 2019 17:45:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="f2UDUNri" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D686A2082C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4Xc7T81z2c/OP4YIJVwzSf078N1ptiJ2yuHUb4dYsZ0=; b=f2UDUNriz7f679 EJqqEWaXKXA2kuOBMaatoJO3zDXPTxea0k+2TXYLq6YsVcaLfSkcEHnvK5efOzq5KWSMMYiGT40YH lJxUE5tMjCpEVmfgEyy3w4bLMoCkPQR1nngaEzkZdFnX+dkxIl7KE5/Ea09MgMGmNsKKeEJG4DR8r G5nhw7ep9rGO10xVNNvHaKUmSVFIWKZ4Eascnt4CCQhcrtnU6ICaVyK/879dCTmC40Z/iVNsqid9L k+++Sw7YrGkJIa9TUWL6wu34k2Qdepby1QtgAG2L9XuoHyHOfuq7x1evEYzQzJ++yJoUicqhC+7FA PnrN4dmUVMWCLSFz6LBg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKnMM-00029k-0d; Wed, 16 Oct 2019 17:45:18 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKnMJ-00029O-4a for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2019 17:45:16 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 807B530860BE; Wed, 16 Oct 2019 17:45:14 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-59.bos.redhat.com [10.18.17.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id B36495D9CD; Wed, 16 Oct 2019 17:45:13 +0000 (UTC) Subject: Re: [RFC PATCH 0/6 v2] Queued spinlocks/RW-locks for ARM To: Will Deacon , Sebastian Andrzej Siewior References: <20191013221310.30748-1-sebastian@breakpoint.cc> <20191016155755.66ges3ybn3awx45l@willie-the-truck> From: Waiman Long Organization: Red Hat Message-ID: Date: Wed, 16 Oct 2019 13:45:13 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20191016155755.66ges3ybn3awx45l@willie-the-truck> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 16 Oct 2019 17:45:14 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191016_104515_200986_1C1363DE X-CRM114-Status: GOOD ( 20.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Ingo Molnar , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Russell King Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 10/16/19 11:57 AM, Will Deacon wrote: > Hi Sebastian, > > On Mon, Oct 14, 2019 at 12:13:04AM +0200, Sebastian Andrzej Siewior wrote: >> I added support for queued-RW and -spinlocks for ARM. I followed Arnd's >> suggestion and added support for xchg() on 8bit and 16bit variables (V6 >> CPUs) via the SH implementation. This makes it possible to remove the >> current ticket based locking implementation. >> >> The numbers should be the same as in v1 posted here: >> http://lkml.kernel.org/r/20191007214439.27891-1-sebastian@breakpoint.cc >> >> The only thing changed is that patch #1-#3 wire up the missing xchg and >> the patches #4 and #5 additionally remove the old implementation while >> adding the missing bits for the queued implementation. > To be honest with you, I'm surprised that qspinlock is worth it for 32-bit > Arm. qrwlock makes sense because of fairness and starvation issues, but in > my benchmarks on arm64 tickets tended to perform at least as well for small > core counts, and I think that's largely going to be true for systems > running a 32-bit kernel. My own testing on qspinlocks in the past, at least on x86-64, is that it is comparable to ticket lock with one or 2 contending tasks if not better. When there are 3 contending tasks, qspinlock will then be a bit slower than ticket lock because the overhead of using the MCS node for queuing is showing up. Starting with 4 and more contending tasks, qspinlock starts to show its strength and performing better and better with more contending tasks. So if the target is 4 cores or less, there isn't too much to gain from using qspinlock. Lock function inlining probably has a bigger performance benefit here than switching to qspinlock. Just food for thought. Cheers, Longman _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel