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,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 C0DFEC4332B for ; Wed, 10 Feb 2021 18:44:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CAEE64E26 for ; Wed, 10 Feb 2021 18:44:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233894AbhBJSoK (ORCPT ); Wed, 10 Feb 2021 13:44:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:52556 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234189AbhBJSaj (ORCPT ); Wed, 10 Feb 2021 13:30:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612981745; 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=fYYBsxu73w7K0XguXXBeoWTwhLVvhJ5OOGR+uAgX+h4=; b=YkF052rp7m5mLbunPUSNjSSkOpQdLb6hHYKdnRr78QHETCnCi/jkAo1aInhMJx3lK2jKW0 WiJp3OBlLcisVVnobi+dYqbXUaeY2yvsGWJQL4Gu+oESInkx+ckkT1PclClBTQriDfJnYY gWbd9ear3GbCpgD6BrmdR7jhF1zl/Cw= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-342-qtADkG5MOVey4vd8CGgtWw-1; Wed, 10 Feb 2021 13:29:00 -0500 X-MC-Unique: qtADkG5MOVey4vd8CGgtWw-1 Received: by mail-wm1-f71.google.com with SMTP id l21so1296402wmj.1 for ; Wed, 10 Feb 2021 10:29:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fYYBsxu73w7K0XguXXBeoWTwhLVvhJ5OOGR+uAgX+h4=; b=CHTmr6y+q5kzUSnVpByk10wjrBezODqS0jUR+jCCKiQ3aC67maU8elrHmNOMTySVTV bN99Rl0TgrTAfummSkzClRORQNi5LeYbubKZ7ebLl1K8DKAIptjNWy4dy/dNEBWSWoza 3UYGhcyWsqWPCTS6IcIX7cJZGt92hRGQmr29SCcPu4AP6MCDhGduePgkmzP0qywmiSts faEi5ciX5jVc8ez+0FChUOmrHRPLq3RjSlF+8zNsT8+5DfXOiZKaQOa+905XNehi6TFA XjwIqbETdt3n5gpv4NZp7eod/CDyY9vcXa8D7vKI6PMhlSJEIHy+M+bMhnqOedykTzYy 2eXw== X-Gm-Message-State: AOAM531R2PopIlxQ+EMSNE4xrE4T5Bf5+oEiodwEPRXqs0sjjiOjh2l0 P7i57moIX9B+0l24kpaHU6zqAQxgoShnGXL8i1eokUuOFCkGf3beKURzRqc6WZHj/M6shW7bHuE TDXNx76NL4FlW5eTQftz8PYcH X-Received: by 2002:a1c:4483:: with SMTP id r125mr223835wma.80.1612981739026; Wed, 10 Feb 2021 10:28:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmxlNWuCd4Xp+dCygWJQUgZ2qxgJCc955uVLjJdnKvNrD9YC2BN6UDsWfR7xqj2wXggvYDdg== X-Received: by 2002:a1c:4483:: with SMTP id r125mr223811wma.80.1612981738761; Wed, 10 Feb 2021 10:28:58 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id w2sm3766006wmg.27.2021.02.10.10.28.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Feb 2021 10:28:58 -0800 (PST) Subject: Re: [PATCH] locking/arch: Move qrwlock.h include after qspinlock.h To: Waiman Long , Peter Zijlstra , Ingo Molnar , Will Deacon , Catalin Marinas , Thomas Bogendoerfer , Chris Zankel , Max Filippov Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-xtensa@linux-xtensa.org, Naresh Kamboju , Guenter Roeck , Ben Gardon References: <20210210144556.10932-1-longman@redhat.com> From: Paolo Bonzini Message-ID: <1d7d564c-cc73-372b-be8b-1cfd51cf476c@redhat.com> Date: Wed, 10 Feb 2021 19:28:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210210144556.10932-1-longman@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/02/21 15:45, Waiman Long wrote: > The queued rwlock code has a dependency on the current spinlock > implementation (likely to be qspinlock), but not vice versa. Including > qrwlock.h before qspinlock.h can be problematic when expanding qrwlock > functionality. > > If both qspinlock.h and qrwlock.h are to be included, the qrwlock.h > include should always be after qspinlock.h. Update the current set of > asm/spinlock.h files to enforce that. > > Signed-off-by: Waiman Long arch/sparc/include/asm/spinlock_64.h is missing. Also, the include in kernel/locking/qrwlock.c is not necessary (it may be there for aesthetic reasons, but it complicates thing in this case). I'll send a v2 that is based on the kvm/next tree. Paolo > --- > arch/arm64/include/asm/spinlock.h | 2 +- > arch/mips/include/asm/spinlock.h | 2 +- > arch/xtensa/include/asm/spinlock.h | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h > index 9083d6992603..0525c0b089ed 100644 > --- a/arch/arm64/include/asm/spinlock.h > +++ b/arch/arm64/include/asm/spinlock.h > @@ -5,8 +5,8 @@ > #ifndef __ASM_SPINLOCK_H > #define __ASM_SPINLOCK_H > > -#include > #include > +#include > > /* See include/linux/spinlock.h */ > #define smp_mb__after_spinlock() smp_mb() > diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h > index 8a88eb265516..6ce2117e49f6 100644 > --- a/arch/mips/include/asm/spinlock.h > +++ b/arch/mips/include/asm/spinlock.h > @@ -10,7 +10,6 @@ > #define _ASM_SPINLOCK_H > > #include > -#include > > #include > > @@ -27,5 +26,6 @@ static inline void queued_spin_unlock(struct qspinlock *lock) > } > > #include > +#include > > #endif /* _ASM_SPINLOCK_H */ > diff --git a/arch/xtensa/include/asm/spinlock.h b/arch/xtensa/include/asm/spinlock.h > index 584b0de6f2ca..41c449ece2d8 100644 > --- a/arch/xtensa/include/asm/spinlock.h > +++ b/arch/xtensa/include/asm/spinlock.h > @@ -12,8 +12,8 @@ > #define _XTENSA_SPINLOCK_H > > #include > -#include > #include > +#include > > #define smp_mb__after_spinlock() smp_mb() > >