Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3101397ybb; Sun, 22 Mar 2020 15:34:29 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs1Flo/jDYHC4skL746KB/K0HPDh8TS5caT2BA00zbXZFkhSxuxs9l4SKIs9eMddV9EYTTm X-Received: by 2002:a05:6830:11cc:: with SMTP id v12mr16332282otq.131.1584916468989; Sun, 22 Mar 2020 15:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584916468; cv=none; d=google.com; s=arc-20160816; b=QPa/Se2cJ6YKEMoSwef7C9mJ1G5Ubd+G769vueA7yIyh1qa4qbHhY4bSbb+4pCgJqB iqZCTIs7pl5oQae1XFbfmQ7aWdy4Luj6qjkuTaaUBSnsC7hIOte8UcSXcCZaMUXKaj2K DL2Af+ojkdHx6uTL5YNAnA8kxghTGbVXiHkAOCyKtfkzkJ+VrPsdO1CV9mFDayDqWFwu A7s4ELCGiqUvpGWy/yc8cp+FBCoYPkAoaIRa/h6WAhztS1uY9HkZca2BFuNGakcsvN7O jk9LUoE/QjYNaKBgaJwg6l7+z41lpaBrNfCvqBZrgfiUbImhZzGBURCeIWeK9o1uo3/Y MCHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zS+FVq9GRAqW8korIhuLbfacLrfQT3Nbm32pK6UBBgc=; b=qLBbdtRCBqPP7cpUEqYZs+XaRKttC92ReQ2Qs93mHk8+HScDUO4I3xNIlw1t1zT51y Nu+2Q9PG1OtiVJd9XH4mxmzpdKjr9vTYsaivfOc0W61EW+uOt5Jrscs1/AwIopYO06YV GiZdrZCGX+OG2VDSoGJYQA4ALrj0wVnEQ/HY8vBGql95oj9FNZHxffuxmz2oDBPZQCF2 j72/CID0zP6UeQJICz77BAuTKiWJzAn5jgFq2jWtgEznYLqejJkbDUw4+9clb7UXkOrq qFfh6FU7xUBloEakU4sJwCXkCN+GnL18EVzuZTUyoUr0pecsoUZukYw6X1IQJsRDSj9y 27dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=RJgvyIj2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z78si6887522oia.200.2020.03.22.15.34.16; Sun, 22 Mar 2020 15:34:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=RJgvyIj2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726903AbgCVWd7 (ORCPT + 99 others); Sun, 22 Mar 2020 18:33:59 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47612 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726809AbgCVWd7 (ORCPT ); Sun, 22 Mar 2020 18:33:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zS+FVq9GRAqW8korIhuLbfacLrfQT3Nbm32pK6UBBgc=; b=RJgvyIj2PxYSWCGVEpK6gTGg/s +rX4ZIHdy8MbnOdAOy+rdpiPLxePo/GhIpvRmhZXSuedinY7g+jwczuq4zxIFOEtJ1A2k/TjaZ1FV SSHl7aBwkGX2nuyzzrjOwQEKStsafORwWMAC+D3Hybly/JkJqi9szuvm1yO4WzRzOWoVuhbcmSV5I wd7LHXncK1GOiQFEW/enb9ikH6MpnZtEHhRTb1ocvVPi91KT81dtipHRnm4xXq7/trST69peXntw1 06xaLNePQu7/8kLriu1ISEBmE0y5MwH6O0omcRd6kkDkNotJlRm1OHXgIlelr8GRS8n3gPaiYhtQA aI33aYOA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jG99N-0001i9-0j; Sun, 22 Mar 2020 22:32:57 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A35803010CF; Sun, 22 Mar 2020 23:32:49 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6464C299F245C; Sun, 22 Mar 2020 23:32:49 +0100 (CET) Date: Sun, 22 Mar 2020 23:32:49 +0100 From: Peter Zijlstra To: Davidlohr Bueso Cc: tglx@linutronix.de, arnd@arndb.de, balbi@kernel.org, bhelgaas@google.com, bigeasy@linutronix.de, davem@davemloft.net, gregkh@linuxfoundation.org, joel@joelfernandes.org, kurt.schwemmer@microsemi.com, kvalo@codeaurora.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, logang@deltatee.com, mingo@kernel.org, mpe@ellerman.id.au, netdev@vger.kernel.org, oleg@redhat.com, paulmck@kernel.org, rdunlap@infradead.org, rostedt@goodmis.org, torvalds@linux-foundation.org, will@kernel.org, Paolo Bonzini , Davidlohr Bueso Subject: Re: [PATCH 18/15] kvm: Replace vcpu->swait with rcuwait Message-ID: <20200322223249.GK20696@hirez.programming.kicks-ass.net> References: <20200318204302.693307984@linutronix.de> <20200320085527.23861-1-dave@stgolabs.net> <20200320085527.23861-3-dave@stgolabs.net> <20200320125455.GE20696@hirez.programming.kicks-ass.net> <20200322163317.mh4sygr7xcjptmjp@linux-p48b> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200322163317.mh4sygr7xcjptmjp@linux-p48b> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 22, 2020 at 09:33:17AM -0700, Davidlohr Bueso wrote: > On Fri, 20 Mar 2020, Peter Zijlstra wrote: > > > On Fri, Mar 20, 2020 at 01:55:26AM -0700, Davidlohr Bueso wrote: > > > - swait_event_interruptible_exclusive(*wq, ((!vcpu->arch.power_off) && > > > - (!vcpu->arch.pause))); > > > + rcuwait_wait_event(*wait, > > > + (!vcpu->arch.power_off) && (!vcpu->arch.pause), > > > + TASK_INTERRUPTIBLE); > > > > > - for (;;) { > > > - prepare_to_swait_exclusive(&vcpu->wq, &wait, TASK_INTERRUPTIBLE); > > > - > > > - if (kvm_vcpu_check_block(vcpu) < 0) > > > - break; > > > - > > > - waited = true; > > > - schedule(); > > > - } > > > - > > > - finish_swait(&vcpu->wq, &wait); > > > + rcuwait_wait_event(&vcpu->wait, > > > + (block_check = kvm_vcpu_check_block(vcpu)) < 0, > > > + TASK_INTERRUPTIBLE); > > > > Are these yet more instances that really want to be TASK_IDLE ? > > Hmm probably as it makes sense for a blocked vcpu not to be contributing to > the loadavg. So if this is the only reason to use interruptible, then yes we > ought to change it. > > However, I'll make this a separate patch, given this (ab)use isn't as obvious > as the PS3 case, which is a kthread and therefore signals are masked. The thing that was a dead give-away was that the return value of the interruptible wait wasn't used.