Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2867756ybb; Sun, 22 Mar 2020 09:34:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtmiQu0NTyqqBk6pypfrNzRX+9kpC5ggYvHdg6DlxvRo33LPRl5Ks8E98Mf2itgyjALrgfO X-Received: by 2002:a9d:70d0:: with SMTP id w16mr1585797otj.9.1584894897970; Sun, 22 Mar 2020 09:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584894897; cv=none; d=google.com; s=arc-20160816; b=Z49wFFtGOIXvx0I063eOhRlDjW9cde3XG34m2pyyGg5URnJKhrbyNRGItZ2Jb9JKDX GKibfP+ENWTFHqUyNcAFyzVklfHFvPbDzVuhI3iysOfg8MxRKYZzYI7gsEWMsSdEbxxN UG3JOqXUaQJqEmQD7xd2VdHuHPI2VGkmMRKIDBdx+2ardzulpkatx7kujNP4c79yMExQ YBYxU3xwkAKazTYYq5BpAbxFZ3GvdxR7xLhYczjw+XBj+WR+WhvgCFNwGc1XaHvoEikv 6xnFi/IjZXbpVACdtAUp02UplSTvvT7ChXca0VvgPttMGI4+gkgXR7cvU8niS3h31YbM FYPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=CXKXPrHihXON+ivPwX7fNya/b9wfmVQv/oA5V4GB1Uo=; b=Nwvc3ym2zNqtqCqtfhJkE77glINrBqCHrUHGMGgq/WJJb3qrVUDtT1MtHUAjVSPHUf Atf1rpOBXhysICDRP1XdCrP67tHLoChe38W1KY3jhYqtdD79kvzs7YaHF1cw4lxO7Gbr ppWXjKqNwCdtGjgv5aB6KXJzT0c3GnAMnZ9NkEvmLyYjqT8ELGUieSobDxbPBnYBYUwK r0aCrSo760UH9bVHfuWTBCNUCiGqxfD+0JLR0KY9xtyKmbzsjxQlFSB5P3c7G22SzoFZ Q1U4ZNEz5JHIsUYDqKs3PXATjEd+e95xmvy658mWQ/thIpQu87gN7A5QHy7dCYOFdhBG vEbw== ARC-Authentication-Results: i=1; mx.google.com; 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 x66si6020517ota.244.2020.03.22.09.34.45; Sun, 22 Mar 2020 09:34:57 -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; 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 S1726843AbgCVQe2 (ORCPT + 99 others); Sun, 22 Mar 2020 12:34:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:52958 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbgCVQe2 (ORCPT ); Sun, 22 Mar 2020 12:34:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 93574AC24; Sun, 22 Mar 2020 16:34:24 +0000 (UTC) Date: Sun, 22 Mar 2020 09:33:17 -0700 From: Davidlohr Bueso To: Peter Zijlstra 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: <20200322163317.mh4sygr7xcjptmjp@linux-p48b> References: <20200318204302.693307984@linutronix.de> <20200320085527.23861-1-dave@stgolabs.net> <20200320085527.23861-3-dave@stgolabs.net> <20200320125455.GE20696@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200320125455.GE20696@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Davidlohr