Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1628247pxb; Fri, 20 Nov 2020 14:43:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7m6FmiFB3+SXHQLhsHJ+WZad/9P+0z/yMbNL8reGM/Aer+/sdRiUw+yuhWuWUJPhpgJlc X-Received: by 2002:a17:906:a011:: with SMTP id p17mr35368310ejy.119.1605912199357; Fri, 20 Nov 2020 14:43:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605912199; cv=none; d=google.com; s=arc-20160816; b=DGQbyWH685nCER2Oty2AkkzaR4p4R52Yf0f8eEl8/bmdtp6+/KNf0hDXghLuYYORWO EebwtkaiqidsNM8NV+nNrdb8T95CyMCWKc50Gpoa5s7GZA40AQrWrCUWqJbMi0zZC4Q1 cvvPcGUKLda+XYGIJ2xL16TScNnZtzhclHYH+L9uzhkHh/vpemuBQIu2WShFHsdv35qM WnLvGYe7mH+27jMEfxClzD8Sk4wuau2zZqZ4oOzqhqkGPtZVk62mF2XTb5sgH40yvCFR sWnVp1H5Brm90W12kv1CmrYWFhFN2w6V0xv0EMgfQjRkdKB8lqrEfV91UjWRwVaGEKbd yMGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=K3El2hXRpQVR3PZtynZGSoJC07Ftno34H/6B207e9Sg=; b=nwarIpXI/0J3jYrQrnv66SLwj6bh2rrQs+VCchFELMwdULVuup65wyvnFoeUPysIDo WI4ysbYSjl+ZOEPhjKSIAOWjHOhLmQN+l7ea/AMqp6OPQlkvOLBJtxV/BULy6neeuS0I RFkkPqm7esw6ajBD7w7AEM9uFRQix+K1mKvoDG46roj5iYifXs8DHpcfZJFQrbe8lDs+ oxmt9LyWRkeqDazgIJ1S7pIRPKTaRYn829Iz3ARA3lyt4wDmWbWeEfmzkN1SuRKAwC/Q g1BIRXiG5z85UMrppE+P1fw5+EoqI0I+Desylh/T0ZazHxPVSfo5RqkJVBV/vSWzR1AY 2SZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IiEqQVWS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si2602211edp.98.2020.11.20.14.42.56; Fri, 20 Nov 2020 14:43:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IiEqQVWS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728937AbgKTWj4 (ORCPT + 99 others); Fri, 20 Nov 2020 17:39:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:55474 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728470AbgKTWj4 (ORCPT ); Fri, 20 Nov 2020 17:39:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605911994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K3El2hXRpQVR3PZtynZGSoJC07Ftno34H/6B207e9Sg=; b=IiEqQVWS4Vc3Z0sLBbT+0SqD+cMo2M7CMiZWhvVKAdNgWHaDCdr6uyLZvQW02AjcLyos1E U9wqncZh1z/dzb2pSJPzM9Zzup1ZkW0R56N/0NyihDirVm518TIrGnHsbYlmdl6tLgaPuq 5qFlU5R+eHOxemovkWvNg0en9QO9Znw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-_OsoQEVgP2SmTPA7clkpMg-1; Fri, 20 Nov 2020 17:39:52 -0500 X-MC-Unique: _OsoQEVgP2SmTPA7clkpMg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C3DC318B613D; Fri, 20 Nov 2020 22:39:51 +0000 (UTC) Received: from llong.remote.csb (ovpn-119-225.rdu2.redhat.com [10.10.119.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19F025C1D5; Fri, 20 Nov 2020 22:39:51 +0000 (UTC) Subject: Re: [RFC PATCH 5/5] locking/rwsem: Remove reader optimistic spinning To: Peter Zijlstra , Davidlohr Bueso Cc: Ingo Molnar , Will Deacon , linux-kernel@vger.kernel.org, Phil Auld References: <20201118030429.23017-1-longman@redhat.com> <20201118030429.23017-6-longman@redhat.com> <20201118053556.3fmmtat7upv6dtvd@linux-p48b.lan> <20201120144408.GF3040@hirez.programming.kicks-ass.net> From: Waiman Long Organization: Red Hat Message-ID: <90e1bc43-fead-904f-3bed-a2fbadf9c1ac@redhat.com> Date: Fri, 20 Nov 2020 17:39:50 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201120144408.GF3040@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/20/20 9:44 AM, Peter Zijlstra wrote: > On Tue, Nov 17, 2020 at 09:35:56PM -0800, Davidlohr Bueso wrote: >> On Tue, 17 Nov 2020, Waiman Long wrote: >> >>> The column "CS Load" represents the number of pause instructions issued >>> in the locking critical section. A CS load of 1 is extremely short and >>> is not likey in real situations. A load of 20 (moderate) and 100 (long) >>> are more realistic. >>> >>> It can be seen that the previous patches in this series have reduced >>> performance in general except in highly contended cases with moderate >>> or long critical sections that performance improves a bit. This change >>> is mostly caused by the "Prevent potential lock starvation" patch that >>> reduce reader optimistic spinning and hence reduce reader fragmentation. >>> >>> The patch that further limit reader optimistic spinning doesn't seem to >>> have too much impact on overall performance as shown in the benchmark >>> data. >>> >>> The patch that disables reader optimistic spinning shows reduced >>> performance at lightly loaded cases, but comparable or slightly better >>> performance on with heavier contention. >> I'm not overly worried about the lightly loaded cases here as the users >> (mostly thinking mmap_sem) most likely won't care for real workloads, >> not, ie: will-it-scale type things. >> >> So at SUSE we also ran into this very same problem with reader optimistic >> spinning and considering the fragmentation went with disabling it, much >> like this patch - but without the reader optimistic lock stealing bits >> you have. So far nothing has really shown to fall out in our performance >> automation. And per your data a single reader spinner does not seem to be >> worth the added complexity of keeping reader spinning vs ripping it out. > I'm fine with ripping it... It was finnicky to begin with. > Good to know. I am going to sent out v2 with some update commit logs and some !CONFIG_RWSEM_SPIN_ON_OWNER fixes. Cheers, Longman