Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp53956pxt; Wed, 4 Aug 2021 15:34:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys2X8Qvd+tCzCfncp7XNQXpg8JzMUr7aWKWs9WVNW6pJU8H5dY4cLhCCPrWSYa0RlcyrG5 X-Received: by 2002:a17:907:7848:: with SMTP id lb8mr1404490ejc.494.1628116497904; Wed, 04 Aug 2021 15:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628116497; cv=none; d=google.com; s=arc-20160816; b=YhLuXwRKURYtAmEOaPgd0cplGRE1AQFZmXvh82BbWFl1qC1f6+5NTN59VFrCnXD/1v E47FZiYzMStZD3eEtUZJItOOHAJesfxOV4vda73c6pEPVE/dKAB/kE4UfqCjwc16146H mjukW9tQoCoxET5zdvAiqFJ5L2oLaSOMX2T+XKdji5bAlC3Sxw5dyI7H8i6GrSteAjf7 e/JAPyiMR8jhhoqX5tutwSaS3fyzKDk96zwgRfJoY9DSOc/eslDywi75FoJjNX+JEr6w jjuDuC5y0CqkJA8/fTY+DZxpPo7IqkZFPBZC2wXSbrzHCgzzc7JIXrr45uotnrPg63NH xzwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=v0xCOqT4DwRRgK+FhR6M4QKvtKCg8O1LkYdACEO8VNE=; b=yOHIBtHkBZkdEM7FxxB9meuj++oGAfp6fEoWJDLunltKUfkCMaUPKWtx/THLOGMBcn OYOlJq9+K7tpIH3O8iNSgvPt9UpPMx3vNhxSZ3zCNyEl8ngTuENdwMEbkRCvx6WSBS4c +KQZu0DmRi8PhyLLcIMnBs/qaBagQOvQJS3+xx7EDbHqLd0upgycNa3shlVG73PRA98k tfg0g/6HWxr0efhfQY1XM959Q8s+KYV7PqMrEiTmKr53M1O0+wmyitmb6/vldshGiyNq fy+vDcqcyz+YSC7oeXDcG8jTRcuNno0HF27CnNcYepqLUmyrC9kDiPsx9Vrh/CPzbKqA x8Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U+xU5qSQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h26si3336102eds.228.2021.08.04.15.34.34; Wed, 04 Aug 2021 15:34:57 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=U+xU5qSQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbhHDVRy (ORCPT + 99 others); Wed, 4 Aug 2021 17:17:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43016 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230063AbhHDVRx (ORCPT ); Wed, 4 Aug 2021 17:17:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628111859; 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=v0xCOqT4DwRRgK+FhR6M4QKvtKCg8O1LkYdACEO8VNE=; b=U+xU5qSQvjtvxga05PQnG7eOhU+L7EW1pN1gUSMPThJjszOtATRgQHYyTuFbYKUmxVlcW4 GJb+sWxLttohwHSJO5HUkbU6064crAjmukRiQJzrHKPJGvJ7B/RtD+SP0gyI6e09d/hNkq ClJhw7TwTABaulX6GjU+uxryPsSjpuI= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-125-TU1AacxuMo6qgIM332nkgg-1; Wed, 04 Aug 2021 17:17:38 -0400 X-MC-Unique: TU1AacxuMo6qgIM332nkgg-1 Received: by mail-qk1-f200.google.com with SMTP id h186-20020a37b7c30000b02903b914d9e335so2791974qkf.17 for ; Wed, 04 Aug 2021 14:17:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=v0xCOqT4DwRRgK+FhR6M4QKvtKCg8O1LkYdACEO8VNE=; b=ChfeGM6/lkDRtpjyqfoNOzF6NZsouxE3jmiHGdfx26QFS0WgYPMntjUqHQPEEbdsjq C2aJysisFAJ98lFgyhUrs5EeAnfb9mI3kN9cFQM/7onzX281wOFnPIx0UBO81gxP/3aS t2dd1z77XXnlOLd3u4gaCp4NLbxXX24vJMIbtHpE0aKglsIpZ2iuEf14eb3OU2ypG0UG p4SZ/Yp+RJeNsziBRXj46Pf+/W2p3RdJQuvg//bE2z+m45FIMCrjWARsLjhGvkX3UiC8 +bC38X5Sy9E082D3k5YvJ1lRMk62FN9vcMARtiyP/DD1VNPfGK0N+/t7qDdKWtBIH2tw GXrQ== X-Gm-Message-State: AOAM5321CNSY7IewlyTH0WagqQc1yv5onpir45M1JQbvXk1JYJmnMYMx b+sUEsySwLY+pwAHQEGctz7j9BtZZqHcMrZqitio/Z8i2lo1w8ko1ol+6zeTyxg+fYkkq0luR8P Mjq3UVGgaDsmDSQxkQvJwHlOS X-Received: by 2002:a05:6214:e67:: with SMTP id jz7mr1635484qvb.0.1628111858266; Wed, 04 Aug 2021 14:17:38 -0700 (PDT) X-Received: by 2002:a05:6214:e67:: with SMTP id jz7mr1635475qvb.0.1628111858089; Wed, 04 Aug 2021 14:17:38 -0700 (PDT) Received: from llong.remote.csb ([2601:191:8500:76c0::cdbc]) by smtp.gmail.com with ESMTPSA id w26sm1932346qki.6.2021.08.04.14.17.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Aug 2021 14:17:37 -0700 (PDT) From: Waiman Long X-Google-Original-From: Waiman Long Subject: Re: [patch 22/63] locking/spinlock: Split the lock types header To: Thomas Gleixner , LKML Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Steven Rostedt , Daniel Bristot de Oliveira , Will Deacon , Boqun Feng , Sebastian Andrzej Siewior , Davidlohr Bueso References: <20210730135007.155909613@linutronix.de> <20210730135206.416779376@linutronix.de> Message-ID: <977ef5db-17b4-646d-cbb8-b0ca301b55ea@redhat.com> Date: Wed, 4 Aug 2021 17:17:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210730135206.416779376@linutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/30/21 9:50 AM, Thomas Gleixner wrote: > From: Thomas Gleixner > > Move raw_spinlock into its own file. Prepare for RT 'sleeping spinlocks' to > avoid header recursion as RT locks require rtmutex.h which in turn requires > the raw spinlock types. > > No functional change. > > Signed-off-by: Thomas Gleixner > --- > include/linux/rwlock_types.h | 4 ++ > include/linux/spinlock.h | 4 ++ > include/linux/spinlock_types.h | 19 ---------- > include/linux/spinlock_types_raw.h | 65 +++++++++++++++++++++++++++++++++++++ > 4 files changed, 74 insertions(+), 18 deletions(-) > create mode 100644 include/linux/spinlock_types_raw.h > --- > --- a/include/linux/rwlock_types.h > +++ b/include/linux/rwlock_types.h > @@ -1,6 +1,10 @@ > #ifndef __LINUX_RWLOCK_TYPES_H > #define __LINUX_RWLOCK_TYPES_H > > +#if !defined(__LINUX_SPINLOCK_TYPES_H) > +# error "Do not include directly, include spinlock_types.h" > +#endif > + > /* > * include/linux/rwlock_types.h - generic rwlock type definitions > * and initializers > --- a/include/linux/spinlock.h > +++ b/include/linux/spinlock.h > @@ -12,6 +12,8 @@ > * asm/spinlock_types.h: contains the arch_spinlock_t/arch_rwlock_t and the > * initializers > * > + * linux/spinlock_types_raw: > + * The raw types and initializers > * linux/spinlock_types.h: > * defines the generic type and initializers > * > @@ -31,6 +33,8 @@ > * contains the generic, simplified UP spinlock type. > * (which is an empty structure on non-debug builds) > * > + * linux/spinlock_types_raw: > + * The raw RT types and initializers > * linux/spinlock_types.h: > * defines the generic type and initializers > * > --- a/include/linux/spinlock_types.h > +++ b/include/linux/spinlock_types.h > @@ -9,24 +9,7 @@ > * Released under the General Public License (GPL). > */ > > -#if defined(CONFIG_SMP) > -# include > -#else > -# include > -#endif > - > -#include > - > -typedef struct raw_spinlock { > - arch_spinlock_t raw_lock; > -#ifdef CONFIG_DEBUG_SPINLOCK > - unsigned int magic, owner_cpu; > - void *owner; > -#endif > -#ifdef CONFIG_DEBUG_LOCK_ALLOC > - struct lockdep_map dep_map; > -#endif > -} raw_spinlock_t; > +#include > > #define SPINLOCK_MAGIC 0xdead4ead > Most of the code in spinlock_types.h are moved into spinlock_types_raw.h. However, macros like SPINLOCK_MAGIC and those that followed are not removed from spinlock_types.h in this patch leading to the same set of macro definitions in two different files. Should we eliminate the duplicate macro definitions either from spinlock_types.h or from spinlock_types_raw.h? Cheers, Longman