From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755063AbbBUAEA (ORCPT ); Fri, 20 Feb 2015 19:04:00 -0500 Received: from mail-ig0-f169.google.com ([209.85.213.169]:36990 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752745AbbBUAD6 convert rfc822-to-8bit (ORCPT ); Fri, 20 Feb 2015 19:03:58 -0500 MIME-Version: 1.0 In-Reply-To: <20150220133756.GA30528@gmail.com> References: <20150220133756.GA30528@gmail.com> Date: Fri, 20 Feb 2015 16:03:57 -0800 X-Google-Sender-Auth: xwhrYOrFUPbUCNZ4vay5yOs14Ds Message-ID: Subject: Re: [GIT PULL] locking fixes From: Linus Torvalds To: Ingo Molnar Cc: Linux Kernel Mailing List , Peter Zijlstra , Thomas Gleixner , Andrew Morton Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org How does this work for you at all? On Fri, Feb 20, 2015 at 5:37 AM, Ingo Molnar wrote: > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c > index 94f643484300..e354cc6446ab 100644 > --- a/arch/x86/kernel/kvm.c > +++ b/arch/x86/kernel/kvm.c > @@ -803,8 +808,8 @@ static void kvm_unlock_kick(struct arch_spinlock *lock, __ticket_t ticket) > add_stats(RELEASED_SLOW, 1); > for_each_cpu(cpu, &waiting_cpus) { > const struct kvm_lock_waiting *w = &per_cpu(klock_waiting, cpu); > - if (ACCESS_ONCE(w->lock) == lock && > - ACCESS_ONCE(w->want) == ticket) { > + if (READ_ONCE(w->lock) == lock && > + READ_ONCE(w->want) == ticket) { > add_stats(RELEASED_SLOW_KICKED, 1); > kvm_kick_cpu(cpu); > break; I get horrible compile warnings from this, because of how 'w' is a pointer to a 'const' structure, which then causes things like include/linux/compiler.h:262:39: warning: passing argument 1 of ‘__read_once_size’ discards ‘const’ qualifier from pointer target type ({ typeof(x) __val; __read_once_size(&x, &__val, sizeof(__val)); __val; }) which is fairly hard to avoid (looks like it might need a union) Linus