Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2455042ybh; Mon, 16 Mar 2020 03:36:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vujXLtL9WX3uSVrF0a3g5zAjMxaTbvSCCoDniWtV3kjGWhzy0YrtwQCUF2AtIRSTbhk70co X-Received: by 2002:a05:6830:20c9:: with SMTP id z9mr21990457otq.44.1584354993292; Mon, 16 Mar 2020 03:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584354993; cv=none; d=google.com; s=arc-20160816; b=Y69+dbo1IK32Za2oBmsmRhKvJL8HZY1EAEyX8qvIeLHDjWrmJk4r7t/tmTuHEzJeXc uqRN0UYsZPZOWonH9zTswtkgKYwz+Ow70w8q8yMkTo9ZA1PAuozuTsb9RV//xDZgmxDa YToK+hxpWIIWfUKLLLM1nP09ve8viBnY40fZ3tyhMNK4qN8UYyGWZC1TGVr41Ql+AlNm QACUbr0syU7lf08vZvO0d5ZRZpUEW9L9j0RHcwyky5GNKmdyISiN4xDHedoQQ3q56h/t OPsLcJJyAzneywDxEM3nW5Odrk5+CgahuZ3VMnRRTTTGpHqa4H7aTgkcoV08ymQgR92H UiXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+Wv2bFEfRwV+OA0fhC+kRISxg5A3EJUuvI6dsd9ef/c=; b=XVz8ZepRpbxFW3tjPABvletunonE98DMbVp5vqau0Whk/wDadSsTisJPvBtdn7jX9X Xje+iuy6/ZTaU9Fy88adHNi2fqUT0F73Tx6+v2yJLlDr7usTABMdEaManLPDDJ/Lkj21 WGiAzZU0+VsRNCHcCUrafMCAoRg7wDCY/XrAPiX0U/tttZI59C9qzKzJSY0DBiZf1JBt X/Wdj0KZABeLO2vwVdAQ4SXm5bUz0ExrYIB/efmjbng6xk9ZvO26cOyYiRdzc+Ct7YQg LXFhpj3hUfdnGJZJQKSyHq61vlpHffkhl4DsfH/H/0buPdFmUZNteGhQg6Br+q3KScrY 6ZsQ== 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 o16si9051012oie.125.2020.03.16.03.36.20; Mon, 16 Mar 2020 03:36:33 -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 S1730674AbgCPKe5 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 16 Mar 2020 06:34:57 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51394 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730604AbgCPKe5 (ORCPT ); Mon, 16 Mar 2020 06:34:57 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1jDn5C-0004bb-2E; Mon, 16 Mar 2020 11:34:54 +0100 Date: Mon, 16 Mar 2020 11:34:54 +0100 From: Sebastian Andrzej Siewior To: Randy Dunlap Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Will Deacon , "Paul E . McKenney" , Joel Fernandes , Steven Rostedt , Linus Torvalds , Thomas Gleixner Subject: Re: [PATCH 1/9] Documentation: Add lock ordering and nesting documentation Message-ID: <20200316103454.iodi65uzbpat4kv5@linutronix.de> References: <20200313174701.148376-1-bigeasy@linutronix.de> <20200313174701.148376-2-bigeasy@linutronix.de> <2e0912cc-6780-18e9-4e4c-7cc60da6709f@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <2e0912cc-6780-18e9-4e4c-7cc60da6709f@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-03-14 15:57:24 [-0700], Randy Dunlap wrote: > Hi, Hi Randy, > A few comments for your consideration: I merged all of you comments but two: > On 3/13/20 10:46 AM, Sebastian Andrzej Siewior wrote: … > > +rwlock_t and PREEMPT_RT > > +----------------------- > > + > > +On a PREEMPT_RT enabled kernel rwlock_t is mapped to a separate > > +implementation based on rt_mutex which changes the semantics: > > + > > + - Same changes as for spinlock_t > > + > > + - The implementation is not fair and can cause writer starvation under > > + certain circumstances. The reason for this is that a writer cannot > > + inherit its priority to multiple readers. Readers which are blocked > > ^^^^^^^ I think this is backwards. Maybe more like so: > a writer cannot > bequeath or grant or bestow or pass down ... its priority to So the term "inherit" is the problem. The protocol is officially called PI which is short for Priority Inheritance. Other documentation, RT-mutex for instance, is also using this term when it is referring to altering the priority of a task. For that reason I prefer to keep using this term. > > + on a writer fully support the priority inheritance protocol. … > > +raw_spinlock_t > > +-------------- > > + > > +As raw_spinlock_t locking disables preemption and eventually interrupts the > > +code inside the critical region has to be careful to avoid calls into code > > Can I buy a comma in there somewhere, please? > I don't get it as is. What about | As raw_spinlock_t locking disables preemption, and eventually interrupts, the | code inside the critical region has to be careful to avoid calls into code any better? … Sebastian