Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp193255iob; Mon, 2 May 2022 16:50:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGHTSJSQMH11f6cpld52MMk8njT2SLfiNXBDM/cqToYs7Kg6h+Rr8/MLNSLZ4tc0Z0fihh X-Received: by 2002:a63:2a93:0:b0:3c2:3ed1:7804 with SMTP id q141-20020a632a93000000b003c23ed17804mr4275511pgq.38.1651535412670; Mon, 02 May 2022 16:50:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651535412; cv=none; d=google.com; s=arc-20160816; b=0KzCtCQufcy80XTidaWC7SjyVhjgWVi07zWcWCEnUIwksxXRjOU2wvyNDtC+eefJTR bn10tkHJlNUe980S1hk9WjaiqYIwiPgeh5zMoXbG2kW7swY/1159BTUPAIxgbdhMQSa2 /znI6yTIPDckuejvPAZqFrPgBpTtcWcgK9OEWa3qXJGfEAZ5FGPVFQjhMqfwV3ySIz7Q 1+5KPhsZSUhnCgHaLYtFZnv2uWeIqgBoni62ZLUc7AEN7xYIBqlFpdWRwxk+n5n/JCO/ +DrUMkmAfr3iufGrRobmgSwsz9Gu5ruX935+iqa39gK45x06+pFP7WDLHlMgVxdGfX/+ IAVQ== 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=vDT6/tY8zoIHIWNIkOC1cQJGoUW1dbZJBla1wtkRQW0=; b=LQfguVN3fMydOqYW4aFVjUPV6s5/dGCb1dofW1l5XUoRmDx6fmf4Akq0kGJ4IM5ZKa 4FtGIjb0uxdQBQQ9+zQjxBONVqZ7CUzGf4FYPWWrWj8ILBpf+pDKSefJlyJq7bftehge qyv4eJabaVF/mmRZN0EldJQPi27J5Pu3TQPIxBVGYgbwts6WNOlQzf2V+dfTYhcWIRCX 7XvRjE+t9ToXaLIz8BSatDtZH+RptaKMpzXnONFM1JVpzDDZ2B7ZhJoVRR+7rUEP0Hxj E3IsL3LnEDZRsKFH4Xf5mzC7WN9xnSTY96b/Pe3Y7z0hAME/vlCMSiSpkBOOi9DY48Vt qGWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BlYI1gyT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ob3-20020a17090b390300b001d99fab8c25si808070pjb.10.2022.05.02.16.50.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:50:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BlYI1gyT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6B14233A3A; Mon, 2 May 2022 16:50:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383401AbiEBGBq (ORCPT + 99 others); Mon, 2 May 2022 02:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231432AbiEBGBm (ORCPT ); Mon, 2 May 2022 02:01:42 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 886D22CC9C for ; Sun, 1 May 2022 22:58:14 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id n126-20020a1c2784000000b0038e8af3e788so7915794wmn.1 for ; Sun, 01 May 2022 22:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vDT6/tY8zoIHIWNIkOC1cQJGoUW1dbZJBla1wtkRQW0=; b=BlYI1gyTfrKeQnkuyubgA0no/SA5tgsvSzauIm8z7eCvzd+FfdolqNaIyCpXJ4SSbD Xh75zmWDwrLxIBWNkqm3wJTBFunLSzHOLC37brmVQD/MJIkoHXNr++ZJFyU5DPtOzXfQ MjNJCPyjKAwAEpYQxMKLfpy2cs931MZpbJvqDcFeG/rNm/BnjokJo3IwZrR99J6W7fP1 VL08b7P6QSNgYhKAqtUTalnVugH/+NxOKA/9LRSvYKaG3UY2kTwSW3sH6xVW2JNe1qjm F7PcqujgpGX1/svIvJl53fo0MihXVsQhjSgr8at8sPLKwRymckMzTtA4bAqtQYZN5VuF yz0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vDT6/tY8zoIHIWNIkOC1cQJGoUW1dbZJBla1wtkRQW0=; b=TjvLzGKMaXvT/8LDc2tSCEMcujiJNOTftS9fAjUJr7LLfgRBVoChzjNYyhCtrqc+yT RBmzInd4JB9Tyr5ChX6ArmHvAuwWfRfwpdVYwHlB0a7jlSzmP+Hkw5onW+6kDHKpI/1+ 2c0BMKeE14soVWaL7ojx26v4/+bbVSwzrMWJmTwifp8xtUoJRmUSfbOdB0NSRSfWyWtN KGlNmn40YmMQpwOIo25LSbFr++SCigVCqvXsJr/6KhJp6tXHY4sYV6s2Y7WjMdpU3hfk E0/vHgMkcDWfNddiPz/pfjKHfw2TxifPKzLJyv5sXlqHzFHWcsnY3Vdyj5If/ETQm9d7 aOuQ== X-Gm-Message-State: AOAM531e1gPyhm7NGjyakuWSANQK/XyTB44lSIJfyDurn9NoG3mUIaWo D/PCqa91lAAUTJ2PEDNnl0fI9w== X-Received: by 2002:a05:600c:48b:b0:394:2ee9:5847 with SMTP id d11-20020a05600c048b00b003942ee95847mr8501983wme.117.1651471093005; Sun, 01 May 2022 22:58:13 -0700 (PDT) Received: from google.com (49.222.77.34.bc.googleusercontent.com. [34.77.222.49]) by smtp.gmail.com with ESMTPSA id o8-20020a1c4d08000000b003942a244ecesm5393224wmh.19.2022.05.01.22.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 May 2022 22:58:12 -0700 (PDT) Date: Mon, 2 May 2022 05:58:10 +0000 From: Sebastian Ene To: Guenter Roeck Cc: linux-kernel@vger.kernel.org, Derek Kiernan , Dragan Cvetic , Arnd Bergmann , devicetree@vger.kernel.org, qperret@google.com, will@kernel.org, maz@kernel.org, Greg Kroah-Hartman , Rob Herring Subject: Re: [PATCH v4 2/2] misc: Add a mechanism to detect stalls on guest vCPUs Message-ID: References: <20220429083030.3241640-1-sebastianene@google.com> <20220429083030.3241640-3-sebastianene@google.com> <4217c96d-2fe2-fdef-3b15-b5368499f1bf@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4217c96d-2fe2-fdef-3b15-b5368499f1bf@roeck-us.net> X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Sat, Apr 30, 2022 at 05:36:50AM -0700, Guenter Roeck wrote: > On 4/29/22 23:18, Greg Kroah-Hartman wrote: > > On Fri, Apr 29, 2022 at 09:51:51AM -0700, Guenter Roeck wrote: > > > On 4/29/22 01:48, Greg Kroah-Hartman wrote: > > > > On Fri, Apr 29, 2022 at 08:30:33AM +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 > > > > > > > > > > Signed-off-by: Sebastian Ene > > > > > --- > > > > > drivers/misc/Kconfig | 12 +++ > > > > > drivers/misc/Makefile | 1 + > > > > > drivers/misc/vm-watchdog.c | 206 +++++++++++++++++++++++++++++++++++++ > > > > > 3 files changed, 219 insertions(+) > > > > > create mode 100644 drivers/misc/vm-watchdog.c > > > > > > > > > > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > > > > > index 2b9572a6d114..26c3a99e269c 100644 > > > > > --- a/drivers/misc/Kconfig > > > > > +++ b/drivers/misc/Kconfig > > > > > @@ -493,6 +493,18 @@ config OPEN_DICE > > > > > If unsure, say N. > > > > > +config VM_WATCHDOG > > > > > + tristate "Virtual Machine Watchdog" > > > > > + 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. > > > > > + To compile this driver as a module, choose M here: the > > > > > + module will be called vm-wdt. > > > > > > > > You forgot to name the module properly here based on the Makefile change > > > > you made. > > > > > > > > And again, as this is called a "watchdog", it seems crazy that it is not > > > > in drivers/watchdog/ > > > > > > > > > > I disagree. It is not a watchdog driver in the traditional sense (it does > > > not use, want to use, or need to use the watchdog driver API or ABI). > > > Its functionality is similar to the functionality of kernel/watchdog.c, > > > which doesn't belong into drivers/watchdog either. Hi, > > > > Ah, ok, that makes more sense, the user/kernel api is not the same. > > Someone should put that in the changelog next time :) > > I will include this in the changelog to fix the confusion. > > Renaming it to "VCPU stall detector" or similar should fix the confusion. > Yes I think that is a better naming. Thanks, Seb > Guenter