Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1213909pxb; Wed, 6 Apr 2022 11:30:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkUobkG8Fi+r7pJ4j9rh092IOC1q0/teh6p/oJ82JTSowqmf7YzBexy00XTcBD1PATqXUz X-Received: by 2002:a05:6a00:1c95:b0:4fc:da3c:518e with SMTP id y21-20020a056a001c9500b004fcda3c518emr10295561pfw.72.1649269817639; Wed, 06 Apr 2022 11:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649269817; cv=none; d=google.com; s=arc-20160816; b=XU0TnWb/uVAWPVB63o2bS4BcZ5JI39JUmO4M6pYLdz8JyjmL+2VzKcosHOfu0PXUWF kRLENV1HRu2dt/3RqVKPwU8dmnpUloweit3o0azA7alK3cBwYiBm2qZMdn9pelkykiYa aAtHYY2WmH+9wF95my+9dn9pNsZCNKLLD4nwiEbfaT2wd9UiiMCZe2dcreaIa4CJrP+B P3z1h0KiD73yeiilTRbW/m6IMTmkcuSHiiBFNlY/NTufwy5IVhZxn1zdZFrtoGpPcn3Q nQXOI2PkXCsDeWZR4xBolUeGyQbMf52GElyiRFCiZ7tKFpBlOoAPMEtGdks+rExcln3m rCrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:sender:dkim-signature; bh=3uOnnnRcHyGaYWBW4Eshs7k8QuZm369r3CQ2+mOAwQY=; b=CeAjReaVz7MQ9eknJexT4XKoYHLmhqZ3ZaQrObb1y4ZcoNnoGY01YcLiLrx0uYfIvB 5BCWF8sksBFcbvOdDoTbU+bUH2aaHd4sL7YFJkIWpMNvqXKJCYnWNTBESssiHzlj69iu M/y11J1kEjfIekiCFnx3uH57IyFIFo6mfZv8m3BZ0ZnvZrSR25MZquKutYmEJhPM8zJa GpFZ9BNlg5iDJlMwGRMq8i2Ss2irWZfqy6u7gaCOzCM2rHPFZ/IS/OjMOwTTqSP6bJqi oPWisxkR+yoMOJGpkv6MOPHM3WjMj4u1v/FCntG0NjHrvSxIgsbRr8NjjKUK1UhsUxSS cWxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ct4X6Wqx; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i10-20020a63130a000000b00399750cb8a2si4101168pgl.630.2022.04.06.11.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 11:30:17 -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=@gmail.com header.s=20210112 header.b=ct4X6Wqx; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5125A6B0BE; Wed, 6 Apr 2022 11:13:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240517AbiDFSOz (ORCPT + 99 others); Wed, 6 Apr 2022 14:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240248AbiDFSO0 (ORCPT ); Wed, 6 Apr 2022 14:14:26 -0400 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2122C21FF6A; Wed, 6 Apr 2022 09:52:09 -0700 (PDT) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-de3ca1efbaso3534790fac.9; Wed, 06 Apr 2022 09:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:content-language:to :cc:references:from:subject:in-reply-to:content-transfer-encoding; bh=3uOnnnRcHyGaYWBW4Eshs7k8QuZm369r3CQ2+mOAwQY=; b=ct4X6WqxuU/Q1UMCjoyR9Z012Uf01Ku3mKkW2dTVq7fENlE1OrhMArUQnWla7qXY/0 rVY929iY98LRRp8e2z1qqXhIZJ9vikZ2vcauuubzw4RJG5nBxGRsxt0jpvcoTiKaQPVs vqgLAZ1uWHEZZyuEgXcmXj+ed/kg7vPfJrdMrDncxIoU12szbY8Fq0exTo6eX/Ue7PtZ 2GXO5K+FdLtO1uFIGuz1OBOu7bGap58RPt761BiW37HDoViGOmoCH0w06Vw/ZlayidCV Br0JRxjsUfAR0n/qt4FQrpd0K+z//E/KWxQ8BvgJ1/XRcYKTQzFFH1Y7bBj894ykp1Zg iy0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=3uOnnnRcHyGaYWBW4Eshs7k8QuZm369r3CQ2+mOAwQY=; b=FGh8ENyVS9gEv9ZXHp3oKCU3e9L+tarnrl6U5djElWEZkdgmBIviKBJ3DZZZivzbEQ HulA2I1ptupi3XmF4Dr+U25isU3pDMwr507QlaUtc6HcfASwHEO+TnsHGfXoA9iUjZ8a m4+vllc0KzVWvG8bH+WuF72VWEXv/zKGOWtRGtajL8FNSYJM3B4b0fqlUqb3sxRy3EZz SC6eonYYj3IauzedfoPxMgZpd0d+Giji7ptFqeIIgm7Z6Vb9TgyAj5NA+ItHgMUmcriT Gxy5zhMN5lpKVXp8LdWVfAfopjnK7qbJ2Jm9+SLU83V0HYdd9u2rdNTe+YdAjDEZA5Dc K/WA== X-Gm-Message-State: AOAM532XcPOiHw4oG8yqD95BbzUG+KiahZD0SPLZozeiuni3JqvELDXa Q+2gZUxxgkkfZBe0pYe0weaEkuhwLAM= X-Received: by 2002:a05:6870:c34c:b0:da:b3f:326a with SMTP id e12-20020a056870c34c00b000da0b3f326amr4423684oak.282.1649263928427; Wed, 06 Apr 2022 09:52:08 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id s41-20020a05683043a900b005cdb244c9c3sm7284357otv.47.2022.04.06.09.52.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Apr 2022 09:52:07 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Wed, 6 Apr 2022 09:52:05 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: Sebastian Ene 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 References: <20220405141954.1489782-1-sebastianene@google.com> <20220405141954.1489782-3-sebastianene@google.com> <20220405211551.GB2121947@roeck-us.net> From: Guenter Roeck Subject: Re: [PATCH 2/2] watchdog: Add a mechanism to detect stalls on guest vCPUs In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 4/6/22 09:31, Sebastian Ene wrote: > 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 ? > You are introducing qemu,virt-watchdog, so it seems to me that any argument along that line doesn't really apply. I think it is more a matter for core kernel developers to discuss and decide how this functionality is best instantiated. It doesn't _have_ to be a device, after all, just like the current lockup detection code is not a device. Either case, I am not really the right person to discuss this since it is a matter of core kernel code which I am not sufficiently familiar with. All I can say is that watchdog drivers in the watchdog subsystem have a different scope. Guenter >> 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