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=-18.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 8775BC433E6 for ; Wed, 10 Feb 2021 15:17:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5397064DEC for ; Wed, 10 Feb 2021 15:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232002AbhBJPRv (ORCPT ); Wed, 10 Feb 2021 10:17:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50046 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231968AbhBJPRS (ORCPT ); Wed, 10 Feb 2021 10:17:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612970151; 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=fUmvVMvAvYIwqlomGlCTTR4gDfNwX2CSnq9kV4m6kT4=; b=XDkQFjZo1mut/ApoosyI9wP71ibvE2gySVdxU6r5p6UzNRcH8zOeypuLiHUPjATd3Vky2p 4QTBKAza/qaaLf/IK2+iaQe9oHj4z2IP34NZt8QIq0/CR/oO9dymvhO+1E89Gz/rvfo9VI 8NYW2KRB4Vj3uyAni5gNQCD6cI1PpS4= 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-76-yxmXs3rGO_iKldY_Cl-SBA-1; Wed, 10 Feb 2021 10:15:47 -0500 X-MC-Unique: yxmXs3rGO_iKldY_Cl-SBA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 059D1BBEE8; Wed, 10 Feb 2021 15:15:45 +0000 (UTC) Received: from llong.remote.csb (ovpn-115-20.rdu2.redhat.com [10.10.115.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7712960657; Wed, 10 Feb 2021 15:15:39 +0000 (UTC) Subject: Re: [PATCH v2 06/28] locking/rwlocks: Add contention detection for rwlocks From: Waiman Long To: Ben Gardon , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , Peter Xu , Sean Christopherson , Peter Shier , Peter Feiner , Junaid Shahid , Jim Mattson , Yulei Zhang , Wanpeng Li , Vitaly Kuznetsov , Xiao Guangrong , Ingo Molnar , Will Deacon , Peter Zijlstra , Davidlohr Bueso References: <20210202185734.1680553-1-bgardon@google.com> <20210202185734.1680553-7-bgardon@google.com> <6287ff89-d869-e5ed-3e64-11621cc4796a@redhat.com> Organization: Red Hat Message-ID: <058d416d-e137-056f-e81b-823cd770a3ff@redhat.com> Date: Wed, 10 Feb 2021 10:15:39 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <6287ff89-d869-e5ed-3e64-11621cc4796a@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/9/21 10:32 PM, Waiman Long wrote: > On 2/2/21 1:57 PM, Ben Gardon wrote: >> rwlocks do not currently have any facility to detect contention >> like spinlocks do. In order to allow users of rwlocks to better manage >> latency, add contention detection for queued rwlocks. >> >> CC: Ingo Molnar >> CC: Will Deacon >> Acked-by: Peter Zijlstra >> Acked-by: Davidlohr Bueso >> Acked-by: Waiman Long >> Acked-by: Paolo Bonzini >> Signed-off-by: Ben Gardon >> --- >>   include/asm-generic/qrwlock.h | 24 ++++++++++++++++++------ >>   include/linux/rwlock.h        |  7 +++++++ >>   2 files changed, 25 insertions(+), 6 deletions(-) >> >> diff --git a/include/asm-generic/qrwlock.h >> b/include/asm-generic/qrwlock.h >> index 84ce841ce735..0020d3b820a7 100644 >> --- a/include/asm-generic/qrwlock.h >> +++ b/include/asm-generic/qrwlock.h >> @@ -14,6 +14,7 @@ >>   #include >>     #include >> +#include > > As said in another thread, qspinlock and qrwlock can be independently > enabled for an architecture. So we shouldn't include qspinlock.h here. > Instead, just include the regular linux/spinlock.h file to make sure > that arch_spin_is_locked() is available. The csky architecture uses qrwlock but not qspinlock. So this patch can be problematic when compiling for csky. Cheers, Longman