Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp99011ybj; Fri, 8 May 2020 07:23:20 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6tuI7IfD/9bAcuLjlLPZmun0BdDIY0ZHK55gPSA5mL45B96V9IrLUaqHcHmvXfAM0c52a X-Received: by 2002:a17:90a:eac3:: with SMTP id ev3mr6297517pjb.234.1588947800541; Fri, 08 May 2020 07:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588947800; cv=none; d=google.com; s=arc-20160816; b=RbhN3LdOmsB0PaP2X5QpslDLI5IKM/85L1fFNrNk2A3mlg/bB482S2rASC9ppeGuSH hFqlos3v0tH91Nl7H25wSUax+qA0VGgF9AXrHN/p+wesUnATD1AF7lJocjIdsKuPYQfW OnK6XkirHw5qww7ejUagp/l96n9n79cqOxAQEymvtsew+e65WO7Apvay2dlvbJsIRUBP jLKAbxEMZfPTA0h2Jl4S2RnQmej2wL/hsvSC3Lnri5YY5PVWYJBceZjkH01FPTYB3DYB KQpe6zlzK3Kn/Qp2tf0RYXvlbe7f+D1O85gF3VQViZu/2lvTlQmGJ4ryKzLBXBIISXTq 4wzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=Kz8084Qd+ukMFtBduY70Wrn/hOXrye0GrRmcB96gXCQ=; b=RNU8LrgA4extudYs7/KGItY2+cZi3qLLQYewD+DTB7K/PHReKYIWmn4eaubyhs4WYQ 4x2gD5wEKljv5Af2sOFlxW4RCmRQLlKrxwuzjrCKbjbO+66DncoBGmqLQ5NN8Jp459+y a0KOlNnr5W4YgOK79B3dtLO4R6qiOhJPdNs5WxDlDdJaW7d8dEAmNxABvVh31/7BjifK NLYC9YeYtafKvhqj5uuw+P5mXKtVD+h3P6xl+aBGp1O1C8AaINTM3RuCtckpDcqaEUf+ EJ0M/s6uXCiyScqPnfQCwtyXo0NBzJJ3Ih9S+/EoEECPXGBAYOBun0z/qGOWwBaxuPd8 a5hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b="Dj8/u6gZ"; 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=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay15si2219595pjb.73.2020.05.08.07.22.36; Fri, 08 May 2020 07:23:20 -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=@yandex-team.ru header.s=default header.b="Dj8/u6gZ"; 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=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727082AbgEHOQe (ORCPT + 99 others); Fri, 8 May 2020 10:16:34 -0400 Received: from forwardcorp1p.mail.yandex.net ([77.88.29.217]:56418 "EHLO forwardcorp1p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbgEHOQe (ORCPT ); Fri, 8 May 2020 10:16:34 -0400 Received: from mxbackcorp2j.mail.yandex.net (mxbackcorp2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::119]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id 9C6732E0997; Fri, 8 May 2020 17:16:31 +0300 (MSK) Received: from myt5-70c90f7d6d7d.qloud-c.yandex.net (myt5-70c90f7d6d7d.qloud-c.yandex.net [2a02:6b8:c12:3e2c:0:640:70c9:f7d]) by mxbackcorp2j.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id DzB0dpFFbi-GTXSjfvG; Fri, 08 May 2020 17:16:31 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1588947391; bh=Kz8084Qd+ukMFtBduY70Wrn/hOXrye0GrRmcB96gXCQ=; h=Message-ID:Date:To:From:Subject:Cc; b=Dj8/u6gZYmMA/f3gA/Gqiy6C2yfCTKO//L+zyCsxYhibDXK2RnLGgmSAlaRXqqzlw Tq4x4ndeaEZyJGVAZxWLr/JJnElxICKB49ARgoON0n79PGht6cp9Htyk3J3iszXQle cbNDkAqPk/3XuNtXYZDXX5+C1gTBipR7wPmNTtdg= Authentication-Results: mxbackcorp2j.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-vpn.dhcp.yndx.net (dynamic-vpn.dhcp.yndx.net [2a02:6b8:b080:7008::1:4]) by myt5-70c90f7d6d7d.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id tvHw4hmnaj-GTWWnWM4; Fri, 08 May 2020 17:16:29 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: [PATCH] doc: cgroup: update note about conditions when oom killer is invoked From: Konstantin Khlebnikov To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton Cc: cgroups@vger.kernel.org, Roman Gushchin , Michal Hocko Date: Fri, 08 May 2020 17:16:29 +0300 Message-ID: <158894738928.208854.5244393925922074518.stgit@buzz> User-Agent: StGit/0.22-32-g6a05 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Starting from v4.19 commit 29ef680ae7c2 ("memcg, oom: move out_of_memory back to the charge path") cgroup oom killer is no longer invoked only from page faults. Now it implements the same semantics as global OOM killer: allocation context invokes OOM killer and keeps retrying until success. Signed-off-by: Konstantin Khlebnikov --- Documentation/admin-guide/cgroup-v2.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index bcc80269bb6a..1bb9a8f6ebe1 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1172,6 +1172,13 @@ PAGE_SIZE multiple when read back. Under certain circumstances, the usage may go over the limit temporarily. + In default configuration regular 0-order allocation always + succeed unless OOM killer choose current task as a victim. + + Some kinds of allocations don't invoke the OOM killer. + Caller could retry them differently, return into userspace + as -ENOMEM or silently ignore in cases like disk readahead. + This is the ultimate protection mechanism. As long as the high limit is used and monitored properly, this limit's utility is limited to providing the final safety net. @@ -1228,17 +1235,9 @@ PAGE_SIZE multiple when read back. The number of time the cgroup's memory usage was reached the limit and allocation was about to fail. - Depending on context result could be invocation of OOM - killer and retrying allocation or failing allocation. - - Failed allocation in its turn could be returned into - userspace as -ENOMEM or silently ignored in cases like - disk readahead. For now OOM in memory cgroup kills - tasks iff shortage has happened inside page fault. - This event is not raised if the OOM killer is not considered as an option, e.g. for failed high-order - allocations. + allocations or if caller asked to not retry attempts. oom_kill The number of processes belonging to this cgroup