Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1184823pxb; Wed, 6 Apr 2022 10:45:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuKyOTb/vuF2e6uPyA9Ei9qExKa2SMeEWUzRBec0idXXaoP9K8k25tabs0L03FO5uyg5s8 X-Received: by 2002:a63:7f1c:0:b0:382:1fb5:58b8 with SMTP id a28-20020a637f1c000000b003821fb558b8mr7847350pgd.507.1649267104189; Wed, 06 Apr 2022 10:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649267104; cv=none; d=google.com; s=arc-20160816; b=AzOjYEh1J/J0NUY4z8X4lIdq3MzpjVde1jv2AN08mS5A0gf0B4RU2dGZck/x1sCXXm 7oXaGHICdM8X8L3uLViTV49Gw7w9GOOVTSygM65EfclaQtvF44lKho6m4EoEE2g/9xzb V8tR4HpZJ6aQZk+YMS52/sz6/dMEkrVFSEK5jY95TNCD0MV0btGAq+qUYkLm5PdmXykv zg0pKWWkhyaEpzHPHgE6//E/O3dypeCZK+rHSdtuspqhsi9/9xbLshOj/MNcpnvfZY9S ZtEXbh1a53vaUZpRR1gCFNZZ74IorG79C9VgHzrM7udjxiOS3FiXClQu8H8iz1B3Xa6Q sqOQ== 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 :content-description:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qaoX3BjDFO/GNif1Q+vixm8BqZ3Y/mPSstxwcqbf+5M=; b=DO1wQHUP62+zrrsWWEKuzLEubzQ6kwynTrvvJQqw4JQVb673+CR+6LqSv8DnX6SNt2 01BYOWp2SM/qYf65rkIwA2gkEKYpIRQvxMRtRL6hhCQOQdzQ9bpOEfi9pZwXjj6gxdFW TZcZ2vySRMiAniUNKcCQXnkWUkeal1RECWLvMFXbFATZ8k/9qoSY/aYKVcB7u/3kMeF1 E0UpAL8crr686fU5Iaojw0OslaZhxWG4N2a37Iy1kSFdKVtaLH5ZzExp2YXRZcqKM7Q/ 50YCswwxbDHYtPDFMPW9Rjj9yZ5A7nTZ/ai/BHGbt8OZIHLk4AnTAwR2hp6U41Rnwosv t1Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nzD4KPaD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id k18-20020a628e12000000b004fe4cc6dd28si3223977pfe.250.2022.04.06.10.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 10:45:04 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nzD4KPaD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 B48B6AAB4C; Wed, 6 Apr 2022 10:39:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239587AbiDFRlA (ORCPT + 99 others); Wed, 6 Apr 2022 13:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239462AbiDFRkq (ORCPT ); Wed, 6 Apr 2022 13:40:46 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10765F8462 for ; Wed, 6 Apr 2022 09:31:06 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id j12so4060360wrb.5 for ; Wed, 06 Apr 2022 09:31:05 -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-description:content-disposition:in-reply-to; bh=qaoX3BjDFO/GNif1Q+vixm8BqZ3Y/mPSstxwcqbf+5M=; b=nzD4KPaDH2mgfvo+qK8CjNMSL2p1TvJqIFu4vK92ISRWzJ3cm4PX5UsaYwqqGRDQwZ 1e1gjQLwrvhSRMT8QltmVssl9iPVUls34C2vABSMwE8XVSd3SiRdipGiDkMA7JiIzQ2N 39foFjiTmMZsPIT9FRPrWW7m+NKuVGKN6ESZJ19dAV/UBh3HK0qFmm8TNAEzLgA+VhzE BhvG2wQslbHaqK7PeGLRFnmvf3rlRdbDCWLT1aOb0XTzOpadAPWzPyaDcD8+Wsa0tQkK WBqTKT3VZIA80/I13fKAw6dAbfLf3uyJxXU3kk2NMsc1olkgbA9edGb9txNea8q/nwws fB5A== 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-description:content-disposition:in-reply-to; bh=qaoX3BjDFO/GNif1Q+vixm8BqZ3Y/mPSstxwcqbf+5M=; b=Uxz1C/XkLQF8O60nwyJjvqBGufJGnjY38m1wcOpOq4lDpwyH31FQQeQEbt7IwuWUhB R+d3+nHNFJkgQdZr40+0FpnlswqD2iJxaHciKEWXX1+j4khsg2ku3iK+fgje4/eYtvFF v5eEVmXJ0oTFaFIdiZiPWbgA8odc5Csa3SqfRWKGoW9hwf3lDHQlER8GrAtmUHYD9m8p gsV2eTLBqzuuSXTrxsaxBQK6HX+wgHMQUYdSkgA6bKG2f6E7cfvdyKAREQW7fTUv+caA Hm/YQx3qZr9NNE0Q7kCrKqQUsPHbw24mUfmTBUEq9I0qkgwqSfJALItGZNuFgeQAm3H5 1wKA== X-Gm-Message-State: AOAM533CzblVT/kL7X/wRlMAT82QxzrR5nACoDTc3eS+FtYMx4s1xhG2 NEN2lMbAR82Iw8dAWTvXQuUISw== X-Received: by 2002:a05:6000:144d:b0:205:8905:4cc1 with SMTP id v13-20020a056000144d00b0020589054cc1mr7435082wrx.508.1649262664158; Wed, 06 Apr 2022 09:31:04 -0700 (PDT) Received: from google.com (216.131.76.34.bc.googleusercontent.com. [34.76.131.216]) by smtp.gmail.com with ESMTPSA id e12-20020a5d6d0c000000b001a65e479d20sm18214727wrq.83.2022.04.06.09.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 09:31:03 -0700 (PDT) Date: Wed, 6 Apr 2022 16:31:02 +0000 From: Sebastian Ene To: Guenter Roeck Cc: Wim Van Sebroeck , Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, will@kernel.org, qperret@google.com, maz@kernel.org Subject: Re: [PATCH 2/2] watchdog: Add a mechanism to detect stalls on guest vCPUs Message-ID: References: <20220405141954.1489782-1-sebastianene@google.com> <20220405141954.1489782-3-sebastianene@google.com> <20220405211551.GB2121947@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Description: evicetree@vger.kernel.org, Content-Disposition: inline In-Reply-To: <20220405211551.GB2121947@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 Tue, Apr 05, 2022 at 02:15:51PM -0700, Guenter Roeck wrote: > Sebastian, > Hello Guenter, > On Tue, Apr 05, 2022 at 02:19:55PM +0000, Sebastian Ene wrote: > > This patch adds support for a virtual watchdog which relies on the > > per-cpu hrtimers to pet at regular intervals. > > > > The watchdog subsystem is not intended to detect soft and hard lockups. > It is intended to detect userspace issues. A watchdog driver requires > a userspace compinent which needs to ping the watchdog on a regular basis > to prevent timeouts (and watchdog drivers are supposed to use the > watchdog kernel API). > Thanks for getting back ! I wanted to create a mechanism to detect stalls on vCPUs and I am not sure if the current watchdog subsystem has a way to create per-CPU binded watchdogs (in the same way as Power PC has kernel/watchdog.c). The per-CPU watchdog is needed to account for time that the guest is not running(either scheduled out or waiting for an event) to prevent spurious reset events caused by the watchdog. > What you have here is a CPU stall detection mechanism, similar to the > existing soft/hard lockup detection mechanism. This code does not > belong into the watchdog subsystem; it is similar to the existing > hard/softlockup detection code (kernel/watchdog.c) and should reside > at the same location. > I agree that this doesn't belong to the watchdog subsytem but the current stall detection mechanism calls through MMIO into a virtual device 'qemu,virt-watchdog'. Calling a device from (kernel/watchdog.c) isn't something that we should avoid ? > Having said that, I could imagine a watchdog driver to be used in VMs, > but that would be similar to existing watchdog drivers. The easiest way > to get there would probably be to just instantiate one of the watchdog > devices already supported by qemu. > I am looking forward for your response, > Guenter Cheers, Sebastian