From patchwork Thu Jul 9 06:26:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 11653439 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E5FE3618 for ; Thu, 9 Jul 2020 06:26:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A9C922073A for ; Thu, 9 Jul 2020 06:26:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9C922073A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B44136B000A; Thu, 9 Jul 2020 02:26:15 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AF5F26B000C; Thu, 9 Jul 2020 02:26:15 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0B0D6B000D; Thu, 9 Jul 2020 02:26:15 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0195.hostedemail.com [216.40.44.195]) by kanga.kvack.org (Postfix) with ESMTP id 88E856B000A for ; Thu, 9 Jul 2020 02:26:15 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 299521EF3 for ; Thu, 9 Jul 2020 06:26:15 +0000 (UTC) X-FDA: 77017552710.04.fog86_0402b2326ec3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id F313F800DDFB for ; Thu, 9 Jul 2020 06:26:14 +0000 (UTC) X-Spam-Summary: 1,0,0,fe2b5d17022d991f,d41d8cd98f00b204,mstsxfx@gmail.com,,RULES_HIT:41:69:355:379:541:800:960:968:973:988:989:1260:1311:1314:1345:1437:1515:1534:1541:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2693:2839:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6119:6261:7556:7576:7875:7901:7903:9592:10004:11026:11232:11473:11658:11914:12043:12297:12517:12519:12555:12679:12683:12895:12986:13069:13161:13229:13311:13357:13869:13894:14093:14095:14096:14181:14384:14394:14721:21080:21433:21444:21450:21451:21627:21740:21990:30003:30005:30054:30090,0,RBL:209.85.221.65:@gmail.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100;04yrdu9g4ws5f8wqguw1pdki65yeiopqqdkuiqtpjmmnb9ucwt85wa3ihr8jmxu.k16hqmyrbd1qr7aknid8u7xia696d9j1tiz1yssoz6d9x1npiqtjn9hutkfr917.w-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: fog86_0402b2326ec3 X-Filterd-Recvd-Size: 4213 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Jul 2020 06:26:14 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id z2so1055100wrp.2 for ; Wed, 08 Jul 2020 23:26:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6NZSnpbUFjk+i8hote9Z3Fy5fgxJodX2Ccl1BtVgBd0=; b=hyC78eeLh3n90a8SRjMq9/7wU08LJH93PCGDBq5Oi4RzlMt9ZiIIcUNtihHCyO+Qrq ewKvUSpaZHUAwJNCM5xnDCyO35R/bP6lvAtcF7jX/53Umqn61oGDzWcHz/v2QOBzOKi/ I96saAr8Krsq9Ba6DnCJ9lq/+J3hVzqLSKYgKlR2xo6kH67P3iWgnx3n4RBRyElV19mt XYrwWYGAEwjTsx396bk/YORhmAY42qttbFptl5mqlUtg7kd7xUTbKZ9UhXr0RzzIeKCr iFzq718YBwShPAqa+GeXlYyJHQhC70+tncoe7YCvps+h8vZ45433WHSYNsKBq2SECPPv 6Aag== X-Gm-Message-State: AOAM530GIb1DrVpK/W19vZhTdU1hsaK/c32EYN1WQapizV8F8TCOcbAX NzbDEQ1sRQ0MENalHn4QSIw= X-Google-Smtp-Source: ABdhPJy7ugljC0DnC3ZIv4+2YPOT272vsRSiHRQoTmrazlXb8N1ABAxSsVpR4RM3eSd+B4/y+alPyw== X-Received: by 2002:a5d:4c82:: with SMTP id z2mr59134849wrs.287.1594275973500; Wed, 08 Jul 2020 23:26:13 -0700 (PDT) Received: from tiehlicka.suse.cz (ip-37-188-179-51.eurotel.cz. [37.188.179.51]) by smtp.gmail.com with ESMTPSA id p4sm4178410wrx.63.2020.07.08.23.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 23:26:12 -0700 (PDT) From: Michal Hocko To: Jonathan Corbet , Andrew Morton Cc: David Rientjes , Yafang Shao , , LKML , Michal Hocko Subject: [PATCH 1/2] doc, mm: sync up oom_score_adj documentation Date: Thu, 9 Jul 2020 08:26:02 +0200 Message-Id: <20200709062603.18480-1-mhocko@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: F313F800DDFB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: From: Michal Hocko There are at least two notes in the oom section. The 3% discount for root processes is gone since d46078b28889 ("mm, oom: remove 3% bonus for CAP_SYS_ADMIN processes"). Likewise children of the selected oom victim are not sacrificed since bbbe48029720 ("mm, oom: remove 'prefer children over parent' heuristic") Drop both of them. Signed-off-by: Michal Hocko --- Documentation/filesystems/proc.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst index 996f3cfe7030..8e3b5dffcfa8 100644 --- a/Documentation/filesystems/proc.rst +++ b/Documentation/filesystems/proc.rst @@ -1634,9 +1634,6 @@ may allocate from based on an estimation of its current memory and swap use. For example, if a task is using all allowed memory, its badness score will be 1000. If it is using half of its allowed memory, its score will be 500. -There is an additional factor included in the badness score: the current memory -and swap usage is discounted by 3% for root processes. - The amount of "allowed" memory depends on the context in which the oom killer was called. If it is due to the memory assigned to the allocating task's cpuset being exhausted, the allowed memory represents the set of mems assigned to that @@ -1672,11 +1669,6 @@ The value of /proc//oom_score_adj may be reduced no lower than the last value set by a CAP_SYS_RESOURCE process. To reduce the value any lower requires CAP_SYS_RESOURCE. -Caveat: when a parent task is selected, the oom killer will sacrifice any first -generation children with separate address spaces instead, if possible. This -avoids servers and important system daemons from being killed and loses the -minimal amount of work. - 3.2 /proc//oom_score - Display current oom-killer score ------------------------------------------------------------- From patchwork Thu Jul 9 06:26:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 11653441 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3FD3413B1 for ; Thu, 9 Jul 2020 06:26:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1808C20708 for ; Thu, 9 Jul 2020 06:26:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1808C20708 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D1BD36B000C; Thu, 9 Jul 2020 02:26:16 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CCAB06B000D; Thu, 9 Jul 2020 02:26:16 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE2246B000E; Thu, 9 Jul 2020 02:26:16 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id A870B6B000C for ; Thu, 9 Jul 2020 02:26:16 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 58E07181AC553 for ; Thu, 9 Jul 2020 06:26:16 +0000 (UTC) X-FDA: 77017552752.23.pipe92_5e0063126ec3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 262F637608 for ; Thu, 9 Jul 2020 06:26:16 +0000 (UTC) X-Spam-Summary: 1,0,0,2db8f1ea8607d37a,d41d8cd98f00b204,mstsxfx@gmail.com,,RULES_HIT:41:69:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3870:3871:3872:3874:4321:5007:6119:6261:7576:7875:7903:10004:11026:11232:11473:11658:11914:12043:12297:12517:12519:12555:12679:12683:12895:13069:13161:13229:13311:13357:13894:14181:14384:14394:14721:21080:21444:21451:21627:21990:30054:30070,0,RBL:209.85.221.68:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100;04y8pqrm61e1nq7xwixr9ktusefqfyc3xizjcs9mutqdp4jsiaj9p7kuzmy1xpk.91pyoeytg74g31noder3xbz3epysmyfao9u51fprset3cg59otfs7zxq6gugqkf.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: pipe92_5e0063126ec3 X-Filterd-Recvd-Size: 3433 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Jul 2020 06:26:15 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id z2so1055154wrp.2 for ; Wed, 08 Jul 2020 23:26:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZvurmaEhiDORUIXWHx/5zZKOFGfrQC85VP7M/ADppWE=; b=GJMQvf0k4xZCYtvJ2+VKXoijk3qNKXhGK6kDK2WbMx5+DrTL9Dq1yWMabWvkD4MYpl Kjs8fR2mzUVTFH0srj9r+x6NGAyF1SYYGy5ngynW/2YsBoUgJ5JUNEFOiYBYlVc3zJ+E 1z88BsMc3dRmGcZkThfiYjzuII1mo1NLmKr0RbyHj5vxL36XYPQ6R9fso74y+Cge6Mf/ pRjuNpuhVGffuko5pkIL0CewAQ95ZMnAQSJ82PQ2OM3osfwFaZdVtu8eJhOKAL/VOSVN dEfaw9emcbjLgs+uOhaESzq1cJYq92NKS5JbMRj6AkyNUISg0B4cIzTkB6056GrWHXUv CRdA== X-Gm-Message-State: AOAM533CDjAJZyG6uqtSKLl/TciSyPvA9Y+ygvy1VgrJe2i7onK2Yn5A xhJosaqzx9E3U79K4+opOKU= X-Google-Smtp-Source: ABdhPJyuQOKQaP1k4yx1bb8YTA/GAEH2wIYZA+1TJ4gunRYB89gmzN5iYVQJ425ZtUl//4kqcvKAKw== X-Received: by 2002:a05:6000:1182:: with SMTP id g2mr57634636wrx.44.1594275974851; Wed, 08 Jul 2020 23:26:14 -0700 (PDT) Received: from tiehlicka.suse.cz (ip-37-188-179-51.eurotel.cz. [37.188.179.51]) by smtp.gmail.com with ESMTPSA id p4sm4178410wrx.63.2020.07.08.23.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 23:26:14 -0700 (PDT) From: Michal Hocko To: Jonathan Corbet , Andrew Morton Cc: David Rientjes , Yafang Shao , , LKML , Michal Hocko Subject: [PATCH 2/2] doc, mm: clarify /proc//oom_score value range Date: Thu, 9 Jul 2020 08:26:03 +0200 Message-Id: <20200709062603.18480-2-mhocko@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200709062603.18480-1-mhocko@kernel.org> References: <20200709062603.18480-1-mhocko@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 262F637608 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: From: Michal Hocko The exported value includes oom_score_adj so the range is no [0, 1000] as described in the previous section but rather [0, 2000]. Mention that fact explicitly. Signed-off-by: Michal Hocko --- Documentation/filesystems/proc.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst index 8e3b5dffcfa8..78a0dec323a3 100644 --- a/Documentation/filesystems/proc.rst +++ b/Documentation/filesystems/proc.rst @@ -1673,6 +1673,9 @@ requires CAP_SYS_RESOURCE. 3.2 /proc//oom_score - Display current oom-killer score ------------------------------------------------------------- +Please note that the exported value includes oom_score_adj so it is effectively +in range [0,2000]. + This file can be used to check the current score used by the oom-killer is for any given . Use it together with /proc//oom_score_adj to tune which process should be killed in an out-of-memory situation.