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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 8A4AAC4338F for ; Thu, 5 Aug 2021 15:46:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7381760234 for ; Thu, 5 Aug 2021 15:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242884AbhHEPq0 (ORCPT ); Thu, 5 Aug 2021 11:46:26 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:44330 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242443AbhHEPm4 (ORCPT ); Thu, 5 Aug 2021 11:42:56 -0400 Message-ID: <20210805153956.392899146@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628178161; 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: references:references; bh=wk5BXs3QliWC0Aueq/uB6S39gsRmV857OufixmfHlos=; b=gyatUV6yQz3rIdZD6Hsa6xB/WxJBMBkjcsYal5XybiPZf5jty+87i7rmR4RxQ4HCaQLwyv tzmikb8fuqUMc7rAwd4qXMV4esk1BrgvLefZJg6RUyyYsn+RzLeLD/WD7fBvUfu5iDfYLt KJCko3YBWgBJKuMBAbKiJytxpyb4P9pGV7nvMmCwzaRtMOMr56fzlxHBz0hhxBsko4tcdM 60jDf+C1UOCPHefQjjO9FHQDd6Ay4C2/HoY0BHyhrJr9pH0K/rmjLzWHm9PIARaSL2Bv1L iuAe7D5iQTk1LRjd4CGeq2h38SIj+7q9k/zmiTZhtUofOEfW1kLCkjFrANgQsw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628178161; 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: references:references; bh=wk5BXs3QliWC0Aueq/uB6S39gsRmV857OufixmfHlos=; b=LO7xl0Bdehp2MG5bpn5bNC+rFfNKBqrBAK3GV4yuOvKn+kButmTmu7+/IqxyNmAJmrXlw9 fCINkkLD6/R+VfBw== Date: Thu, 05 Aug 2021 17:14:02 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Steven Rostedt , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , Sebastian Andrzej Siewior , Davidlohr Bueso , Mike Galbraith Subject: [patch V3 62/64] preempt: Adjust PREEMPT_LOCK_OFFSET for RT References: <20210805151300.330412127@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner On PREEMPT_RT regular spinlocks and rwlocks are substituted with rtmutex based constructs. spin/rwlock held regions are preemptible on PREEMPT_RT, so PREEMPT_LOCK_OFFSET has to be 0 to make the various cond_resched_*lock() functions work correctly. Signed-off-by: Thomas Gleixner --- include/linux/preempt.h | 4 ++++ 1 file changed, 4 insertions(+) --- --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -121,7 +121,11 @@ /* * The preempt_count offset after spin_lock() */ +#if !defined(CONFIG_PREEMPT_RT) #define PREEMPT_LOCK_OFFSET PREEMPT_DISABLE_OFFSET +#else +#define PREEMPT_LOCK_OFFSET 0 +#endif /* * The preempt_count offset needed for things like: