Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1317045pxb; Fri, 20 Nov 2020 06:46:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyilLhmbDtiqGS772IoEvmtMnQrxvO+qGuk/dYqyxsg9UrEH2FFw11EIc9p3hJxUw0TrmwS X-Received: by 2002:a17:906:5396:: with SMTP id g22mr10677702ejo.111.1605883587215; Fri, 20 Nov 2020 06:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605883587; cv=none; d=google.com; s=arc-20160816; b=pSoSneiA/nXvpZV/0+Ai6UiLt02IgEAf3m4Ma8v7mQTyIUwdJZ6ECAaVBGLX/ryaix oSbJzZrN9scRPYqq0aeLPpj/Z676DWGdcfMvX6kkbls/JRk4mH8X6jhZxjOp6pRIoNIS /q0d4mOAyjPK3/sqmSOock8Td9XvPsfHQsi/PyeIG5HZN5QPnLgDm6Jm3f4FX01FwELO xSSyhJmHaVJIk3uMB2bh8buHFhPynTZedg/PzPzIMyDeUQyqhmNhpy7+6LEqip8aOYzI F3WS3N7rbCQlWfOgmj5+piaSpHhU6wOD40AuXCA6R00CkFq9/KdA5V/4pDsKlsQ7Ya21 PwJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zVm/SCH2gW0dx0JpynqROEWKXznlIIRkjjY5i7qnbLY=; b=pMvCXR2UwpMM+uqp+xnzGAZPRP/2HUlEIcrHkNNwaAeg+4j7XNLFgl+j1bNCUTVXng 3gTiQ1NUhAl8Rx9CuBH818cbCw0V+6r5tk476iUcgfWU86+f24bAccppPPjzagIuKZA0 8onaI+NBqvwWf33e0Sl3qrFe8A77708Rs8+ULe2ifXyxgRWBYa9/yUpVnKfArFgNPxJg vtZzDXnH5VKCqZq32phLlp1OX4q+qvqEDRnhp3usxNwNmXdeeIjyuQ3jqtMX5lKFo03V JwDAEJglRVVmAmquEoXm5bU2I37ZsFpx7wniaOwvfO8lvwV3sWeJo1wd8pESgFmEG7bh LUpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jzP5MyEL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si2406962edi.183.2020.11.20.06.46.03; Fri, 20 Nov 2020 06:46:27 -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=@infradead.org header.s=casper.20170209 header.b=jzP5MyEL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727987AbgKTOoQ (ORCPT + 99 others); Fri, 20 Nov 2020 09:44:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727782AbgKTOoQ (ORCPT ); Fri, 20 Nov 2020 09:44:16 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B4A7C0613CF for ; Fri, 20 Nov 2020 06:44:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zVm/SCH2gW0dx0JpynqROEWKXznlIIRkjjY5i7qnbLY=; b=jzP5MyELNOdaH5GRCvIj34NPLI mKZx9Hc3lTj2VoOl3bxQmM/kecr1Q6k+y1jKQC8r8QqW97rqrTFkRcu3As+zn7A1M+dDBRlaDPyRF IOJDxxc1pM+hdgX/VUrxeSws7srRH9J/YLZ6VYpAWPheSLyhwC+kY7UnR7DStttsoPcOuK7neD17N UTSLGZEftJNf9EhMqyGHEeYj6caIXc2b//Qb7IK3oqs7WC6KE6EEEutTRuPVrH6k35p5m8nwsutoD H480BGUJO40BWE+f4opPk/C5Gyrffyz39MUO4/TTu2jpSAQc41x7l2ruvidwoMhFsCXxSW/FJwz6S ikoN67Iw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg7dy-0007W0-Fi; Fri, 20 Nov 2020 14:44:10 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 93D25300B22; Fri, 20 Nov 2020 15:44:08 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 86103201B4C51; Fri, 20 Nov 2020 15:44:08 +0100 (CET) Date: Fri, 20 Nov 2020 15:44:08 +0100 From: Peter Zijlstra To: Davidlohr Bueso Cc: Waiman Long , Ingo Molnar , Will Deacon , linux-kernel@vger.kernel.org, Phil Auld Subject: Re: [RFC PATCH 5/5] locking/rwsem: Remove reader optimistic spinning Message-ID: <20201120144408.GF3040@hirez.programming.kicks-ass.net> References: <20201118030429.23017-1-longman@redhat.com> <20201118030429.23017-6-longman@redhat.com> <20201118053556.3fmmtat7upv6dtvd@linux-p48b.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201118053556.3fmmtat7upv6dtvd@linux-p48b.lan> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.