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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DA53ECAAD5 for ; Thu, 8 Sep 2022 06:37:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230358AbiIHGhx (ORCPT ); Thu, 8 Sep 2022 02:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230363AbiIHGhp (ORCPT ); Thu, 8 Sep 2022 02:37:45 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB5E6C0E6F for ; Wed, 7 Sep 2022 23:37:42 -0700 (PDT) Date: Thu, 8 Sep 2022 08:37:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1662619060; 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=5caOl+kTQwoBp97UxIKqZHl3t4gL124ornrbJ/bWIMw=; b=l1VQEKhOnTHbOA1hgaePJR/sBv8m7EvEZtmrArlvWiJ3eVRLCEi7FhQJH+UvEFVj/Q36/b 74YyuT6y4aPvjbKfvznOuK2CJFfmpeLILgiMKAQAQ86smAdqlb2xVWf1WqYIwVK4gh2uM7 kHQCbNMUSHQctzBxNWojrkkWURrGgicIzrufnZtX4QqRpSlM0lXzVI/FRqXRfBdB0rqNMA qra19fekkqfI56jjoJS8TdKqfQVdV6A+rx1Gt6jO4sFffQZAlE2QjpVxslq0GoatUqF3Nj F1FQ0Iy7YgKv2PN9zRp69iQ5H4Yu2uhI0fPOSLU4mNQD7kGJlTGVMRas6ndqow== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1662619060; 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=5caOl+kTQwoBp97UxIKqZHl3t4gL124ornrbJ/bWIMw=; b=ZvbOSUgXiTVvIwNbwHny++jRoB8avSn+6UMWSXMeJSR/zb00i2OH2g97Dt76JodCxKwfIJ A2v45Qy59/Ol6vBA== From: Sebastian Andrzej Siewior To: Boqun Feng , Ingo Molnar , "Michael S. Tsirkin" , Peter Zijlstra , Thomas Gleixner , Waiman Long , Will Deacon Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] locking: Detect includes rwlock.h outside of spinlock.h Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-08-25 18:08:59 [+0200], To linux-kernel@vger.kernel.org wrote: > From: Michael S. Tsirkin >=20 > The check for __LINUX_SPINLOCK_H within rwlock.h (and other files) > detects the direct include of the header file if it is at the very > beginning of the include section. > If it is listed later then chances are high that spinlock.h was already > included (including rwlock.h) and the additional listing of rwlock.h > will not cause any failure. >=20 > On PREEMPT_RT this additional rwlock.h will lead to compile failures > since it uses a different rwlock implementation. >=20 > Add __LINUX_INSIDE_SPINLOCK_H to spinlock.h and check for this instead > of __LINUX_SPINLOCK_H to detect wrong includes. This will help detect > direct includes of rwlock.h with without PREEMPT_RT enabled. >=20 > [ bigeasy: add remaining __LINUX_SPINLOCK_H user and rewrite > commit description. ] >=20 > Signed-off-by: Michael S. Tsirkin > Signed-off-by: Sebastian Andrzej Siewior > --- >=20 > This is to avoid patches like > https://lkml.kernel.org/r/20220816074816.173227-1-bigeasy@linutronix.de >=20 > in the future which is not the first I sent=E2=80=A6 polite *ping* Sebastian