From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Galbraith Subject: Re: [RFC PATCH 0/5] futex: introduce an optimistic spinning futex Date: Tue, 22 Jul 2014 04:31:14 +0200 Message-ID: <1405996274.5177.25.camel@marge.simpson.net> References: <1405956271-34339-1-git-send-email-Waiman.Long@hp.com> <8761iq3bp3.fsf@tassilo.jf.intel.com> <871tte3bjw.fsf@tassilo.jf.intel.com> <20140721212740.GS3935@laptop> <20140721213457.46623e2f@gandalf.local.home> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140721213457.46623e2f@gandalf.local.home> Sender: linux-doc-owner@vger.kernel.org To: Steven Rostedt Cc: Thomas Gleixner , Darren Hart , Andy Lutomirski , Peter Zijlstra , Andi Kleen , Waiman Long , Ingo Molnar , Davidlohr Bueso , Heiko Carstens , "linux-kernel@vger.kernel.org" , Linux API , "linux-doc@vger.kernel.org" , Jason Low , Scott J Norton , Robert Haas List-Id: linux-api@vger.kernel.org On Mon, 2014-07-21 at 21:34 -0400, Steven Rostedt wrote: > I was telling Robert that if futexes get optimistic spinning, he should > reconsider their use of userspace spinlocks in favor of this, because > I'm pretty sure that they will see a great improvement. My (dated) experience with pgsql says you're likely right. Once upon a time, preempting a userspace spinlock owner caused pgsql to collapse into a quivering heap. The scheduler trying to hand the CPU back to a preempted task instead of selecting what was strictly speaking the most deserving task afterward (LAST_BUDDY) let pgsql+oltp scale nice and flat instead of self destructing, but the root cause of collapse was spinners lacking knowledge. With spin done in kernel, you can know when spinning is a waste of perfectly good cycles. -Mike