Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1603934ybz; Thu, 23 Apr 2020 02:02:37 -0700 (PDT) X-Google-Smtp-Source: APiQypIhLRa8NI0ccR5S5tkXnF33p5MF1JkVc/yx/JnVpoOJNiFYoRSOyTfIAQpYVELity0Olp2f X-Received: by 2002:a17:906:1641:: with SMTP id n1mr1840760ejd.365.1587632557221; Thu, 23 Apr 2020 02:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587632557; cv=none; d=google.com; s=arc-20160816; b=rOufbsOdT9vwEJqNcnubU4i3qQYbq1URGraKN3BGiss4TwLs+brHidqugpwQPKmHMZ 9jHMb/PUNNcS8wz9c5EzKLMtYLi55vwhoQaUyFli6Z7JffOgQOPQRkkAl13LC/gDHhEm 4J9cCHxNK2WG/g+jMBq70q/UJIHi8Fwj5tQvy/hHiRR5zgku6tAcVmmU2NVdOpHPy83i vCKIZS4IaUPj0two7Mhk9jb92IUtPf+Tg/OdzuMXhWmi+u5Qc7GSM2Aq+6z63OsizPGo SC0+tYMSOgiTZPuvD3Iyrj+HFuz10gllUAWmdVLTv8YRKIJr0L2Y7SnaU6BgPjuY10VT G/9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Kkq0uwjQBfxJhQKuYr+1chwz4XGWFG4HzoEt9DzJrws=; b=GifDViN9PDToqrfmz7gAxtmUWIQxwH5dh851Ak1j8kSnATSpSSqYo/lGTVsZFNayw7 xk39mUFTkB7pP+UGgB01TQYrz9hku4FJrGwBM59UEW5Fyyr5Tr6ybsqQjv7JtgRn2Nuz yYX6mPeRgaNgnLCtInOm04Df/45qZkA8T37Km/XOOJ8Nk7w2aAhusQ4foXcSE3p2uVAf ikeiIEbbeCC9jsSh7aLw2EdY+r8yrgrEjKq3hbObGj5otRHUr0mW/Wp4Nw2FdIFKHfS5 cVBeMXka4p6zSUVrNQxDsqQHGlTOOI8ATwrVV0r2asXh513U12OkCEmx7v1HxT/pSq7f KcEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iGAOCQ8q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si928288ejr.86.2020.04.23.02.02.13; Thu, 23 Apr 2020 02:02:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iGAOCQ8q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726547AbgDWI6L (ORCPT + 99 others); Thu, 23 Apr 2020 04:58:11 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:35416 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726375AbgDWI6K (ORCPT ); Thu, 23 Apr 2020 04:58:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587632289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kkq0uwjQBfxJhQKuYr+1chwz4XGWFG4HzoEt9DzJrws=; b=iGAOCQ8qlGPHFbP9p+FqEGRRLBMdsIE6UH6o4zEembVbztHHxC/JWhRoWv34o5h0XkQf9s dgj4jftcqXalejir7yAhsFS1HfgyurbDpxr3ZVe0F+AoDhsiUlgKIEvcAr97EuXqM4PKQa Wgk7i3h8Mv5BWJLy7gLrXX+R+3kGtvs= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-491-OfldqtXAMuij-wyT9_yzuw-1; Thu, 23 Apr 2020 04:58:07 -0400 X-MC-Unique: OfldqtXAMuij-wyT9_yzuw-1 Received: by mail-wr1-f72.google.com with SMTP id j16so2517917wrw.20 for ; Thu, 23 Apr 2020 01:58:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Kkq0uwjQBfxJhQKuYr+1chwz4XGWFG4HzoEt9DzJrws=; b=g3bIWV8NewsYeeO9Fb7uvUIC37aGYPBSTC9V91iD3dqh+zOtsZEgRhPzEkwTDqIQjn ghi4t4Liku75kHLf9FD16LFjOoUtcrhZF1Qk1F8g2FUhSQgJ6Ycu5CGSVtZGsaLUgu5s nzsKP37OaOX7F5NaQ15j+I9AA1/4xBG8swLUj6zvnvPpSNHDzzaIr/ileluzXG8pFEVm U2JxRxLbfm6/KQEwsxFMk8ZjjjSv1sNPJxbh65VVh8t/X29LJuLceI/Sjg5SQ6S8OeA7 1O+PH8gDbOywq87iD9c900ZhFZmzLGMVRh+e/jHq2BLVjeVsPau1SUpWnTVXs7knxi5X xlVQ== X-Gm-Message-State: AGi0PuY3qmuz0cEBX6wCiw9moCxSqGagITgEzeZPrgEwzxtvBr/vFRis j6pNljdSsKEUtOt5ysz+TIFIx86cDXz3JJ5acFwkDfyesEl0EoZ25Pqwjz0sAXKqKs6K25b+492 VdyBbNPKwz0os0hzmszKlfAgW X-Received: by 2002:a5d:664f:: with SMTP id f15mr3609431wrw.72.1587632286118; Thu, 23 Apr 2020 01:58:06 -0700 (PDT) X-Received: by 2002:a5d:664f:: with SMTP id f15mr3609406wrw.72.1587632285847; Thu, 23 Apr 2020 01:58:05 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:d0a0:f143:e9e4:2926? ([2001:b07:6468:f312:d0a0:f143:e9e4:2926]) by smtp.gmail.com with ESMTPSA id h2sm2810041wmf.34.2020.04.23.01.58.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Apr 2020 01:58:05 -0700 (PDT) Subject: Re: [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait To: Marc Zyngier , Davidlohr Bueso Cc: tglx@linutronix.de, kvm@vger.kernel.org, Davidlohr Bueso , peterz@infradead.org, torvalds@linux-foundation.org, bigeasy@linutronix.de, linux-kernel@vger.kernel.org, rostedt@goodmis.org, linux-mips@vger.kernel.org, Paul Mackerras , joel@joelfernandes.org, will@kernel.org, kvmarm@lists.cs.columbia.edu References: <20200422040739.18601-1-dave@stgolabs.net> <20200422040739.18601-5-dave@stgolabs.net> <20200423094140.69909bbb@why> From: Paolo Bonzini Message-ID: Date: Thu, 23 Apr 2020 10:57:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200423094140.69909bbb@why> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/04/20 10:41, Marc Zyngier wrote: >> >> - if (swait_active(kvm_arch_vcpu_wq(vcpu))) >> + if (rcu_dereference(kvm_arch_vpu_get_wait(vcpu)) != NULL) > This doesn't compile (wrong function name, and rcu_dereference takes a > variable). But whatever it would do if we fixed it looks dodgy. it isn't > the rcuwait structure that you want to dereference, but rcuwait->task > (we are checking whether we are called because we are blocking or being > preempted). > Yes, I agree. Replacing swait with rcuwait is all good, but please make the API look the same first. Just like you added prepare_to_rcuwait and finish_rcuwait, let's add rcuwait_active as well. Actually let's do it like this: 1) Davidlohr, please post only patches 1-3 to "equalize" the swait and rcuwait APIs. 2) Peter, please prepare a topic branch for those, or provide Acked-by 3) let's get everything else through the KVM tree. Thanks, Paolo