From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2C2AC63777 for ; Wed, 18 Nov 2020 05:59:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABA8E246B4 for ; Wed, 18 Nov 2020 05:59:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726355AbgKRF7E (ORCPT ); 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