Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp937841ima; Fri, 1 Feb 2019 13:26:58 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia8MgfJ8gulHPryAied+/XTzwrhUA1Gjdln9CcgjaaLpWFXWvKDCghxiDj4mw5+JNiMHBI3 X-Received: by 2002:a63:a91a:: with SMTP id u26mr3806509pge.349.1549056418479; Fri, 01 Feb 2019 13:26:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549056418; cv=none; d=google.com; s=arc-20160816; b=coro+rPQKJSdZ+3kipVepHY7r31xwVaz2ylaBpBtxwfKtG6WFQL2rjb1qRdx+tY4e3 GbkifG/5/vE/KNuxSRFfqgaI9edDltQ5P9P/z3VJ86Yzim4ESB7ZKYOqpJrL23kutqO5 M6xj0fg9EUkxQ+37Z9ngXmAJ4qG4G/LIeHEQEMDqWJ+Oj5a8rO0iaF2xvrsueUEpy+U2 pBBe8LvusC1lbCWqg0LjQsJjGmNgGnJl+JuqmicFMocvNI0QnDWLNa6q+i7wg2NpeffH H6f9Xgw4ghAxPHXvfAHWxqsZ2R0SArysm2oBrbOzJuYJvgRavt33tOlDTix5pDRScrEq AmdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=dovBxOd9J5ZjP2z51d4DjxFghwISXIsl79OcbtFXKvA=; b=PaeD13pIIaoXpoQyEBYWaJJp2/fMiZEm+ENv+np0SDcy1BossWZ632+pnxJ9q0LJTt T45qHz+/mu3UzIr4v0oXe3V5D3ScLtG0FE9cUhevwrp/GuudAkvdB/phOvDGfeo5fJHE FITePVbG+P1MLRBo7Bcnk1BCWkmS6/WkVRrj8R9j5UGTL1Z0aY/X61mGXAPQ5SYIsSwz D+Uyk7es7GdaM2DiF8MqPG8rmn8yLaU3YcFc67TCJYoFfAf79fphgjItx+2Fa6u7EOUT 0uQIGNEitg/LYRlQdTzNrPGKE5j8bcxLsizRdTxDlIR37P+gg+Wepl6dJqRYKvyZhBkP nNJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=DmhbAQai; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si7785552pgm.79.2019.02.01.13.26.43; Fri, 01 Feb 2019 13:26:58 -0800 (PST) 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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=DmhbAQai; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726284AbfBAV0h (ORCPT + 99 others); Fri, 1 Feb 2019 16:26:37 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:58160 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbfBAV0h (ORCPT ); Fri, 1 Feb 2019 16:26:37 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x11LOJ7i086365; Fri, 1 Feb 2019 21:26:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2018-07-02; bh=dovBxOd9J5ZjP2z51d4DjxFghwISXIsl79OcbtFXKvA=; b=DmhbAQaiQPz1ohrEIV8ysPPzwMrVObCM+CNmhFqT1klQUU8cLvNLAAsNkqSX15qdx1eS TDAvKoxswxVSIlb3kxxGEdITpaCdswg8cYw9Z3sabTBU9APfwTNDRTdh41hQH4p0hlq5 E9MjVSDCTn098zOEdY1RxeplbEDItfVk/PTNtsuD3GE1ztkJGMOFwikPUWpjeJezHLRH dU2gdiqEc+aGrvJnQONQ4ivhhzjuJ6nZ4OQWOP25IdEpCB85ZqNZk+awW/drHwXAA3Sw 4QdBXrc+eTpF70MxI5j4qju9V3rWA/ZwKLl5edixQPUikMW7Yo5ifVn89WO1JPVeLUyv +w== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2q8d2es53a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 01 Feb 2019 21:26:19 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x11LQDiM017941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 1 Feb 2019 21:26:13 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x11LQ9EV030487; Fri, 1 Feb 2019 21:26:09 GMT Received: from [10.39.246.40] (/10.39.246.40) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 01 Feb 2019 13:26:08 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: [PATCH 2/3] locking/qspinlock: Introduce CNA into the slow path of qspinlock From: Alex Kogan In-Reply-To: <2c8aabab-1bb0-0708-94c4-305fd860609e@redhat.com> Date: Fri, 1 Feb 2019 16:26:06 -0500 Cc: linux@armlinux.org.uk, peterz@infradead.org, mingo@redhat.com, will.deacon@arm.com, arnd@arndb.de, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Steven Sistare , Daniel Jordan , dave.dice@oracle.com, Rahul Yadav Content-Transfer-Encoding: quoted-printable Message-Id: <62BE66CF-1CFA-4921-B2FF-70D5460845D6@oracle.com> References: <20190131030136.56999-1-alex.kogan@oracle.com> <20190131030136.56999-3-alex.kogan@oracle.com> <2c8aabab-1bb0-0708-94c4-305fd860609e@redhat.com> To: Waiman Long X-Mailer: Apple Mail (2.3259) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9154 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=847 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902010151 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jan 31, 2019, at 12:38 PM, Waiman Long wrote: >=20 > On 01/30/2019 10:01 PM, Alex Kogan wrote: >> In CNA, spinning threads are organized in two queues, a main queue = for >> threads running on the same socket as the current lock holder, and a >> secondary queue for threads running on other sockets. For details, >> see = https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__arxiv.org_abs_1810.= 05600&d=3DDwIFaQ&c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=3DHvhk3= F4omdCk-GE1PTOm3Kn0A7ApWOZ2aZLTuVxFK4k&m=3DRdsRU4oU2j-_hNG5kDC5ZEE_XHikl3Q= LNttCaBde3QU&s=3DNQ840S1lz53Cq7AnOlPWdnjZI7_Ic3rfYsf-w2aYus4&e=3D. >>=20 >> Note that this variant of CNA may introduce starvation by = continuously >> passing the lock to threads running on the same socket. This issue >> will be addressed later in the series. >>=20 >> Signed-off-by: Alex Kogan >> Reviewed-by: Steve Sistare >=20 > Just wondering if you have tried include PARVIRT_SPINLOCKS option to = see > if that patch may screw up the PV qspinlock code. No, I haven=E2=80=99t yet. The idea was to make it work for non-PV systems first, and then extend = to PV. >=20 > Anyway, I do believe your claim that NUMA-aware qspinlock is good for > large systems with many nodes. However, all these extra code are > overhead for small systems that have a single node/socket, for = instance. >=20 > I will support doing something similar to what had been done to = support > PV qspinlock. IOW, a separate slowpath function that can be patched to > become the default depending on the system being run on or a kernel = boot > option setting. >=20 > I would like to keep the core slowpath function simple and easy to > understand. So most of the CNA code should be encapsulated into some > helper functions and put into a separated file. Sounds good.=20 I think it should be pretty straightforward to encapsulate the CNA code = and do what you suggest. We will look into that. Thanks, =E2=80=94 Alex >=20 > Thanks, > Longman >=20