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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 E5376C4332D for ; Thu, 19 Mar 2020 08:52:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD20E2072D for ; Thu, 19 Mar 2020 08:52:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726881AbgCSIwT (ORCPT ); Thu, 19 Mar 2020 04:52:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:35642 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbgCSIwT (ORCPT ); Thu, 19 Mar 2020 04:52:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 25E85B117; Thu, 19 Mar 2020 08:52:16 +0000 (UTC) Date: Thu, 19 Mar 2020 01:51:09 -0700 From: Davidlohr Bueso To: Thomas Gleixner Cc: LKML , Peter Zijlstra , Linus Torvalds , Ingo Molnar , Will Deacon , "Paul E . McKenney" , Joel Fernandes , Steven Rostedt , Randy Dunlap , Sebastian Andrzej Siewior , Logan Gunthorpe , Kurt Schwemmer , Bjorn Helgaas , linux-pci@vger.kernel.org, Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Kalle Valo , "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Oleg Nesterov , Michael Ellerman , Arnd Bergmann , linuxppc-dev@lists.ozlabs.org Subject: Re: [patch V2 08/15] Documentation: Add lock ordering and nesting documentation Message-ID: <20200319085109.vrvmpesytul3ek3e@linux-p48b> References: <20200318204302.693307984@linutronix.de> <20200318204408.211530902@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200318204408.211530902@linutronix.de> User-Agent: NeoMutt/20180716 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Wed, 18 Mar 2020, Thomas Gleixner wrote: >+Owner semantics >+=============== >+ >+Most lock types in the Linux kernel have strict owner semantics, i.e. the >+context (task) which acquires a lock has to release it. >+ >+There are two exceptions: >+ >+ - semaphores >+ - rwsems >+ >+semaphores have no strict owner semantics for historical reasons. They are I would rephrase this to: semaphores have no owner semantics for historical reason, and as such trylock and release operations can be called from interrupt context. They are ... >+often used for both serialization and waiting purposes. That's generally >+discouraged and should be replaced by separate serialization and wait >+mechanisms. ^ , such as mutexes or completions. >+ >+rwsems have grown interfaces which allow non owner release for special >+purposes. This usage is problematic on PREEMPT_RT because PREEMPT_RT >+substitutes all locking primitives except semaphores with RT-mutex based >+implementations to provide priority inheritance for all lock types except >+the truly spinning ones. Priority inheritance on ownerless locks is >+obviously impossible. >+ >+For now the rwsem non-owner release excludes code which utilizes it from >+being used on PREEMPT_RT enabled kernels. In same cases this can be >+mitigated by disabling portions of the code, in other cases the complete >+functionality has to be disabled until a workable solution has been found. Thanks, Davidlohr