Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp294836rdb; Mon, 15 Jan 2024 23:38:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgvrxFax3JXwaxIWkvYh7m0+fjndU+UXHXhJlSbs8BPAW2DKUKRcBxGeVAk/vJoGbvl/vH X-Received: by 2002:a05:6402:549:b0:558:41c1:d49c with SMTP id i9-20020a056402054900b0055841c1d49cmr3228646edx.47.1705390725709; Mon, 15 Jan 2024 23:38:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705390725; cv=none; d=google.com; s=arc-20160816; b=QN+55oRvjgqKyYrbdpz5FkPjJ0OvKZRtAqADe///bxfP9RywFKtrt7cFLPMOxT2Gzy 4/slPbCCq7y9ajLPoaBURjWMsV8kVFU/AuWaz7J9xccmcM01szQEeXbkTEYQLGi6QOgU PnEcWvztWrWAIEqpTUIZltir0Mb3lyrCiPIxRJqDymBUaiLaZViVZ0qLrfX1EDeAtDl3 DPOr1EElsb04ysbKcDq+6VWL4g8377rZgbpJ+O0b/RB1n05GfvyK0cG3ZbsOV5nSDEqP ETFNoHcpDColP+YLKspCxdAJocAMSlQ1xZ/106SOuAnh4oDizSDDXxZcMWceDxrR+cAN wRKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=CPJb7cadTIjcWryPVz+kharVhiS/ZoG1eeWlNYM9Uak=; fh=koUGgCZtBRuWglWmwu/4gANaNJeo+6CuUx4JWmdzqi4=; b=Z0eSa4XS1xQAuB/Ge86gOPVNlWLE+SHAzJGh8pED7koVco36796yrs0QfijNZcKhrM 3k4jrw/JPuYS2/WR0gMeN91atEEatEykLMY1vScjCt+Xv4WWnA7CnDdqRLI1wjBYO2Oj HdS9yphjxVw9osYTzMBB854m2PE2SZS3Wi8s2uNao0GjTgc8AbSqA65v4AZqEsxuHByz kpa6bEROd6M9ZmhX5vnxtvwj6ioWjjOOpPb3gEoLRks+0a5dlsFnOyvT5vRBzBw75Cbj R0WgqIg/775miu3Fde3BRT1+mVd2CcLtatqyYfX4IBQ5C3UIif4qbHJiK4BtQ14wiJ8T kygw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gGyolOc4; spf=pass (google.com: domain of linux-kernel+bounces-27088-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y42-20020a50bb2d000000b0054cd3ad8197si4612145ede.306.2024.01.15.23.38.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 23:38:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27088-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gGyolOc4; spf=pass (google.com: domain of linux-kernel+bounces-27088-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 75F4E1F23E64 for ; Tue, 16 Jan 2024 07:38:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8EFFD11702; Tue, 16 Jan 2024 07:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gGyolOc4" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61ECF111AD for ; Tue, 16 Jan 2024 07:37:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705390674; 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=CPJb7cadTIjcWryPVz+kharVhiS/ZoG1eeWlNYM9Uak=; b=gGyolOc4kY2tavH0/vQihn9pQcu/zp7INJaopgUMH3XslI4bY0hwMnUgX0cNRa3bzNEWlY rAj+Z6r+MkVlHkhop6Az3UYFDVpVDYOpDfnxHUTuxC2SMVDwxJcb1wz6lSu5/UPudGhK4O jat9YQfWDI2Kw7ralJnbp9dGwe87CcI= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-iiOZ5s8ZNniHQ21THwcW_Q-1; Tue, 16 Jan 2024 02:37:52 -0500 X-MC-Unique: iiOZ5s8ZNniHQ21THwcW_Q-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-67ef8bbfe89so207095536d6.0 for ; Mon, 15 Jan 2024 23:37:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705390672; x=1705995472; h=content-transfer-encoding:content-disposition:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CPJb7cadTIjcWryPVz+kharVhiS/ZoG1eeWlNYM9Uak=; b=uf44cT7gLlcVyLzS7fhFCpHTbHn3m0ppajc3mvqVddXMN2y2WpcG5Dj+0fHrBsSI7u VMLCdzQkRwWAur1PEJkf7GG8CanKIKAKW53p35tXAoVdUlYbQfhdJV6Kbzu050pcS2UO 64WcMS8WLTtjyWPdPSnTz4d1okwdOKQhQCSpQjwobqtqp6WnnUvUhNGoNR3RaLUb9fv0 Ag/ih6sKnD8kvs+VO+HpXlD3/urYOVfxvSsKzBFlFChnvnLiqcbV6UuL01U6v48xxRhF yPXHg6WLVkPxLZ6MwKf5sG0kH4YMi3A5juuOTiKATiqhjo0ykGi0soi0uryo6/DGVmRY 2aMQ== X-Gm-Message-State: AOJu0YxPA1DFCjYT7four+AFLBcReptM+L1pnqymlAcpDDbPeTXeUyjf xeMX/2tNCG2MogtQ1Nin/Zqq4JE3hB+EHNOaKlCpIXaOptFbah2+t58f9QgLmIKbowKmpj8Lvnv iAGxlPDjCWdV0CFQlANjm4QGjGaRnbKnD X-Received: by 2002:ad4:5f8a:0:b0:681:23ef:9b2 with SMTP id jp10-20020ad45f8a000000b0068123ef09b2mr9108952qvb.54.1705390672382; Mon, 15 Jan 2024 23:37:52 -0800 (PST) X-Received: by 2002:ad4:5f8a:0:b0:681:23ef:9b2 with SMTP id jp10-20020ad45f8a000000b0068123ef09b2mr9108944qvb.54.1705390672165; Mon, 15 Jan 2024 23:37:52 -0800 (PST) Received: from LeoBras.redhat.com ([2804:1b3:a803:64aa:6db9:6544:60c:9e16]) by smtp.gmail.com with ESMTPSA id mx13-20020a0562142e0d00b00681756b66e2sm28438qvb.35.2024.01.15.23.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 23:37:51 -0800 (PST) From: Leonardo Bras To: Leonardo Bras Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Kent Overstreet , Marcelo Tosatti , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/1] spinlock: Fix failing build for PREEMPT_RT Date: Tue, 16 Jan 2024 04:37:48 -0300 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116073234.2355850-3-leobras@redhat.com> References: <20240116073234.2355850-2-leobras@redhat.com> <20240116073234.2355850-3-leobras@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8bit On Tue, Jan 16, 2024 at 04:32:32AM -0300, Leonardo Bras wrote: > Since 1d71b30e1f85 ("sched.h: Move (spin|rwlock)_needbreak() to > spinlock.h") build fails for PREEMPT_RT, since there is no definition > available of either spin_needbreak() and rwlock_needbreak(). > > Since it was moved on the mentioned commit, it was placed inside a > !PREEMPT_RT part of the code, making it out of reach for an RT kernel. > > Fix this by moving code it a few lines down so it can be reached by an > RT build, where it can also make use of the *_is_contended() definition > added by the spinlock_rt.h. > > Fixes: d1d71b30e1f85 ("sched.h: Move (spin|rwlock)_needbreak() to > spinlock.h") > Signed-off-by: Leonardo Bras > --- > include/linux/spinlock.h | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h > index eaac8b0da25b8..3fcd20de6ca88 100644 > --- a/include/linux/spinlock.h > +++ b/include/linux/spinlock.h > @@ -449,6 +449,12 @@ static __always_inline int spin_is_contended(spinlock_t *lock) > return raw_spin_is_contended(&lock->rlock); > } > > +#define assert_spin_locked(lock) assert_raw_spin_locked(&(lock)->rlock) > + > +#else /* !CONFIG_PREEMPT_RT */ > +# include > +#endif /* CONFIG_PREEMPT_RT */ > + > /* > * Does a critical section need to be broken due to another > * task waiting?: (technically does not depend on CONFIG_PREEMPTION, > @@ -480,12 +486,6 @@ static inline int rwlock_needbreak(rwlock_t *lock) > #endif > } > > -#define assert_spin_locked(lock) assert_raw_spin_locked(&(lock)->rlock) > - > -#else /* !CONFIG_PREEMPT_RT */ > -# include > -#endif /* CONFIG_PREEMPT_RT */ > - > /* > * Pull the atomic_t declaration: > * (asm-mips/atomic.h needs above definitions) > -- > 2.43.0 > Nevermind, sent this one by mistake.