Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp91141pxb; Tue, 17 Nov 2020 22:04:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7JE72ORgpwgfwjF5vK6XnKRmvhdz+AwnhvdFolV062oQW/T3rVySn1PhaN4CtDFnNVWQq X-Received: by 2002:a17:906:29db:: with SMTP id y27mr18536845eje.179.1605679457576; Tue, 17 Nov 2020 22:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605679457; cv=none; d=google.com; s=arc-20160816; b=zUG6wtYrvDW5R2AytT0msyBcfgDuh1DwXp4DhjFld/Fm3xXPs8UuHPAtFE8rcOJrkF W0Z1vKJQFIPSAEmDyCDpAtCY3teb1l2RpW+34OYf2pbqbX20r/O9iKYEB7HfZjlBCMd2 2vOlkI+duOqcXAGtcr1YRKqNVWoPKHQXSrvkeVnBX5AcY37J30AfBOFqWlMrEBMvjQEy WnNorYFsFdAawhgKWHoP/gq5oKk2TVFef5hhHC6S0qnfk3uP9W/sB/l7bT+u0YKA9dtN /6BvIvWn3uZZTNZL+IGyZtTBVxjEAVmOqFRB0eyQEMrNNeEg+lex/NxQkztkhSvzc91P tBwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=k6bbovKBIdYObMrzlE01IH8X839w87vytse15mzjpAo=; b=ft33RZT11xkiHGk7GqkODTm9QezrUkmTveld7PBYp3DimCb6g5lbq/YCDtQBMVxZ3D ETWwv+BHmYJ+zuCyE64yhkRL/ig/wtzQ9RBQ4M+52C8n2DPxFbCf7UE4IAo/Tctzbe64 +qZ7uz1HGjZE+W+r9htcKVP/xQEhy7EWIyuxUTqPVhHmYcbnos98ob8JfR2kaRe+7jfI 8QCw4leWmAhVMbHAy9CHB5TDa0EeFQOpdCwv0hRKD1u9pVRvDylNb1guVDeM1RsQLKhV XZOJ+wj6m6ZbLc5HeV5BG5U2DoGXMxP7BQvIQ7o+rhkDsJW0yAaT8x9HevisekVojpsb HyHw== ARC-Authentication-Results: i=1; mx.google.com; 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 bc4si11487820edb.348.2020.11.17.22.03.53; Tue, 17 Nov 2020 22:04:17 -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; 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 S1726325AbgKRF7E (ORCPT + 99 others); Wed, 18 Nov 2020 00:59:04 -0500 Received: from mx2.suse.de ([195.135.220.15]:56700 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgKRF7D (ORCPT ); Wed, 18 Nov 2020 00:59:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8A321AC24; Wed, 18 Nov 2020 05:59:02 +0000 (UTC) Date: Tue, 17 Nov 2020 21:35:56 -0800 From: Davidlohr Bueso To: Waiman Long Cc: Peter Zijlstra , 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: <20201118053556.3fmmtat7upv6dtvd@linux-p48b.lan> References: <20201118030429.23017-1-longman@redhat.com> <20201118030429.23017-6-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20201118030429.23017-6-longman@redhat.com> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Davidlohr