From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751539AbbEDRQK (ORCPT ); Mon, 4 May 2015 13:16:10 -0400 Received: from g9t5008.houston.hp.com ([15.240.92.66]:58519 "EHLO g9t5008.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbbEDRP7 (ORCPT ); Mon, 4 May 2015 13:15:59 -0400 Message-ID: <5547A948.5050406@hp.com> Date: Mon, 04 May 2015 13:15:52 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Peter Zijlstra CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-arch@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, Paolo Bonzini , Konrad Rzeszutek Wilk , Boris Ostrovsky , "Paul E. McKenney" , Rik van Riel , Linus Torvalds , Raghavendra K T , David Vrabel , Oleg Nesterov , Daniel J Blueman , Scott J Norton , Douglas Hatch Subject: Re: [PATCH v16 08/14] pvqspinlock: Implement simple paravirt support for the qspinlock References: <1429901803-29771-1-git-send-email-Waiman.Long@hp.com> <1429901803-29771-9-git-send-email-Waiman.Long@hp.com> <20150504142017.GK23123@twins.programming.kicks-ass.net> In-Reply-To: <20150504142017.GK23123@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/04/2015 10:20 AM, Peter Zijlstra wrote: > I changed it to the below; I've not gotten around to compiling or even > running it yet :-( > > The biggest change is the pv_hash/pv_unhash functions, which I've > rewritten to hopefully be clearer (and also hopefully not wrecked them). > I took out the cacheline sized structure which takes out that double > loop and simplifies things. I've also added some comments which > hopefully explain how/why we ended up with this exact scheme. > > I've also moved the __pv_queue_spin_unlock() function to the tail, such > that we keep the 'wait'/'kick' order for both node and head. > > In any case, like I just wrote on the other email, I've stuck some > things in my queue (up to and including patch 11) and if it all works > out we can continue from there. > > --- > Subject: pvqspinlock: Implement simple paravirt support for the qspinlock > From: Waiman Long > Date: Fri, 24 Apr 2015 14:56:37 -0400 > > Provide a separate (second) version of the spin_lock_slowpath for > paravirt along with a special unlock path. > > The second slowpath is generated by adding a few pv hooks to the > normal slowpath, but where those will compile away for the native > case, they expand into special wait/wake code for the pv version. > > The actual MCS queue can use extra storage in the mcs_nodes[] array to > keep track of state and therefore uses directed wakeups. > > The head contender has no such storage directly visible to the > unlocker. So the unlocker searches a hash table with open addressing > using a simple binary Galois linear feedback shift register. I am fine with the change as it makes it simpler. BTW, I just saw a build error mail. That should be fixed easily with some minor edit. Cheers, Longman