Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1296618iog; Thu, 16 Jun 2022 03:26:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s0CwQ2dC4giTon1y+ihM5WpPNAHfSbwI64vSmMu1CNXK6EAxdI+zV2Vh3QjbeRcBXPPLFe X-Received: by 2002:a17:903:2cb:b0:14f:4fb6:2fb0 with SMTP id s11-20020a17090302cb00b0014f4fb62fb0mr3901743plk.172.1655375180279; Thu, 16 Jun 2022 03:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655375180; cv=none; d=google.com; s=arc-20160816; b=0q9Pmd8PW1cWdbZzwofff9qBX49IDFSZXQHi56pMi7ZRAdZMqEBvZogmxf7IP37YWM enDA5OlzjN+3xQHG8KapKoWCcb7120lF2P9/xraYCwbivUJk6xh53TnW4vnXOEN6WG/z EYCzmQY52p7MOSKyaRUVd19pM97YPeEjW/Qt4g5JksCGpbTIaG96JHfBa4cyV3Ad11vG KxXsnVnUZcY4Vy0EqwRXUzVGnvOcLt9ZQQD/LQcLTrpMoLOitpL6vPg1d1wXGQghDlH+ zQXOGRjRmyVBnf1a2FAclr7tYSLvz031CNBqlpnARSTz4J+eYrqm7jxTV7aFjShk6nbF k5kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g+rRSDDGMNRSjCYwnuHCvDLiuUTQ21znr/ushhg1MKs=; b=XssbELurt2KMDXYE+l9psGsOX3fzMtYIZHhd6QlunBd8yYpPl42TFb0wZGZcxIFjuz ungX/4Ts9/VMBHKsEfzNpYlrfBUf2ODOdlzaefuur6D8njYpfeI2BNsP3UIKAmEw49qP UvGbdTNwKNnWTix86Wgs+hOunOFn5hwC179idT9UU6mAwU3kt7ZWWKtwb9oQqi3dNp++ vledDXDJj7+zaw743ct+fBfViExvgeyRFh1MIEFX7KMsG7uspltzE7FuKWFCpwBfom7O PmONwG1K+QeDWLJZZRytW0OHnNUJquC52uqP37WBO4Mv5/5mXUMpNAKa0IF5RMlkaOKp k+Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IYDHKbGA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d18-20020a170903231200b00168c7a3808csi2343469plh.210.2022.06.16.03.26.05; Thu, 16 Jun 2022 03:26:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IYDHKbGA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbiFPKKO (ORCPT + 99 others); Thu, 16 Jun 2022 06:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376384AbiFPKKJ (ORCPT ); Thu, 16 Jun 2022 06:10:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DCB35D64F; Thu, 16 Jun 2022 03:10:06 -0700 (PDT) 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 D3D5F614E7; Thu, 16 Jun 2022 10:10:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BED15C34114; Thu, 16 Jun 2022 10:10:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655374205; bh=5Dv9JP3bXTE2uRf8zpfYaCIFCVrfFMzOlE7ggr6awAo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IYDHKbGAj2H3C7abExcrGg3XeVyxWJFBwZbj+e7U25ljTeS1lgsku/UdBOrtJb0y4 el7qE6m5ZwuK/cF75cI2QylFcHrU1bkD32jUColuY5DHgWdKitem53ILh90Fd6FQrZ u2XniIJ0R5Pa4N5Be3F3keALqflYTtaOh7lV9u+k= Date: Thu, 16 Jun 2022 12:10:02 +0200 From: Greg Kroah-Hartman To: Sebastian Ene Cc: Rob Herring , Arnd Bergmann , Dragan Cvetic , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, maz@kernel.org, will@kernel.org, vdonnefort@google.com, Guenter Roeck , kernel test robot Subject: Re: [PATCH v6 2/2] misc: Add a mechanism to detect stalls on guest vCPUs Message-ID: References: <20220616092737.1713667-1-sebastianene@google.com> <20220616092737.1713667-3-sebastianene@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220616092737.1713667-3-sebastianene@google.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 16, 2022 at 09:27:39AM +0000, Sebastian Ene wrote: > This driver creates per-cpu hrtimers which are required to do the > periodic 'pet' operation. On a conventional watchdog-core driver, the > userspace is responsible for delivering the 'pet' events by writing to > the particular /dev/watchdogN node. In this case we require a strong > thread affinity to be able to account for lost time on a per vCPU. > > This part of the driver is the 'frontend' which is reponsible for > delivering the periodic 'pet' events, configuring the virtual peripheral > and listening for cpu hotplug events. The other part of the driver > handles the peripheral emulation and this part accounts for lost time by > looking at the /proc/{}/task/{}/stat entries and is located here: > https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3548817 > > Reported-by: kernel test robot > Signed-off-by: Sebastian Ene > --- > drivers/misc/Kconfig | 12 ++ > drivers/misc/Makefile | 1 + > drivers/misc/vcpu_stall_detector.c | 222 +++++++++++++++++++++++++++++ > 3 files changed, 235 insertions(+) > create mode 100644 drivers/misc/vcpu_stall_detector.c > > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > index 41d2bb0ae23a..9b3cb5dfd5a7 100644 > --- a/drivers/misc/Kconfig > +++ b/drivers/misc/Kconfig > @@ -483,6 +483,18 @@ config OPEN_DICE > > If unsure, say N. > > +config VCPU_STALL_DETECTOR > + tristate "VCPU stall detector" > + select LOCKUP_DETECTOR > + help > + Detect CPU locks on the virtual machine. This driver relies on the > + hrtimers which are CPU-binded to do the 'pet' operation. When a vCPU > + has to do a 'pet', it exits the guest through MMIO write and the > + backend driver takes into account the lost ticks for this particular > + CPU. which virtual machine framework is this for? kvm? xen? hyperv? vmware? something else? Specifics please... thanks, greg k-h