Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp405146ybg; Thu, 19 Mar 2020 01:52:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vugPudMmM/XqOA9VD24OtyP6tc9xoJR1JOqufYo4tSh6TMDUnzQgsM/L8gOMpvj1ty6SGq2 X-Received: by 2002:aca:482:: with SMTP id 124mr1526253oie.35.1584607973007; Thu, 19 Mar 2020 01:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584607972; cv=none; d=google.com; s=arc-20160816; b=zVQTuzM97KC+e12AWU/Z2JPccA5QhRHerHBvCBNU1X0AbMyfoDV8OMOsygIzC3c7RK uf20HiErJ+bj+W0wsW314hvFwZJEuF1FwrF8FBLrJ7JfzjwNR0dO7xMQYL5NtTawIFb/ 6U4pKhUu+z/Kmj2vbHHzL1Surnj/HUwS+DtW7LbQgVpn0LcLeHhZeARBPG65T6gLlXa5 IanZDjCyIRexgMux6I3kkQl6pi3jrmmYq+pD9Bsf9mIJGPbhkihdwFFwBx+An2/Uz5IF gHhCknnNCsVfX3c+av/ienrtV2rzAdB8gW/QriInPHm8Wl38lxs82pNHt1u3hGBrCqF4 uZtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rbPAhU3QHO/DVeteHqKYG/eTCPZrF50wJTarcsP638E=; b=cgtwgmh++6q1VrIscKHmU3RXChCXFwwV24b8RM1BonHok0px/sY3hejaapdyNTCF8o vvCGC9Ka63IUxisTcbWSSFOfgve5jte8ohOP/SO3YbW+5afBfvWlzOIAA56rSyB6LJ23 61i9+np0+7Z62qcqxr7OvmPVnMdkoOuESJUheGDkGQXp/bXlqAhFLN8UaTCybwD5Zwru Rm9zH1Cig7fSvyEgBG36lG9H9DahqI9S+lUFRah2NFQts7bavucC9P9DsKMAn1My2ux7 VOqXTKAVn2UvRBD3cmVd7BZf+HM/Cp+uNSVF8Y9nn5gvanv0RH/z+mPQCSzE8Ma0rM/K D8yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 66si872441otx.151.2020.03.19.01.52.39; Thu, 19 Mar 2020 01:52:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726936AbgCSIwT (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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