From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760095AbdADNJW (ORCPT ); Wed, 4 Jan 2017 08:09:22 -0500 Received: from merlin.infradead.org ([205.233.59.134]:39292 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759930AbdADNIl (ORCPT ); Wed, 4 Jan 2017 08:08:41 -0500 Date: Wed, 4 Jan 2017 13:49:29 +0100 From: Peter Zijlstra To: Waiman Long Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , linux-kernel@vger.kernel.org, Steven Rostedt Subject: Re: [RFC PATCH 0/7] locking/rtqspinlock: Realtime queued spinlocks Message-ID: <20170104124929.GI25813@worktop.programming.kicks-ass.net> References: <1483466430-8028-1-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1483466430-8028-1-git-send-email-longman@redhat.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 03, 2017 at 01:00:23PM -0500, Waiman Long wrote: > This patchset introduces a new variant of queued spinlocks - the > realtime queued spinlocks. The purpose of this new variant is to > support real spinlock in a realtime environment where high priority > RT tasks should be allowed to complete its work ASAP. This means as > little waiting time for spinlocks as possible. > > Non-RT tasks will wait for spinlocks in the MCS waiting queue as > usual. RT tasks and interrupts will spin directly on the spinlocks > and use the priority value in the pending byte to arbitrate who get > the lock first. > > Patch 1 removes the unused spin_lock_bh_nested() API. > > Patch 2 introduces the basic realtime queued spinlocks where the > pending byte is used for storing the priority of the highest priority > RT task that is waiting on the spinlock. All the RT tasks will spin > directly on the spinlock instead of waiting in the queue. > OK, so a single numerical field isn't sufficient to describe priority anymore, since we added DEADLINE support things have gotten a lot more complex. Also, the whole approach worries me, it has the very real possibility of re-introducing a bunch of starvation cases avoided by the fair lock. Is there a real problem with -RT that inspired these patches?