From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2B98C433ED for ; Sat, 24 Apr 2021 16:20:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7CBD061481 for ; Sat, 24 Apr 2021 16:20:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CBD061481 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=sony.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C12406B0036; Sat, 24 Apr 2021 12:20:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC1626B006C; Sat, 24 Apr 2021 12:20:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC2FF6B006E; Sat, 24 Apr 2021 12:20:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0205.hostedemail.com [216.40.44.205]) by kanga.kvack.org (Postfix) with ESMTP id 9158C6B0036 for ; Sat, 24 Apr 2021 12:20:00 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4A3598248047 for ; Sat, 24 Apr 2021 16:20:00 +0000 (UTC) X-FDA: 78067772160.10.57AAE76 Received: from JPTOSEGREL01.sonyericsson.com (jptosegrel01.sonyericsson.com [124.215.201.71]) by imf14.hostedemail.com (Postfix) with ESMTP id 68112C0007D5 for ; Sat, 24 Apr 2021 16:19:46 +0000 (UTC) Subject: Re: [RFC PATCH] watchdog: Adding softwatchdog To: Tetsuo Handa , Guenter Roeck , Wim Van Sebroeck , Andrew Morton , , , , Shakeel Butt References: <20210424102555.28203-1-peter.enderborg@sony.com> <20210424102555.28203-2-peter.enderborg@sony.com> <844e3ecb-62c3-856a-7273-e22eee35e80f@i-love.sakura.ne.jp> From: peter enderborg Message-ID: Date: Sat, 24 Apr 2021 18:19:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <844e3ecb-62c3-856a-7273-e22eee35e80f@i-love.sakura.ne.jp> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: en-GB X-SEG-SpamProfiler-Analysis: v=2.3 cv=DLnxHBFb c=1 sm=1 tr=0 a=fZcToFWbXLKijqHhjJ02CA==:117 a=IkcTkHD0fZMA:10 a=3YhXtTcJ-WEA:10 a=ZvUQ5lN1LNaykfZji70A:9 a=QEXdDO2ut3YA:10 X-SEG-SpamProfiler-Score: 0 X-Rspamd-Queue-Id: 68112C0007D5 X-Stat-Signature: sjfzfc8oh6ey8ychx9bppiadcwb9sj6q X-Rspamd-Server: rspam02 Received-SPF: none (sony.com>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=JPTOSEGREL01.sonyericsson.com; client-ip=124.215.201.71 X-HE-DKIM-Result: none/none X-HE-Tag: 1619281186-544558 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 4/24/21 5:23 PM, Tetsuo Handa wrote: > On 2021/04/24 23:41, Guenter Roeck wrote: >> On 4/24/21 3:25 AM, Peter Enderborg wrote: >>> This is not a rebooting watchdog. It's function is to take other >>> actions than a hard reboot. On many complex system there is some >>> kind of manager that monitor and take action on slow systems. >>> Android has it's lowmemorykiller (lmkd), desktops has earlyoom. >>> This watchdog can be used to help monitor to preform some basic >>> action to keep the monitor running. >>> >>> It can also be used standalone. This add a policy that is >>> killing the process with highest oom_score_adj and using >>> oom functions to it quickly. I think it is a good usecase >>> for the patch. Memory siuations can be problematic for >>> software that monitor system, but other prolicys can >>> should also be possible. Like picking tasks from a memcg, or >>> specific UID's or what ever is low priority. >>> --- >> NACK. Besides this not following the new watchdog API, the task >> of a watchdog is to reset the system on failure. Its task is most >> definitely not to re-implement the oom killer in any way, shape, >> or form. >> > I don't think this proposal is a watchdog. I think this proposal is > a timer based process killer, based on an assumption that any slowdown > which prevents the monitor process from pinging for more than 0.5 seconds > (if HZ =3D=3D 1000) is caused by memory pressure. You missing the point. The oom killer is a example of a work that it can do= . it is one policy. The idea is that you should have a policy that fits your = needs. oom_score_adj is suitable for a android world. But it might be based on uid's if your priority is some users over other.=C2=A0 Or a memcg. Or as Christophe Leroy want the current. The policy is only a example that fits a one area. You need to describe your prioritization, in android it is oom_score_adj. For example I would very much have a policy that sends sigterm instead of sigkill. But the integration with oom is there because it is needed. Maybe a bad choice for political reasons but I don't it a good idea to hide the intention. Please don't focus on the oom part.