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 X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20BF1C433F5 for ; Tue, 7 Sep 2021 16:20:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED736610C8 for ; Tue, 7 Sep 2021 16:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234309AbhIGQVa (ORCPT ); Tue, 7 Sep 2021 12:21:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41574 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231961AbhIGQV2 (ORCPT ); Tue, 7 Sep 2021 12:21:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631031621; 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: in-reply-to:in-reply-to:references:references; bh=s5kpwoL6JLP9VWq157hj4yt5pn95OzlSkFYcjxu+uM8=; b=A//GbMzVInx3sIjulM8vMA2hwvrRkGYJHTASDkQ2/e56WCkn6o1BuF9szfdJ2r4jigSVSc wBA48ke7CgXgXcBx6OKsrk26TkUfeb/89wag7B6Ls9sgoBhrSOM0noizfDUHs3UItTJwVd 4EBtaP5KQ7o9ZSGfdDuYN5UsED45+QM= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-119-gj_yjZH-OO2k8pzaFrtlzg-1; Tue, 07 Sep 2021 12:20:20 -0400 X-MC-Unique: gj_yjZH-OO2k8pzaFrtlzg-1 Received: by mail-ed1-f69.google.com with SMTP id z17-20020a05640240d100b003cac681f4f4so5430288edb.21 for ; Tue, 07 Sep 2021 09:20:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=s5kpwoL6JLP9VWq157hj4yt5pn95OzlSkFYcjxu+uM8=; b=aF3NQDz79Z+bI+vzJwHciO5hrGU9kEVlAqp2KID7NBMfanOLjPBhEtM/dMZewbL4Hq vnKVl8U5lYutngIop/KrIdgfr1XZrOaADY7P2CZvD3XWNgOAhTbTkuW2T7JDTIRfcZPx 6stwPW5TYcMrMREdI+JMbY5qCf/m8oyTXnmbi4aYhNWZEp/pDuQNuEXSuktcEOY1yc4i cBwDwZa/xu8rKA9PYeCWKWXZ6F5QtfBkOvUOwseVoJfar7RhL6gyW7yD2mCcvXNx31PN xfQQJ4XsckNzHX6joeg8B4aBgy+a9ruN1M12LQyBn76Rx+hyZjlCh4FJhpUA+JqkW/gU puSA== X-Gm-Message-State: AOAM531xqHY+1YTyh/VjELmJS/11zeLoScCinFKEwTvXTau7p2VnW2dA BptfR2U5EILMed/tlGUFSV1SO2KLmJGXne4K79HGhCZSJcFDV5rM3KyKEYq0J33mHDnIsIO5Dj5 x5yIFZuMhQsPe50HEd81q+LT9 X-Received: by 2002:aa7:d351:: with SMTP id m17mr307619edr.72.1631031618935; Tue, 07 Sep 2021 09:20:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlG1x6vmubv9Q2F6F+Q/kXpwV0kbe4co0LWgBBS7NPE4nU1F3mfGZ5885MxN5txLMEejY+/w== X-Received: by 2002:aa7:d351:: with SMTP id m17mr307607edr.72.1631031618753; Tue, 07 Sep 2021 09:20:18 -0700 (PDT) Received: from gator.home (cst2-174-132.cust.vodafone.cz. [31.30.174.132]) by smtp.gmail.com with ESMTPSA id a24sm6571101edu.49.2021.09.07.09.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 09:20:18 -0700 (PDT) Date: Tue, 7 Sep 2021 18:20:16 +0200 From: Andrew Jones To: Raghavendra Rao Ananta Cc: Paolo Bonzini , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , kvm@vger.kernel.org, Catalin Marinas , Peter Shier , linux-kernel@vger.kernel.org, Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 12/12] KVM: arm64: selftests: arch_timer: Support vCPU migration Message-ID: <20210907162016.2axil4gjjvkafnkx@gator.home> References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-13-rananta@google.com> <20210903110514.22x3txynin5hg46z@gator.home> <20210906063900.t6rbykpwyau5u32s@gator.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 07, 2021 at 09:14:54AM -0700, Raghavendra Rao Ananta wrote: > On Sun, Sep 5, 2021 at 11:39 PM Andrew Jones wrote: > > > > On Fri, Sep 03, 2021 at 01:53:27PM -0700, Raghavendra Rao Ananta wrote: > > > On Fri, Sep 3, 2021 at 4:05 AM Andrew Jones wrote: > > > > > > > > On Wed, Sep 01, 2021 at 09:14:12PM +0000, Raghavendra Rao Ananta wrote: > > > > > Since the timer stack (hardware and KVM) is per-CPU, there > > > > > are potential chances for races to occur when the scheduler > > > > > decides to migrate a vCPU thread to a different physical CPU. > > > > > Hence, include an option to stress-test this part as well by > > > > > forcing the vCPUs to migrate across physical CPUs in the > > > > > system at a particular rate. > > > > > > > > > > Originally, the bug for the fix with commit 3134cc8beb69d0d > > > > > ("KVM: arm64: vgic: Resample HW pending state on deactivation") > > > > > was discovered using arch_timer test with vCPU migrations and > > > > > can be easily reproduced. > > > > > > > > > > Signed-off-by: Raghavendra Rao Ananta > > > > > --- > > > > > .../selftests/kvm/aarch64/arch_timer.c | 108 +++++++++++++++++- > > > > > 1 file changed, 107 insertions(+), 1 deletion(-) > > > > > > > > > > diff --git a/tools/testing/selftests/kvm/aarch64/arch_timer.c b/tools/testing/selftests/kvm/aarch64/arch_timer.c > > > > > index 1383f33850e9..de246c7afab2 100644 > > > > > --- a/tools/testing/selftests/kvm/aarch64/arch_timer.c > > > > > +++ b/tools/testing/selftests/kvm/aarch64/arch_timer.c > > > > > @@ -14,6 +14,8 @@ > > > > > * > > > > > * The test provides command-line options to configure the timer's > > > > > * period (-p), number of vCPUs (-n), and iterations per stage (-i). > > > > > + * To stress-test the timer stack even more, an option to migrate the > > > > > + * vCPUs across pCPUs (-m), at a particular rate, is also provided. > > > > > * > > > > > * Copyright (c) 2021, Google LLC. > > > > > */ > > > > > @@ -24,6 +26,8 @@ > > > > > #include > > > > > #include > > > > > #include > > > > > +#include > > > > > +#include > > > > > > > > > > #include "kvm_util.h" > > > > > #include "processor.h" > > > > > @@ -41,12 +45,14 @@ struct test_args { > > > > > int nr_vcpus; > > > > > int nr_iter; > > > > > int timer_period_ms; > > > > > + int migration_freq_ms; > > > > > }; > > > > > > > > > > static struct test_args test_args = { > > > > > .nr_vcpus = NR_VCPUS_DEF, > > > > > .nr_iter = NR_TEST_ITERS_DEF, > > > > > .timer_period_ms = TIMER_TEST_PERIOD_MS_DEF, > > > > > + .migration_freq_ms = 0, /* Turn off migrations by default */ > > > > > > > > I'd rather we enable good tests like these by default. > > > > > > > Well, that was my original idea, but I was concerned about the ease > > > for diagnosing > > > things since it'll become too noisy. And so I let it as a personal > > > preference. But I can > > > include it back and see how it goes. > > > > Break the tests into two? One run without migration and one with. If > > neither work, then we can diagnose the one without first, possibly > > avoiding the need to diagnose the one with. > > > Right. I guess that's where the test's migration switch can come in handy. > Let's turn migration ON by default. If we see a failure, we can turn > OFF migration > and run the tests. I'll try to include some verbose printing for diagnosability. > Sounds good. You can also consider using pr_debug if you feel the need to balance verbosity with diagnostics. Thanks, drew 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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9534DC433FE for ; Tue, 7 Sep 2021 16:20:25 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id F3C096112E for ; Tue, 7 Sep 2021 16:20:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F3C096112E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 74ACC4B20E; Tue, 7 Sep 2021 12:20:24 -0400 (EDT) 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=@redhat.com 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 PWFF5Kt126Pe; Tue, 7 Sep 2021 12:20:23 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 22EC44B202; Tue, 7 Sep 2021 12:20:23 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 75D5A4B1E1 for ; Tue, 7 Sep 2021 12:20:22 -0400 (EDT) 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 rqz-fvdYht8G for ; Tue, 7 Sep 2021 12:20:21 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6C1104B18A for ; Tue, 7 Sep 2021 12:20:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631031621; 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: in-reply-to:in-reply-to:references:references; bh=s5kpwoL6JLP9VWq157hj4yt5pn95OzlSkFYcjxu+uM8=; b=A//GbMzVInx3sIjulM8vMA2hwvrRkGYJHTASDkQ2/e56WCkn6o1BuF9szfdJ2r4jigSVSc wBA48ke7CgXgXcBx6OKsrk26TkUfeb/89wag7B6Ls9sgoBhrSOM0noizfDUHs3UItTJwVd 4EBtaP5KQ7o9ZSGfdDuYN5UsED45+QM= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-591-xY9KjWShMSmYgYBaSWCHCQ-1; Tue, 07 Sep 2021 12:20:20 -0400 X-MC-Unique: xY9KjWShMSmYgYBaSWCHCQ-1 Received: by mail-ed1-f70.google.com with SMTP id h4-20020aa7c604000000b003c423efb7efso5579835edq.12 for ; Tue, 07 Sep 2021 09:20:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=s5kpwoL6JLP9VWq157hj4yt5pn95OzlSkFYcjxu+uM8=; b=ohqQhWN0bobQsFCCrLJh7EK2ymQF6AFJCDMuuteVL6UATQ7rDXQdjW+UJZjHTcoslD xRlyzvqQAwlvDVPySvITuU33lMpQT5XYV5U48x58TJuu7lqjLE1TsrzCkccFmxPzsx+6 7i+9njlAsEiyU79zKAQmLi//Q0Pfl90+fV7vmdmMd/ACNwv0is6ab6h1FspRJe+25PfR iR3vfgnC6ZSIyVdGW78LzUeJTeP1b9sFquNbtBDE+cJOy7bIFBCs9+miHwAJkZ+3PX2T gPRZ35wZjI3he0LsLqzNmoCOhg9vqQwEoiZlt/NgLQ6QrWQ/a3/LiafeIrrvOgLNIpbF Fq9g== X-Gm-Message-State: AOAM530Y2siqIEP94KON6p9RDV3AfaZ9V4dmEZoAeShSSP1C9Y0aJ1B8 SZNIylYHtPf0czFQOUshzq7klUnh0KNzgCKpq6s8TSAvc+hfNZ5AMKsQVyUeNWVVf8Z2gsmhsQJ pVLcG046UkLHtb5hh+3//7SSF X-Received: by 2002:aa7:d351:: with SMTP id m17mr307628edr.72.1631031618939; Tue, 07 Sep 2021 09:20:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlG1x6vmubv9Q2F6F+Q/kXpwV0kbe4co0LWgBBS7NPE4nU1F3mfGZ5885MxN5txLMEejY+/w== X-Received: by 2002:aa7:d351:: with SMTP id m17mr307607edr.72.1631031618753; Tue, 07 Sep 2021 09:20:18 -0700 (PDT) Received: from gator.home (cst2-174-132.cust.vodafone.cz. [31.30.174.132]) by smtp.gmail.com with ESMTPSA id a24sm6571101edu.49.2021.09.07.09.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 09:20:18 -0700 (PDT) Date: Tue, 7 Sep 2021 18:20:16 +0200 From: Andrew Jones To: Raghavendra Rao Ananta Subject: Re: [PATCH v3 12/12] KVM: arm64: selftests: arch_timer: Support vCPU migration Message-ID: <20210907162016.2axil4gjjvkafnkx@gator.home> References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-13-rananta@google.com> <20210903110514.22x3txynin5hg46z@gator.home> <20210906063900.t6rbykpwyau5u32s@gator.home> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: kvm@vger.kernel.org, Marc Zyngier , Peter Shier , linux-kernel@vger.kernel.org, Will Deacon , Catalin Marinas , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list 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 Tue, Sep 07, 2021 at 09:14:54AM -0700, Raghavendra Rao Ananta wrote: > On Sun, Sep 5, 2021 at 11:39 PM Andrew Jones wrote: > > > > On Fri, Sep 03, 2021 at 01:53:27PM -0700, Raghavendra Rao Ananta wrote: > > > On Fri, Sep 3, 2021 at 4:05 AM Andrew Jones wrote: > > > > > > > > On Wed, Sep 01, 2021 at 09:14:12PM +0000, Raghavendra Rao Ananta wrote: > > > > > Since the timer stack (hardware and KVM) is per-CPU, there > > > > > are potential chances for races to occur when the scheduler > > > > > decides to migrate a vCPU thread to a different physical CPU. > > > > > Hence, include an option to stress-test this part as well by > > > > > forcing the vCPUs to migrate across physical CPUs in the > > > > > system at a particular rate. > > > > > > > > > > Originally, the bug for the fix with commit 3134cc8beb69d0d > > > > > ("KVM: arm64: vgic: Resample HW pending state on deactivation") > > > > > was discovered using arch_timer test with vCPU migrations and > > > > > can be easily reproduced. > > > > > > > > > > Signed-off-by: Raghavendra Rao Ananta > > > > > --- > > > > > .../selftests/kvm/aarch64/arch_timer.c | 108 +++++++++++++++++- > > > > > 1 file changed, 107 insertions(+), 1 deletion(-) > > > > > > > > > > diff --git a/tools/testing/selftests/kvm/aarch64/arch_timer.c b/tools/testing/selftests/kvm/aarch64/arch_timer.c > > > > > index 1383f33850e9..de246c7afab2 100644 > > > > > --- a/tools/testing/selftests/kvm/aarch64/arch_timer.c > > > > > +++ b/tools/testing/selftests/kvm/aarch64/arch_timer.c > > > > > @@ -14,6 +14,8 @@ > > > > > * > > > > > * The test provides command-line options to configure the timer's > > > > > * period (-p), number of vCPUs (-n), and iterations per stage (-i). > > > > > + * To stress-test the timer stack even more, an option to migrate the > > > > > + * vCPUs across pCPUs (-m), at a particular rate, is also provided. > > > > > * > > > > > * Copyright (c) 2021, Google LLC. > > > > > */ > > > > > @@ -24,6 +26,8 @@ > > > > > #include > > > > > #include > > > > > #include > > > > > +#include > > > > > +#include > > > > > > > > > > #include "kvm_util.h" > > > > > #include "processor.h" > > > > > @@ -41,12 +45,14 @@ struct test_args { > > > > > int nr_vcpus; > > > > > int nr_iter; > > > > > int timer_period_ms; > > > > > + int migration_freq_ms; > > > > > }; > > > > > > > > > > static struct test_args test_args = { > > > > > .nr_vcpus = NR_VCPUS_DEF, > > > > > .nr_iter = NR_TEST_ITERS_DEF, > > > > > .timer_period_ms = TIMER_TEST_PERIOD_MS_DEF, > > > > > + .migration_freq_ms = 0, /* Turn off migrations by default */ > > > > > > > > I'd rather we enable good tests like these by default. > > > > > > > Well, that was my original idea, but I was concerned about the ease > > > for diagnosing > > > things since it'll become too noisy. And so I let it as a personal > > > preference. But I can > > > include it back and see how it goes. > > > > Break the tests into two? One run without migration and one with. If > > neither work, then we can diagnose the one without first, possibly > > avoiding the need to diagnose the one with. > > > Right. I guess that's where the test's migration switch can come in handy. > Let's turn migration ON by default. If we see a failure, we can turn > OFF migration > and run the tests. I'll try to include some verbose printing for diagnosability. > Sounds good. You can also consider using pr_debug if you feel the need to balance verbosity with diagnostics. Thanks, drew _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87914C433F5 for ; Tue, 7 Sep 2021 16:22:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4C44C610FE for ; Tue, 7 Sep 2021 16:22:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4C44C610FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: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:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nub3F8ApB3AqGYPCkvwkPgTF2jWPNY6kZEYNJ43EC14=; b=AWKVhcN8X1mqmA nh3EAbHsiPIHvYj7wxgnNDlHIq2EYLA6nfwjb+fXWc04q5msOjC+AlSkNF8EEMb8x20WH6tDDz94x E0M8AaaAxQJeEnKwU3I/UejEvyLGEV3F2rkoHrlUsxoKidujVE2I64qWT9dLRcX2NSslNnHAo0X05 rN0i9OIhJTjh8OlpLYINQegKtiENsNKddL4J6SF293HlxO2shggqUpq8DgYW22148kCyJLEBQ+WPp FqFQaGTGZ09YSP+M2N/+0AePnYP/qT+fOgahPtiogca2pqr+TFSMOsuXLEHnsvq863Kq4ShZAEyfh qeKbuvMDcfPElE2/aZZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNdpk-004B9Y-UR; Tue, 07 Sep 2021 16:20:29 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNdph-004B8h-5n for linux-arm-kernel@lists.infradead.org; Tue, 07 Sep 2021 16:20:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631031621; 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: in-reply-to:in-reply-to:references:references; bh=s5kpwoL6JLP9VWq157hj4yt5pn95OzlSkFYcjxu+uM8=; b=A//GbMzVInx3sIjulM8vMA2hwvrRkGYJHTASDkQ2/e56WCkn6o1BuF9szfdJ2r4jigSVSc wBA48ke7CgXgXcBx6OKsrk26TkUfeb/89wag7B6Ls9sgoBhrSOM0noizfDUHs3UItTJwVd 4EBtaP5KQ7o9ZSGfdDuYN5UsED45+QM= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-Uw8p_3KaPTmTbdYFTIJrxw-1; Tue, 07 Sep 2021 12:20:20 -0400 X-MC-Unique: Uw8p_3KaPTmTbdYFTIJrxw-1 Received: by mail-ed1-f70.google.com with SMTP id w18-20020aa7cb52000000b003c95870200fso5439534edt.16 for ; Tue, 07 Sep 2021 09:20:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=s5kpwoL6JLP9VWq157hj4yt5pn95OzlSkFYcjxu+uM8=; b=eDR4FxO/XnC8OmIlkfGWOHQLVOCadIRVCZ76MyIfTrB1voX2gm0VMu3bsCQ0RixHw1 E0jKtAZ1Qrf7UplRIZCoi+Heg7UF+CN03vLnvijLNztvPTnuFyQ7xLy+f5Q6d1jCm0BE D6+UxynaXFwCRgcp9o9C0P99WbuxiOTym4/811mzj2jYcCjqTirQW5PV/jgTAsNgG5rB UZTOoSlgrt6D0ztJU1B0+ET+TqmA7RBLUQpVkixGuweHMEoL4a2naR8gWAxSKvhljKQ2 OEoGGc6CFPHrw0V85JlLmbe6BCiYFg7EWt36M9NH58sScxnXrjVWtkEFVtS9yaL2it3Z OVQQ== X-Gm-Message-State: AOAM530hUQI1gUqMaSberaJfWeNQayCyTP/SM+O3vPIntxGmRsS3PM0C yKmCBnIdxa2DYHf7Px2QUPHZBdRN2rfpg+WwU2NTlVAez64D/ohsXOWtQhKrR9Q6urpL9FiT6Qd cZw23as1AxIZvw37CnaZoTfdrWr7d0JXxIQo= X-Received: by 2002:aa7:d351:: with SMTP id m17mr307627edr.72.1631031618938; Tue, 07 Sep 2021 09:20:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlG1x6vmubv9Q2F6F+Q/kXpwV0kbe4co0LWgBBS7NPE4nU1F3mfGZ5885MxN5txLMEejY+/w== X-Received: by 2002:aa7:d351:: with SMTP id m17mr307607edr.72.1631031618753; Tue, 07 Sep 2021 09:20:18 -0700 (PDT) Received: from gator.home (cst2-174-132.cust.vodafone.cz. [31.30.174.132]) by smtp.gmail.com with ESMTPSA id a24sm6571101edu.49.2021.09.07.09.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 09:20:18 -0700 (PDT) Date: Tue, 7 Sep 2021 18:20:16 +0200 From: Andrew Jones To: Raghavendra Rao Ananta Cc: Paolo Bonzini , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , kvm@vger.kernel.org, Catalin Marinas , Peter Shier , linux-kernel@vger.kernel.org, Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 12/12] KVM: arm64: selftests: arch_timer: Support vCPU migration Message-ID: <20210907162016.2axil4gjjvkafnkx@gator.home> References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-13-rananta@google.com> <20210903110514.22x3txynin5hg46z@gator.home> <20210906063900.t6rbykpwyau5u32s@gator.home> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210907_092025_366691_20BADFC4 X-CRM114-Status: GOOD ( 36.89 ) 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: , 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 Tue, Sep 07, 2021 at 09:14:54AM -0700, Raghavendra Rao Ananta wrote: > On Sun, Sep 5, 2021 at 11:39 PM Andrew Jones wrote: > > > > On Fri, Sep 03, 2021 at 01:53:27PM -0700, Raghavendra Rao Ananta wrote: > > > On Fri, Sep 3, 2021 at 4:05 AM Andrew Jones wrote: > > > > > > > > On Wed, Sep 01, 2021 at 09:14:12PM +0000, Raghavendra Rao Ananta wrote: > > > > > Since the timer stack (hardware and KVM) is per-CPU, there > > > > > are potential chances for races to occur when the scheduler > > > > > decides to migrate a vCPU thread to a different physical CPU. > > > > > Hence, include an option to stress-test this part as well by > > > > > forcing the vCPUs to migrate across physical CPUs in the > > > > > system at a particular rate. > > > > > > > > > > Originally, the bug for the fix with commit 3134cc8beb69d0d > > > > > ("KVM: arm64: vgic: Resample HW pending state on deactivation") > > > > > was discovered using arch_timer test with vCPU migrations and > > > > > can be easily reproduced. > > > > > > > > > > Signed-off-by: Raghavendra Rao Ananta > > > > > --- > > > > > .../selftests/kvm/aarch64/arch_timer.c | 108 +++++++++++++++++- > > > > > 1 file changed, 107 insertions(+), 1 deletion(-) > > > > > > > > > > diff --git a/tools/testing/selftests/kvm/aarch64/arch_timer.c b/tools/testing/selftests/kvm/aarch64/arch_timer.c > > > > > index 1383f33850e9..de246c7afab2 100644 > > > > > --- a/tools/testing/selftests/kvm/aarch64/arch_timer.c > > > > > +++ b/tools/testing/selftests/kvm/aarch64/arch_timer.c > > > > > @@ -14,6 +14,8 @@ > > > > > * > > > > > * The test provides command-line options to configure the timer's > > > > > * period (-p), number of vCPUs (-n), and iterations per stage (-i). > > > > > + * To stress-test the timer stack even more, an option to migrate the > > > > > + * vCPUs across pCPUs (-m), at a particular rate, is also provided. > > > > > * > > > > > * Copyright (c) 2021, Google LLC. > > > > > */ > > > > > @@ -24,6 +26,8 @@ > > > > > #include > > > > > #include > > > > > #include > > > > > +#include > > > > > +#include > > > > > > > > > > #include "kvm_util.h" > > > > > #include "processor.h" > > > > > @@ -41,12 +45,14 @@ struct test_args { > > > > > int nr_vcpus; > > > > > int nr_iter; > > > > > int timer_period_ms; > > > > > + int migration_freq_ms; > > > > > }; > > > > > > > > > > static struct test_args test_args = { > > > > > .nr_vcpus = NR_VCPUS_DEF, > > > > > .nr_iter = NR_TEST_ITERS_DEF, > > > > > .timer_period_ms = TIMER_TEST_PERIOD_MS_DEF, > > > > > + .migration_freq_ms = 0, /* Turn off migrations by default */ > > > > > > > > I'd rather we enable good tests like these by default. > > > > > > > Well, that was my original idea, but I was concerned about the ease > > > for diagnosing > > > things since it'll become too noisy. And so I let it as a personal > > > preference. But I can > > > include it back and see how it goes. > > > > Break the tests into two? One run without migration and one with. If > > neither work, then we can diagnose the one without first, possibly > > avoiding the need to diagnose the one with. > > > Right. I guess that's where the test's migration switch can come in handy. > Let's turn migration ON by default. If we see a failure, we can turn > OFF migration > and run the tests. I'll try to include some verbose printing for diagnosability. > Sounds good. You can also consider using pr_debug if you feel the need to balance verbosity with diagnostics. Thanks, drew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel