From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ACB8C433FE for ; Fri, 17 Dec 2021 17:12:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239649AbhLQRMX (ORCPT ); Fri, 17 Dec 2021 12:12:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237090AbhLQRMW (ORCPT ); Fri, 17 Dec 2021 12:12:22 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B730C061574; Fri, 17 Dec 2021 09:12:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 57605CE25E4; Fri, 17 Dec 2021 17:12:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BBFBC36AE8; Fri, 17 Dec 2021 17:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639761138; bh=GszWHJciD4A9dmjPuqqtxIzn00kkF1IyT82H2olfyAs=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=l5F0/VkgWEw7v+6AVHA6qKqnuv6Njco2SyHTYRm2ktw1PiXRMTIOXaF3OruEAfwfG Q11TLUzu00BsrNCypmPnlGP1E8vSkmNk6Z2a4gOiL79yp/ln2uctxYs09ZOMduwvoj zumRYIah+RTf4YOPiaj+Vw77EI3MFWmqjF7V8ly661rGyL8bAePJgLiYrxPlTb+X0N 1110S1gUS2JxaFa7Dms14KhpoYM5TvE/rfI4VrEJOMYPwmWVLyPrfNfa/dp7g5I6ta 7MCu5o9uvofccWM2EFiGNqkxCu7YgJe0mQkHpNESVMNrMIUB92x6h0fxnafooQnWxZ trS62QDxSzrbw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 16B465C0610; Fri, 17 Dec 2021 09:12:18 -0800 (PST) Date: Fri, 17 Dec 2021 09:12:18 -0800 From: "Paul E. McKenney" To: Paolo Bonzini Cc: Mark Rutland , Nicolas Saenz Julienne , maz , frederic , linux-kernel , rcu , Thomas Gleixner , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel Subject: Re: Possible nohz-full/RCU issue in arm64 KVM Message-ID: <20211217171218.GV641268@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <70f112072d9496d21901946ea82832d3ed3a8cb2.camel@redhat.com> <9ab8107f-ff41-6a9e-57e1-a261bea93aca@redhat.com> <20211217160749.GS641268@paulmck-ThinkPad-P17-Gen-1> <20211217164535.GU641268@paulmck-ThinkPad-P17-Gen-1> <4c369ca2-2ad0-4a02-90e9-2d82df6c289d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4c369ca2-2ad0-4a02-90e9-2d82df6c289d@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 17, 2021 at 06:02:23PM +0100, Paolo Bonzini wrote: > On 12/17/21 17:45, Paul E. McKenney wrote: > > On Fri, Dec 17, 2021 at 05:34:04PM +0100, Paolo Bonzini wrote: > > > On 12/17/21 17:07, Paul E. McKenney wrote: > > > > > rcu_note_context_switch() is a point-in-time notification; it's not strictly > > > > > necessary, but it may improve performance a bit by avoiding unnecessary IPIs > > > > > from the RCU subsystem. > > > > > > > > > > There's no benefit from doing it when you're back from the guest, because at > > > > > that point the CPU is just running normal kernel code. > > > > > > > > Do scheduling-clock interrupts from guest mode have the "user" parameter > > > > set? If so, that would keep RCU happy. > > > > > > No, thread is in supervisor mode. But after every interrupt (timer tick or > > > anything), one of three things can happen: > > > > > > * KVM will go around the execution loop and invoke rcu_note_context_switch() > > > again > > > > > > * or KVM will go back to user space > > > > Here "user space" is a user process as opposed to a guest OS? > > Yes, that code runs from ioctl(KVM_RUN) and the ioctl will return to the > calling process. Intriguing. A user process within the guest OS or a user process outside of any guest OS, that is, within the host? Thanx, Paul > Paolo > > > > * or the thread will be preempted > > > > > > and either will keep RCU happy as far as I understand. > > > > Regardless of the answer to my question above, yes, these will keep > > RCU happy. ;-) > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E33A7C433F5 for ; Fri, 17 Dec 2021 18:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=48pPDjkfuHQcZ1WnqCHIfo/C51ZdHUH2kAs5MosmHO4=; b=sNhInP8rck56FU AKDEzQ4PYdZfH3EFgbTEKHRdncxq3ixi7v3TtnbUqabs17+f9ZdXJFNACrxSyTcZErxM1RWEK6TS/ HMl4y1UROrk/eTNL/Ozn3gd82GbQF9bIAQOHyWx+nU7ZaTIju+8YvEzjtRI6dr9MPFLB4IxkwFi+v EVZ4uFJCnk8hpX0igSAQM3alVzKfBySNgadWGsSAhfXFkp0prvUDVssO2De03nUThJuiBuxYV+6Qn gL3tRmzREZbtoSIGeH7hHxJBP3JvQPJGqZtgyybQ75j7jNilAoknhWb7ShtvU9klAm29sg3nGXuBw VR9uv3haED3OP1GA+FKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myHiC-00Bi4A-NP; Fri, 17 Dec 2021 18:12:09 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myGmJ-00BPKB-J5 for linux-arm-kernel@lists.infradead.org; Fri, 17 Dec 2021 17:12:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1AA4E6233D; Fri, 17 Dec 2021 17:12:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BBFBC36AE8; Fri, 17 Dec 2021 17:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639761138; bh=GszWHJciD4A9dmjPuqqtxIzn00kkF1IyT82H2olfyAs=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=l5F0/VkgWEw7v+6AVHA6qKqnuv6Njco2SyHTYRm2ktw1PiXRMTIOXaF3OruEAfwfG Q11TLUzu00BsrNCypmPnlGP1E8vSkmNk6Z2a4gOiL79yp/ln2uctxYs09ZOMduwvoj zumRYIah+RTf4YOPiaj+Vw77EI3MFWmqjF7V8ly661rGyL8bAePJgLiYrxPlTb+X0N 1110S1gUS2JxaFa7Dms14KhpoYM5TvE/rfI4VrEJOMYPwmWVLyPrfNfa/dp7g5I6ta 7MCu5o9uvofccWM2EFiGNqkxCu7YgJe0mQkHpNESVMNrMIUB92x6h0fxnafooQnWxZ trS62QDxSzrbw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 16B465C0610; Fri, 17 Dec 2021 09:12:18 -0800 (PST) Date: Fri, 17 Dec 2021 09:12:18 -0800 From: "Paul E. McKenney" To: Paolo Bonzini Cc: Mark Rutland , Nicolas Saenz Julienne , maz , frederic , linux-kernel , rcu , Thomas Gleixner , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel Subject: Re: Possible nohz-full/RCU issue in arm64 KVM Message-ID: <20211217171218.GV641268@paulmck-ThinkPad-P17-Gen-1> References: <70f112072d9496d21901946ea82832d3ed3a8cb2.camel@redhat.com> <9ab8107f-ff41-6a9e-57e1-a261bea93aca@redhat.com> <20211217160749.GS641268@paulmck-ThinkPad-P17-Gen-1> <20211217164535.GU641268@paulmck-ThinkPad-P17-Gen-1> <4c369ca2-2ad0-4a02-90e9-2d82df6c289d@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4c369ca2-2ad0-4a02-90e9-2d82df6c289d@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_091219_739502_27238106 X-CRM114-Status: GOOD ( 25.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: paulmck@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Dec 17, 2021 at 06:02:23PM +0100, Paolo Bonzini wrote: > On 12/17/21 17:45, Paul E. McKenney wrote: > > On Fri, Dec 17, 2021 at 05:34:04PM +0100, Paolo Bonzini wrote: > > > On 12/17/21 17:07, Paul E. McKenney wrote: > > > > > rcu_note_context_switch() is a point-in-time notification; it's not strictly > > > > > necessary, but it may improve performance a bit by avoiding unnecessary IPIs > > > > > from the RCU subsystem. > > > > > > > > > > There's no benefit from doing it when you're back from the guest, because at > > > > > that point the CPU is just running normal kernel code. > > > > > > > > Do scheduling-clock interrupts from guest mode have the "user" parameter > > > > set? If so, that would keep RCU happy. > > > > > > No, thread is in supervisor mode. But after every interrupt (timer tick or > > > anything), one of three things can happen: > > > > > > * KVM will go around the execution loop and invoke rcu_note_context_switch() > > > again > > > > > > * or KVM will go back to user space > > > > Here "user space" is a user process as opposed to a guest OS? > > Yes, that code runs from ioctl(KVM_RUN) and the ioctl will return to the > calling process. Intriguing. A user process within the guest OS or a user process outside of any guest OS, that is, within the host? Thanx, Paul > Paolo > > > > * or the thread will be preempted > > > > > > and either will keep RCU happy as far as I understand. > > > > Regardless of the answer to my question above, yes, these will keep > > RCU happy. ;-) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16BD0C433FE for ; Sun, 19 Dec 2021 12:12:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id BF7824B256; Sun, 19 Dec 2021 07:12:19 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KjSvPjSG7Bla; Sun, 19 Dec 2021 07:12:18 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0A2404B2E1; Sun, 19 Dec 2021 07:12:14 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C3A5E4B22C for ; Fri, 17 Dec 2021 12:12:20 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3cW3HD09k94Y for ; Fri, 17 Dec 2021 12:12:19 -0500 (EST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id D34704B215 for ; Fri, 17 Dec 2021 12:12:19 -0500 (EST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1AA4E6233D; Fri, 17 Dec 2021 17:12:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BBFBC36AE8; Fri, 17 Dec 2021 17:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639761138; bh=GszWHJciD4A9dmjPuqqtxIzn00kkF1IyT82H2olfyAs=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=l5F0/VkgWEw7v+6AVHA6qKqnuv6Njco2SyHTYRm2ktw1PiXRMTIOXaF3OruEAfwfG Q11TLUzu00BsrNCypmPnlGP1E8vSkmNk6Z2a4gOiL79yp/ln2uctxYs09ZOMduwvoj zumRYIah+RTf4YOPiaj+Vw77EI3MFWmqjF7V8ly661rGyL8bAePJgLiYrxPlTb+X0N 1110S1gUS2JxaFa7Dms14KhpoYM5TvE/rfI4VrEJOMYPwmWVLyPrfNfa/dp7g5I6ta 7MCu5o9uvofccWM2EFiGNqkxCu7YgJe0mQkHpNESVMNrMIUB92x6h0fxnafooQnWxZ trS62QDxSzrbw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 16B465C0610; Fri, 17 Dec 2021 09:12:18 -0800 (PST) Date: Fri, 17 Dec 2021 09:12:18 -0800 From: "Paul E. McKenney" To: Paolo Bonzini Subject: Re: Possible nohz-full/RCU issue in arm64 KVM Message-ID: <20211217171218.GV641268@paulmck-ThinkPad-P17-Gen-1> References: <70f112072d9496d21901946ea82832d3ed3a8cb2.camel@redhat.com> <9ab8107f-ff41-6a9e-57e1-a261bea93aca@redhat.com> <20211217160749.GS641268@paulmck-ThinkPad-P17-Gen-1> <20211217164535.GU641268@paulmck-ThinkPad-P17-Gen-1> <4c369ca2-2ad0-4a02-90e9-2d82df6c289d@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4c369ca2-2ad0-4a02-90e9-2d82df6c289d@redhat.com> X-Mailman-Approved-At: Sun, 19 Dec 2021 07:12:12 -0500 Cc: maz , frederic , linux-kernel , kvmarm@lists.cs.columbia.edu, rcu , Nicolas Saenz Julienne , Will Deacon , Thomas Gleixner , linux-arm-kernel X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list Reply-To: paulmck@kernel.org List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Fri, Dec 17, 2021 at 06:02:23PM +0100, Paolo Bonzini wrote: > On 12/17/21 17:45, Paul E. McKenney wrote: > > On Fri, Dec 17, 2021 at 05:34:04PM +0100, Paolo Bonzini wrote: > > > On 12/17/21 17:07, Paul E. McKenney wrote: > > > > > rcu_note_context_switch() is a point-in-time notification; it's not strictly > > > > > necessary, but it may improve performance a bit by avoiding unnecessary IPIs > > > > > from the RCU subsystem. > > > > > > > > > > There's no benefit from doing it when you're back from the guest, because at > > > > > that point the CPU is just running normal kernel code. > > > > > > > > Do scheduling-clock interrupts from guest mode have the "user" parameter > > > > set? If so, that would keep RCU happy. > > > > > > No, thread is in supervisor mode. But after every interrupt (timer tick or > > > anything), one of three things can happen: > > > > > > * KVM will go around the execution loop and invoke rcu_note_context_switch() > > > again > > > > > > * or KVM will go back to user space > > > > Here "user space" is a user process as opposed to a guest OS? > > Yes, that code runs from ioctl(KVM_RUN) and the ioctl will return to the > calling process. Intriguing. A user process within the guest OS or a user process outside of any guest OS, that is, within the host? Thanx, Paul > Paolo > > > > * or the thread will be preempted > > > > > > and either will keep RCU happy as far as I understand. > > > > Regardless of the answer to my question above, yes, these will keep > > RCU happy. ;-) > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm