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 98465C4338F for ; Wed, 11 Aug 2021 12:26:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D44D60F22 for ; Wed, 11 Aug 2021 12:26:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238678AbhHKM0q (ORCPT ); Wed, 11 Aug 2021 08:26:46 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:50802 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238386AbhHKMYS (ORCPT ); Wed, 11 Aug 2021 08:24:18 -0400 Message-ID: <20210811121418.066622265@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628684632; 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=JSEG12OP1CVye+tXr4+YpdtHY4/k+V3Lwf3bEXtJU5yz7jGJ2atRkG+21w769TPHkMB/c4 VMfknghF5onSUpXxbNgDRjeURVOvTqO7WnYqb8hvq/kqIa+n0ehi1NEngg9F6pSFVAfaEM lGbfdEy8AF5SVFIekYfpSe46jpmommsTTRFonXBEJ/0HQrznXXOMjoUBCAGzasNB3ogdwo biJdR+/Hl0RNk9N6mNMdufsHI4jVgUKJwArFmujgPGlJE7kjgNCN1N/PhxzhMwo5KKRKQB ZxtnD40Bbpf6tWdrUNmUglPsa2E/9QyyngwUfzxTqAjVNx1xjdzp933dUOVDrw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628684632; 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=wK5Kgu4iLhgh1yiO2Wig/tJSY1vgWYHoEWVmk9/EP5U9dQLBAJL4taRT7qckwp5IQwerNo g4jQrL1hI0XsEKBw== 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 V4 66/68] preempt: Adjust PREEMPT_LOCK_OFFSET for RT References: <20210811120348.855823694@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Date: Wed, 11 Aug 2021 14:23:52 +0200 (CEST) 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: