Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5225685ybl; Tue, 4 Feb 2020 09:55:54 -0800 (PST) X-Google-Smtp-Source: APXvYqwRBpli1kb2IDBNH5jTKvv4awMrfHrlerP+pNzN+EYBtALccUa79ymPhM+pedaKCAqGt+Iw X-Received: by 2002:a9d:63d6:: with SMTP id e22mr22971082otl.72.1580838954708; Tue, 04 Feb 2020 09:55:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580838954; cv=none; d=google.com; s=arc-20160816; b=em5LJUctGJROfN8FYluIqHCNm2ezBpZF1WvNFDdCXDGFPYGxtQDF1ADTMCMukYwkCG 28qXPzNb6FlGnkSYlSBKOKofw7IRWi/njw12vAcMZtNjm2rEaMNkkLi/yFe00a87qRHa pngsogDxRE4Oh37IsURLq85Zzi7o0oq3aCltYH/EGmkLQ+q9JacZxqxWVNTetA93sTmI FyirQgybrNovM5MEw+nxHPD+YwS7XtSED+LjUxiEvQyBNRhTOKtwonDa0YSFii618PiV 9hT9TC3uHphbhdX/uur+gWO9hm29v26r6vX+FC6uewgyBubG2BS42Fb2Ku2xYaivrCov /wxg== 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=/K8bkH1tluP7AqL7A5f3qlqtdLKkacRQXpV1VnbEX58=; b=aVld/X1YIiQBPISfBAxZDjYiSALTbjhzeIrereunAuCfEnsdunNV+DfgcUehXafDa1 uB+lSU4VAu6nRKOtX++R4NiOKxlhTgR5L4tIXs9OYVe3Liyrx2dEIbbI78Z2zCzpcRym OXOXQoqyfp0lp3JzqOk70MGvVxVkrNcdgtWH/N3SAjeIzfs1buyCgz0EQrUQH60/EeT5 E1dl6jR0ezrx1+cy9A+FBvJ5MwvVRlrv2n6umOB+wTFWJyMv1AN4mzCkwr1e/mtOLzCk FWjwMVnXNLVteJNYfsl07yc+rvaDYZ+qxsyC5bXubt9CbxytVSjP9lchOnGlcpflrrbC 6IHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=CbAgUNM8; 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 m19si11960172otq.40.2020.02.04.09.55.40; Tue, 04 Feb 2020 09:55:54 -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-2019-08-05 header.b=CbAgUNM8; 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 S1727443AbgBDRys (ORCPT + 99 others); Tue, 4 Feb 2020 12:54:48 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:46590 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727359AbgBDRyr (ORCPT ); Tue, 4 Feb 2020 12:54:47 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 014HrFVZ192141; Tue, 4 Feb 2020 17:53:56 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-2019-08-05; bh=/K8bkH1tluP7AqL7A5f3qlqtdLKkacRQXpV1VnbEX58=; b=CbAgUNM8xdGO+4tR+vkDHikxaGnulHiTHVcPlTr45h1WaN+kHVZ93QdL3KjgbaeUemjE s5gJb/Ezs6mklvvIcvbbGHSRaAvtu5/pLiFFQxnal7DNdfdbRR/QR/MZ1O5t9MbwJ1Nz yCpfLEezeXvFO+2x170eFuhc1995C39LSCnEfhe8eFLIAZHo5qf/S+1YuepRum6eE1ok ifMak7JJHYO/JD13IxXFalU+ON4G7Gsuuzz+7coaqerRYOc/d4S9pzR+U9ybbkisN1B5 7zJJkm3adUxRPfM6HLyYTa28L+zu3gYeShH1yn1i0JBWGPMFFBeGsS1hlcSK57gRcyTD 2w== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2xw0ru8ddp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Feb 2020 17:53:56 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 014HrloE163721; Tue, 4 Feb 2020 17:53:56 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2xxvusa5p5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Feb 2020 17:53:54 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 014HrngU027321; Tue, 4 Feb 2020 17:53:49 GMT Received: from [10.11.111.157] (/10.11.111.157) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 04 Feb 2020 09:53:48 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH v8 4/5] locking/qspinlock: Introduce starvation avoidance into CNA From: Alex Kogan In-Reply-To: Date: Tue, 4 Feb 2020 12:53:46 -0500 Cc: Peter Zijlstra , linux@armlinux.org.uk, Ingo Molnar , Will Deacon , Arnd Bergmann , linux-arch@vger.kernel.org, linux-arm-kernel , linux-kernel@vger.kernel.org, Thomas Gleixner , Borislav Petkov , hpa@zytor.com, x86@kernel.org, Hanjun Guo , Jan Glauber , Steven Sistare , Daniel Jordan , dave.dice@oracle.com Content-Transfer-Encoding: quoted-printable Message-Id: References: <8D3AFB47-B595-418C-9568-08780DDC58FF@oracle.com> <714892cd-d96f-4d41-ae8b-d7b7642a6e3c@redhat.com> <1669BFDE-A1A5-4ED8-B586-035460BBF68A@oracle.com> <20200125111931.GW11457@worktop.programming.kicks-ass.net> <20200203134540.GA14879@hirez.programming.kicks-ass.net> <6d11b22b-2fb5-7dea-f88b-b32f1576a5e0@redhat.com> <20200203152807.GK14914@hirez.programming.kicks-ass.net> <15fa978d-bd41-3ecb-83d5-896187e11244@redhat.com> <83762715-F68C-42DF-9B41-C4C48DF6762F@oracle.com> <20200204172758.GF14879@hirez.programming.kicks-ass.net> To: Waiman Long X-Mailer: Apple Mail (2.3445.104.11) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9521 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=857 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2002040119 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9521 signatures=668685 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=907 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2002040119 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Feb 4, 2020, at 12:39 PM, Waiman Long wrote: >=20 > On 2/4/20 12:27 PM, Peter Zijlstra wrote: >> On Tue, Feb 04, 2020 at 11:54:02AM -0500, Alex Kogan wrote: >>>> On Feb 3, 2020, at 10:47 AM, Waiman Long = wrote: >>>>=20 >>>> On 2/3/20 10:28 AM, Peter Zijlstra wrote: >>>>> On Mon, Feb 03, 2020 at 09:59:12AM -0500, Waiman Long wrote: >>>>>> On 2/3/20 8:45 AM, Peter Zijlstra wrote: >>>>>>> Presumably you have a workload where CNA is actually a win? That = is, >>>>>>> what inspired you to go down this road? Which actual kernel lock = is so >>>>>>> contended on NUMA machines that we need to do this? >>> There are quite a few actually. files_struct.file_lock, = file_lock_context.flc_lock >>> and lockref.lock are some concrete examples that get very hot in = will-it-scale >>> benchmarks.=20 >> Right, that's all a variant of banging on the same resources across >> nodes. I'm not sure there's anything fundamental we can fix there. Not much, except gain that 2x from a better lock. >>=20 >>> And then there are spinlocks in __futex_data.queues,=20 >>> which get hot when applications have contended (pthread) locks =E2=80=94= =20 >>> LevelDB is an example. >> A numa aware rework of futexes has been on the todo list for years :/ > Now, we are going to get that for free with this patchset:-) Exactly!! >>=20 >>> Our initial motivation was based on an observation that kernel = qspinlock is not=20 >>> NUMA-aware. So what, you may ask. Much like people realized in the = past that >>> global spinning is bad for performance, and they switched from = ticket lock to >>> locks with local spinning (e.g., MCS), I think everyone would agree = these days that >>> bouncing a lock (and cache lines in general) across numa nodes is = similarly bad. >>> And as CNA demonstrates, we are easily leaving 2-3x speedups on the = table by >>> doing just that with the current qspinlock. >> Actual benchmarks with performance numbers are required. It helps >> motivate the patches as well as gives reviewers clues on how to >> reproduce / inspect the claims made. >>=20 > I think the cover-letter does have some benchmark results listed. To clarify on that, I _used to include benchmark results in the cover = letter=20 for previous revisions. I stopped doing that as the changes between = revisions were rather minor =E2=80=94 maybe that is the missing part? If so, my = apologies, I can certainly publish them again. The point is that we have numbers for actual benchmarks, plus the kernel = build robot has sent quite a few reports on positive improvements in the = performance of AIM7 and other benchmarks due to CNA (plus ARM folks noticed = improvement in their benchmarks, although I think those were mostly microbenchmarks.=20= Yet, it is evident that the improvements are cross-platform.) Regards, =E2=80=94 Alex=