Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754777AbbHCTJ4 (ORCPT ); Mon, 3 Aug 2015 15:09:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:48357 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754650AbbHCTJz (ORCPT ); Mon, 3 Aug 2015 15:09:55 -0400 Message-ID: <1438628982.17146.20.camel@stgolabs.net> Subject: Re: [PATCH v4 1/7] locking/pvqspinlock: Unconditional PV kick with _Q_SLOW_VAL From: Davidlohr Bueso To: Peter Zijlstra Cc: Waiman Long , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch Date: Mon, 03 Aug 2015 12:09:42 -0700 In-Reply-To: <20150803183745.GY25159@twins.programming.kicks-ass.net> References: <1438395724-25910-1-git-send-email-Waiman.Long@hp.com> <1438395724-25910-2-git-send-email-Waiman.Long@hp.com> <20150801222903.GC25159@twins.programming.kicks-ass.net> <1438626129.17146.9.camel@stgolabs.net> <20150803183745.GY25159@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1115 Lines: 25 On Mon, 2015-08-03 at 20:37 +0200, Peter Zijlstra wrote: > OK, so there's no 'fix'? The patch claims we can loose a wakeup and I > just don't see how that is true. Taking another look, I think you could hit something like this: CPU0 (lock): CPU1 (unlock): pv_wait_head __pv_queued_spin_unlock state> [bogus ->state != halted] smp_store_release(&l->locked, 0); WRITE_ONCE(pn->state, vcpu_halted); pv_wait(&l->locked, _Q_SLOW_VAL); if (->state == vcpu_halted) pv_kick(node->cpu); <-- missing wakeup, never called So basically you can miss a wakeup if node->state load is done while the locking thread is spinning and hasn't gotten a chance to update the state to halted. That would also imply that it occurs right when the threshold limit is about to be reached. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/