Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2880526imm; Sun, 30 Sep 2018 07:00:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV60t6rVrzywmcgyVyGDC2E5LxVqmps4VLaK/9BagZZlPEFcME9P1q2rGdDb5WpD2eABj98HX X-Received: by 2002:a63:fd58:: with SMTP id m24-v6mr6772438pgj.132.1538316026070; Sun, 30 Sep 2018 07:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538316026; cv=none; d=google.com; s=arc-20160816; b=FvaFVKsWOFWjN2ZexSWkyHVk0AUkLEev+ws2R7Okd2QH7IL9NSpVQRsLm3iMDWVqiH t07mXiTbHkZayzWsKQCb7umCeuQobjSMpj4K7mu6g4xTMyJM7lX6kJUnWKU63Gy5PVq/ DONFWf5JIBz7JVyu12wY9J4ofHdTjHVpvi9dKH84QWmWv1+oGFWJ/qTd/1r0IM2lj/GI FlgZGmQD15o3T17nZWfCd24CQG7eA3K3U0c2e6b7z+w/tcTGiyBCoVVxKXikK/HkzZ8Y tyCHcOqkTFdbHYPofnobQpKslNp8sP/X4xBzud+hBQNkpDzn8QIvIv2c7aQh9xpP2cwc v9iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=tEBO+YrSeyX2qSr6vKlEud5u/pB0SW0zhbCxDnJWAUI=; b=XKIKLRkd5Cm4UVDXXItsHc84ONHAuluwpyKdZx/7dr5joEMms1FLcdJPcMsgXIVIJd 1Sso5yWJ1tGJhOFYKjiAYS0WPi33PGkShQb0I1PfirhbUkSyX2jXswwZ4B3m4JGJngS0 BSA5gGmEoUJjo7JZog2tbk/DWJ5BiNbk1IFKPoF8t7qNFwMJsJHBisYvAD/Ymtu9piOp hw7RGz+te7j3wFRnqOEhFQGVJjReBxW7YpOL0yKcJo8j5xLKnEuOjWmbsJo+ccidt4v5 XS15HLJm/zMoN+IWQvNXbwfXHHgnI0Nl/i0qicG385qYDrtw+uCoNoSEM18nsm7S4GO/ GDQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ORZhCYbM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23-v6si9626909pgj.229.2018.09.30.07.00.10; Sun, 30 Sep 2018 07:00:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ORZhCYbM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728518AbeI3UdN (ORCPT + 99 others); Sun, 30 Sep 2018 16:33:13 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33229 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728361AbeI3UdN (ORCPT ); Sun, 30 Sep 2018 16:33:13 -0400 Received: by mail-pg1-f194.google.com with SMTP id y18-v6so7645584pge.0; Sun, 30 Sep 2018 07:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tEBO+YrSeyX2qSr6vKlEud5u/pB0SW0zhbCxDnJWAUI=; b=ORZhCYbM+YJLpUNb47AieWj73RXPmjFnOMbHSPWLEnB+Ia+CVtTP+6dcNdU4qM504e r7CsI4snY1gQuO6DwpiaCFY09CGDM961XfVMnFtpoGR1qjvN83hCY/NE+5OJ7dtlArqZ D5XHw9gW8W5na3ya6p4RgUZSFVGgehOEA/M0Gn6fpcUmh9prQ5zW1/Wbv1cHzkiA6neZ fCzI7gicCJI+P4k8qPUCbafIAn+lbTOhVGNxYnXwnOFjyH7lY2YvaRx7FC3sIEej/n2O iJNEGT2YcDpzQJDTH7xg/N6G9utvQrUePJiM8zDZET1RZ8lfN/eD3l3PigFLTpqOFjU/ iF6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tEBO+YrSeyX2qSr6vKlEud5u/pB0SW0zhbCxDnJWAUI=; b=jSB9P71RM74ZD3qyEc24a6GSpObXZdJrpxcVXtYoZqbEiGtoClN67HRWQZ1/VylwTl 0XLVUsPOKvvZ/dn5jFXqVKWrlfWSGGFv8LufuSq4kNeq7U1Hhwb1nLTa7JD5MTpDWC1Y WprXheuZEwnh4lWxo5JCaHpzq7Qbkywuv6JBrvArOegD8Ih9k17jLspTpTs9nsuMvwbO x0N/lqVTiBu7ApBcxi9cGu63rNWlATS5RlaGGyWj6iew8I9MOJNVzv+1d8POmZr8f51f QrCAA5hunWFe4HTG0prsmlxHdip639U2z8ArReRKGWRStkXSN29ptAtV5UsyehqdeK4J 5SPQ== X-Gm-Message-State: ABuFfohHOrp4R0vIvUhor08FVwywbCTjv8GJHjrojTRFzEBGlqXdw5iK JMzvsisSkEajeqwancvJPkXQZ+fR X-Received: by 2002:a17:902:2:: with SMTP id 2-v6mr7614379pla.178.1538316004101; Sun, 30 Sep 2018 07:00:04 -0700 (PDT) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id r65-v6sm5098301pfj.5.2018.09.30.07.00.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 07:00:03 -0700 (PDT) Subject: Re: [PATCH RT 2/2] watchdog, rt: prevent deferral of watchdogd wakeup To: Julia Cartwright , Sebastian Andrzej Siewior , Thomas Gleixner Cc: "linux-kernel@vger.kernel.org" , "linux-rt-users@vger.kernel.org" , Steffen Trumtrar , Tim Sander References: <0e02d8327aeca344096c246713033887bc490dd7.1538089180.git.julia@ni.com> From: Guenter Roeck Message-ID: <51edd05c-a5a2-062f-bbc6-1ca7af81e4d8@roeck-us.net> Date: Sun, 30 Sep 2018 07:00:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <0e02d8327aeca344096c246713033887bc490dd7.1538089180.git.julia@ni.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/28/2018 02:03 PM, Julia Cartwright wrote: > When PREEMPT_RT_FULL is enabled, all hrtimer expiry functions are > deferred for execution into the context of ktimersoftd unless otherwise > annotated. > > Deferring the expiry of the hrtimer used by the watchdog core, however, > is a waste, as the callback does nothing but queue a kthread work item > and wakeup watchdogd. > > It's worst then that, too: the deferral through ktimersoftd also means > that for correct behavior a user must adjust the scheduling parameters > of both watchdogd _and_ ktimersoftd, which is unnecessary and has other > side effects (like causing unrelated expiry functions to execute at > potentially elevated priority). > > Instead, mark the hrtimer used by the watchdog core as being _HARD to > allow it's execution directly from hardirq context. The work done in > this expiry function is well-bounded and minimal. > > A user still must adjust the scheduling parameters of the watchdogd > to be correct w.r.t. their application needs. > > Cc: Guenter Roeck > Reported-and-tested-by: Steffen Trumtrar > Reported-by: Tim Sander > Signed-off-by: Julia Cartwright Acked-by: Guenter Roeck > --- > drivers/watchdog/watchdog_dev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c > index ffbdc4642ea5..9c2b3e5cebdc 100644 > --- a/drivers/watchdog/watchdog_dev.c > +++ b/drivers/watchdog/watchdog_dev.c > @@ -945,7 +945,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd, dev_t devno) > return -ENODEV; > > kthread_init_work(&wd_data->work, watchdog_ping_work); > - hrtimer_init(&wd_data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); > + hrtimer_init(&wd_data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); > wd_data->timer.function = watchdog_timer_expired; > > if (wdd->id == 0) { >