From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965441AbbJIKYW (ORCPT ); Fri, 9 Oct 2015 06:24:22 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:33369 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753524AbbJIKYP (ORCPT ); Fri, 9 Oct 2015 06:24:15 -0400 Subject: Re: [PATCH] kvm: fix waitqueue_active without memory barrier in virt/kvm/async_pf.c To: Peter Zijlstra References: <17EC94B0A072C34B8DCF0D30AD16044A028747C1@BPXM09GP.gisp.nec.co.jp> <56177EAC.2070601@redhat.com> <20151009085040.GZ7520@twins.programming.kicks-ass.net> Cc: Kosuke Tatsukawa , Gleb Natapov , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Paolo Bonzini Message-ID: <561795CB.30006@redhat.com> Date: Fri, 9 Oct 2015 12:24:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151009085040.GZ7520@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/10/2015 10:50, Peter Zijlstra wrote: > Not having actually read or thought about the issue at hand, its > perfectly valid to pair an smp_mb() with either spin_lock() or > spin_unlock(). > > IOW. MB <-> {ACQUIRE, RELEASE} is a valid pairing. In this case it's an smp_mb() (store-load barrier) being paired with another smp_mb(), so spin_unlock()'s release is not enough. Paolo