Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp634497ybl; Thu, 22 Aug 2019 02:28:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqweatKCBe7Xx8Y8479qM52aEe4L+Ora4UaJOJ02VJSVzuMX5dqd1vQ8SL8xDTAuUbfN4ltB X-Received: by 2002:a17:90a:eb05:: with SMTP id j5mr4526183pjz.102.1566466089829; Thu, 22 Aug 2019 02:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566466089; cv=none; d=google.com; s=arc-20160816; b=0tafBHSNoxqn1F5/r2DEUwrsnd8qEL+w2EH8PCNwT2cBbBfaUqGwLB3PqYPA8xgSIX DARNAGVyMn0DXwqxd98R40R+n123k0Ov5WI9vs67wo4IsKjKng4Pp592iJWuoRlBdSaR KQwUmFsXbYR2DBggLj/Vn1uAMGJd0BF+Mt5oOb+QiHCWv8Cslh86OBOJWDxHVyatNEsv 2yhzk1Gx3DqiQOu+Egq/fEGLRx2hTxm/z220t5I53UtBoqY2R3Wrqz3hhP7a6tOLaLWT /zcMnynhdRJVgQ785LLri0J+kGwSwl0iJOztPioYxfiLoGSvy6Zrp14swImsa50831In 1Tyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TWpxctx35Y8OP5/D64oOwZXcXNxBI3RfcQIgZ7PYvIQ=; b=aERdpqKGBOxsPxTOVc3SEzTvvgec9Qta94ZqEAxNgHpW7YHpqFjE/bCl1qgcz5UwMt C/+mIORWUSI9w/ORxv4/r6L4LBB0BRj8VJGnvCAUOGohrb9VUlhwdDmexXnHrunFhOdU g9c7rtDObccKwH0BM0jltwwZlyBPJ7cDF8NAWlljovN3liTj38I2/uNqh6I1dXikJWxA IFG0rxE2doaRpc+3+QL5KJPZ9O+9hhKX3N1kmOpDp8I6ciSuQM/Bruh0xi0m5r2j9lrz cNsOYAUjdepp6kFrDALOUqNiWz9LcQv0BN9W7MI37Hsqu5MqVLX5GXWR4Fd9PvTZKn++ vVlA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o61si17402176pld.21.2019.08.22.02.27.54; Thu, 22 Aug 2019 02:28:09 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731520AbfHVHVg (ORCPT + 99 others); Thu, 22 Aug 2019 03:21:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:35268 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727310AbfHVHVg (ORCPT ); Thu, 22 Aug 2019 03:21:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 56018AE1C; Thu, 22 Aug 2019 07:21:35 +0000 (UTC) Date: Thu, 22 Aug 2019 09:21:34 +0200 From: Michal Hocko To: Edward Chron Cc: David Rientjes , Andrew Morton , Roman Gushchin , Johannes Weiner , Tetsuo Handa , Shakeel Butt , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ivan Delalande Subject: Re: [PATCH] mm/oom: Add oom_score_adj value to oom Killed process message Message-ID: <20190822072134.GD12785@dhcp22.suse.cz> References: <20190821001445.32114-1-echron@arista.com> <20190821064732.GW3111@dhcp22.suse.cz> <20190821074721.GY3111@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 21-08-19 16:12:08, Edward Chron wrote: [...] > Additionally (which you know, but mentioning for reference) the OOM > output used to look like this: > > Nov 14 15:23:48 oldserver kernel: [337631.991218] Out of memory: Kill > process 19961 (python) score 17 or sacrifice child > Nov 14 15:23:48 oldserver kernel: [337631.991237] Killed process 31357 > (sh) total-vm:5400kB, anon-rss:252kB, file-rss:4kB, shmem-rss:0kB > > It now looks like this with 5.3.0-rc5 (minus the oom_score_adj): > > Jul 22 10:42:40 newserver kernel: > oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-10383.slice/user@10383.service,task=oomprocs,pid=3035,uid=10383 > Jul 22 10:42:40 newserver kernel: Out of memory: Killed process 3035 > (oomprocs) total-vm:1056800kB, anon-rss:8kB, file-rss:4kB, > shmem-rss:0kB > Jul 22 10:42:40 newserver kernel: oom_reaper: reaped process 3035 > (oomprocs), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB > > The old output did explain that a oom_score of 17 must have either > tied for highest or was the highest. > This did document why OOM selected the process it did, even if ends up > killing the related sh process. > > With the newer format that added constraint message, it does provide > uid which can be helpful and > the oom_reaper showing that the memory was reclaimed is certainly reassuring. > > My understanding now is that printing the oom_score is discouraged. > This seems unfortunate. The oom_score_adj can be adjusted > appropriately if oom_score is known. > So It would be useful to have both. As already mentioned in our previous discussion I am really not happy about exporting oom_score withtout a larger context - aka other tasks scores to have something to compare against. Other than that the value is an internal implementation detail and it is meaningless without knowing the exact algorithm which can change at any times so no userspace should really depend on it. All important metrics should be displayed by the oom report message already. -- Michal Hocko SUSE Labs