Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1386841pxy; Sun, 1 Aug 2021 23:36:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/IfVe0PXJU1rnnUTR3RQhf6nUQdAEjtEP6zh7Bq3q7tQ7H/smimg2AulQjkmxJep2WrYu X-Received: by 2002:a92:c503:: with SMTP id r3mr389565ilg.148.1627886210257; Sun, 01 Aug 2021 23:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627886210; cv=none; d=google.com; s=arc-20160816; b=ScPRuNWXnvevrGetjB1F9az5iYvMxDM/e+fghq5Pmzw+60VoUMnQcCs5Vsf5Hu2GOJ EZnuKxDGj10CqqOPlQsqSz2FXQdJU30y/jLf+HIW4iSmJlRvPGCr6yjzdn4usPEqEBIP wSsgIvP5m6YzL4+50GtsR8K4tvHgORRszseLyUUODPK7qeZ+2AM46szqM9UytdHdeWaM vaRADjZFWUqjTPVH7dLTmGarjtUwWsTyX4rUZzOI6nlkFwcS1Ngei40wWzDXJlmXkVx7 9pLTwUw+b/l/8IX8ybWsBUJIzx73IqPcFxf2Q4T0r0efFhP+WTtfO87VQS06sXL2XJcx UNAw== 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:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=r84XX0cm6bFzKGGOBYj6/SjXRF+HDztprWThoilY/aQ=; b=Kshgqk/rwdQtkIxT0GvK3ZmiI7ni72IZxfcCD6pF1sEvJktLVxWygc4OvoyznDQmim ErNN++FnnCFZNj8Aes28eP5Nuoa9NV7k+N98vqh1Ti5iWyDHQNV9zNVYO6QUbdnI2x/f Etx2ZLHJuOwhO8LzIe/R+HwvvOuB6GZhdfr3BoLO00mu3A4At1GqFxnJDDsgq7TZdSEs fWzsncjpxG6bTMfQNJmGdhUamQ655/HW3SOnS6YbdSZ4bpSgCV7gIuJLLZD9ATTa683H RPC4e8vQKHanTrMjb6ocZR41deFaO/T9CwqBmSy+/r5WniD0WXyBscnkklI82p0mz8d9 zb/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=seGuGpoQ; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si12023735ilm.100.2021.08.01.23.36.38; Sun, 01 Aug 2021 23:36:50 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b=seGuGpoQ; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232190AbhHBGek (ORCPT + 99 others); Mon, 2 Aug 2021 02:34:40 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:33504 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbhHBGej (ORCPT ); Mon, 2 Aug 2021 02:34:39 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 9162A1FF2D; Mon, 2 Aug 2021 06:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1627886068; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=r84XX0cm6bFzKGGOBYj6/SjXRF+HDztprWThoilY/aQ=; b=seGuGpoQD999s3SgQHtTQ/Ro2wIOmNv/Iu0GtiamSBaAWqerWVzcZ1n4c3MIsXNfbGNTcV +5IHSVyjr52wLlMHT3jnxBnyeclOZeNgERBNfqaSrOmYy5pA6aCUu/iPgrGgAPNgA5x+7L +2+/wuUPZSQtRfHm7w7cJt9mIDV4Yo4= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 13E37A3B83; Mon, 2 Aug 2021 06:34:28 +0000 (UTC) Date: Mon, 2 Aug 2021 08:34:24 +0200 From: Michal Hocko To: Aaron Tomlin Cc: linux-mm@kvack.org, akpm@linux-foundation.org, penguin-kernel@i-love.sakura.ne.jp, rientjes@google.com, llong@redhat.com, neelx@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm/oom_kill: show oom eligibility when displaying the current memory state of all tasks Message-ID: References: <20210730162002.279678-1-atomlin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210730162002.279678-1-atomlin@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 30-07-21 17:20:02, Aaron Tomlin wrote: > Changes since v2: > - Use single character (e.g. 'R' for MMF_OOM_SKIP) as suggested > by Tetsuo Handa > - Add new header to oom_dump_tasks documentation > - Provide further justification > > > The output generated by dump_tasks() can be helpful to determine why > there was an OOM condition and which rogue task potentially caused it. > Please note that this is only provided when sysctl oom_dump_tasks is > enabled. > > At the present time, when showing potential OOM victims, we do not > exclude any task that are not OOM eligible e.g. Well, this is not precise. We do exclude ineligible. Consider tasks that are outside of the OOM domain for example. You are right that we are not excluding all of them though. > those that have > MMF_OOM_SKIP set; it is possible that the last OOM killable victim was > already OOM killed, yet the OOM reaper failed to reclaim memory and set > MMF_OOM_SKIP. This can be confusing (or perhaps even be misleading) to the > viewer. Now, we already unconditionally display a task's oom_score_adj_min > value that can be set to OOM_SCORE_ADJ_MIN which is indicative of an > "unkillable" task. > > This patch provides a clear indication with regard to the OOM ineligibility > (and why) of each displayed task with the addition of a new column namely > "oom_skipped". An example is provided below: > > [ 5084.524970] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj oom_skipped name > [ 5084.526397] [660417] 0 660417 35869 683 167936 0 -1000 M conmon > [ 5084.526400] [660452] 0 660452 175834 472 86016 0 -998 pod > [ 5084.527460] [752415] 0 752415 35869 650 172032 0 -1000 M conmon > [ 5084.527462] [752575] 1001050000 752575 184205 11158 700416 0 999 npm > [ 5084.527467] [753606] 1001050000 753606 183380 46843 2134016 0 999 node > [ 5084.527581] Memory cgroup out of memory: Killed process 753606 (node) total-vm:733520kB, anon-rss:161228kB, file-rss:26144kB, shmem-rss:0kB, UID:1001050000 > > So, a single character 'M' is for OOM_SCORE_ADJ_MIN, 'R' MMF_OOM_SKIP and > 'V' for in_vfork(). I have to say I dislike this for two reasons. First and foremost it makes parsing unnecessarily more complex. Now you have a potentially an empty column to special case. Secondly MMF_OOM_SKIP is an internal state that shouldn't really leak to userspace IMO. in_vfork is a racy check and M is already expressed via oom_score_adj so it duplicates an existing information. If you really want/need to make any change here then I would propose to either add E(eligible)/I(ligible) column without any specifics or consistently skip over all tasks which are not eligible. > 2.31.1 -- Michal Hocko SUSE Labs