Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2244804pxy; Sat, 24 Apr 2021 09:21:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWXIcTfPYNHsIjhXw/sHdgXFEVVp1gff+uAyC1nTKyz0mz+b+bIFdNujudzGmRk8WwGVpG X-Received: by 2002:a62:2a14:0:b029:263:20c5:6d8c with SMTP id q20-20020a622a140000b029026320c56d8cmr9491633pfq.23.1619281282046; Sat, 24 Apr 2021 09:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619281282; cv=none; d=google.com; s=arc-20160816; b=xPth199U5dShKhlLQUpVrbFG5Wf9QV6YSuyssthjlUaR9OXUDDCAgZYp24pytxGEud ljCmHW/YhRNiZ4GaiPiFd6uv1kiqIWKjJ1+W8HBah7l1W57aLibqyu5eRgH2gJpkyy4P I0S6sA6zDdECfV2P5gZuX3we27jSBCDRSmcFOdVxsXSqivCWqrj/DzxUNSwd3qfdBBvX 9EMgLPL0yX4qHaHoUq9PFcUolDP9riUp+bP6G5q22d/p6Z+kViayGYjGtXBwjEES1WFf odcZVr1tmdJJsA3V4xUH+pmFY53KHUlFVK+DRH3p4qk5QoRPnJ2WspHio3rOTm0qxxEQ /BZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=1IZI5oYGoyqaV69twsS9xvWVpWR8o6nCBdV9uW5xHA0=; b=FuhGIimk/JFDAIduXN2Tr3KqfLwklsLheNsm3oJQkBIOXkWMsc0ANcQs+mEgihVw49 4vICEsbWnYk1ylbtJCMuGg+ITpmcOFWdn8SHWVxdLKhZZR3LTu/oHHfwuy0DtDRWs/TS zUEpSo10zHhL0StoMIbqhj7stjZBJImlgly/fu4RBxBPErr9rSFHUsvRQ1uKAwmHg1n2 6PgtOAIVIvAnuymxHofA0FLpQAuoy4lYfosbi6IdvX66WDZxtpEzAgv3qxftEvrYzQJn PevaNyk7JNhA9LfCKCazjvtpVp/Xb+nrbIHe2s+ql2Whc5Opps+e9aSSQcujwBwAY1Tp InNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si11548313plq.11.2021.04.24.09.21.08; Sat, 24 Apr 2021 09:21:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232539AbhDXQUg convert rfc822-to-8bit (ORCPT + 99 others); Sat, 24 Apr 2021 12:20:36 -0400 Received: from jptosegrel01.sonyericsson.com ([124.215.201.71]:13009 "EHLO JPTOSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbhDXQUf (ORCPT ); Sat, 24 Apr 2021 12:20:35 -0400 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: 8BIT 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 == 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.  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.