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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 4AC38C07E9A for ; Wed, 14 Jul 2021 11:26:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 271256100B for ; Wed, 14 Jul 2021 11:26:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238969AbhGNL3a (ORCPT ); Wed, 14 Jul 2021 07:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230164AbhGNL33 (ORCPT ); Wed, 14 Jul 2021 07:29:29 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38D7EC06175F for ; Wed, 14 Jul 2021 04:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jAmBXMulwel/6QKJkbTCkyzNR4cRqgN3axEfLABI0/0=; b=LJ0sPL9UaOKPUmvYnnaKhoYi6B mRvo2Cp9F3xyW4vId5rpOYCqKA/3s0xch8cwSZiO6l55tpckp+pObtQx069+IjwwJloVi88p8sUZ1 nzAKLKmVKmC1hGqzu3ScqPKlEiihRq2RxiLD61aIhyUtnQ7z34po/LKFaNF9orv9UEHt6FwFdZ/g7 kPlwmGppOMnAuz10o4D7+C09nIF1FZSmKcLs47QeG3iVpCjCZ0CujxR9JTQQdLbbWZLEKI+BgneL/ 1BiwDAOiK7N8Fi7f/zsl3K31L8WoO9m1AokWL9P7zHnQqB9edSTh05EP1X8IeYUyU1rXWQOxiftcl pkpzH93A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3d19-0029er-Gh; Wed, 14 Jul 2021 11:25:38 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id A036998689D; Wed, 14 Jul 2021 13:25:30 +0200 (CEST) Date: Wed, 14 Jul 2021 13:25:30 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , Ingo Molnar , Juri Lelli , Steven Rostedt , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , Sebastian Andrzej Siewior , Davidlohr Bueso Subject: Re: [patch 27/50] locking/spinlock: Provide RT variant Message-ID: <20210714112530.GE2591@worktop.programming.kicks-ass.net> References: <20210713151054.700719949@linutronix.de> <20210713160748.585453340@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210713160748.585453340@linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 13, 2021 at 05:11:21PM +0200, Thomas Gleixner wrote: > + * - Non RT spin/rw_locks disable preemption and evtl. interrupts. > + * Disabling preemption has the side effect of disabling migration and > + * preventing RCU grace periods. > + * > + * The RT substitutions explicitly disable migration and take > + * rcu_read_lock() across the lock held section. > +static __always_inline void __rt_spin_lock(spinlock_t *lock) > +{ > + rtlock_lock(&lock->lock); > + rcu_read_lock(); > + migrate_disable(); > +} One notable difference is that regular spinlocks disable preemption (and hence imply the other things) *before* they acquire the lock, while this thing does the implied semantics *after* it acquires the lock. The difference is of course that the acquisition period is not covered and I don't think anybody actually relies on that, nor do I readily see how one could.