From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E618C54E8D for ; Mon, 11 May 2020 10:13:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 694C12080C for ; Mon, 11 May 2020 10:13:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 694C12080C 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 DF8D390001D; Mon, 11 May 2020 06:13:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA966900006; Mon, 11 May 2020 06:13:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C977D90001D; Mon, 11 May 2020 06:13:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id AF3B9900006 for ; Mon, 11 May 2020 06:13:26 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6F588181AEF07 for ; Mon, 11 May 2020 10:13:26 +0000 (UTC) X-FDA: 76804026012.26.cap26_e6e260cb559 X-HE-Tag: cap26_e6e260cb559 X-Filterd-Recvd-Size: 4856 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 May 2020 10:13:26 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id y24so18555760wma.4 for ; Mon, 11 May 2020 03:13:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uOhWjc2sd24xbu0R8XTgR/bnPdX/gR8GhK7Om+UST/I=; b=a6DruRTjbBoJQmR3ew7jCwuLbilNO40AxrhRTJ1dWbUcQz8F7eBELUTO41WBC/dpVN rqhzv1/VOBCw4cuzdGQ530C8eFQxj9s9p8ktUU2nhfbAiOEx3InPHL5eMJtTW51VVp9U oEDHCgvhMDJkiYKySIhtxnY5hwSdnNyDLKzGB3Rv8gyQQU6qjfeZNzwugQUn2gJKGawS eisnbxtpoYjesZSMWgWIYTMeQA3PTTenleQ9BPeZ9dM/lUqy+UGCtKS0tt6VnmXkzA5V /CtWVlfBftRzGirTHnqHcYjY+f+HpR2licFW/dxHJ74TYPJE4StPGeRerjdg7QRxIkyM yiog== X-Gm-Message-State: AGi0PubfSCGI2WA1TrbuslNU1oZeHS93qLKuD4Ww6Jq+QOdaxGqYCPQQ NG4JWi9+qqOlHWXtJd1NvJG0j5zw X-Google-Smtp-Source: APiQypKiG/83MSsUYm/CowCYDjDJkgwYsim/g2CFoTBskQl373KykPNmSMHAUUrWn+GsH703Ktj+SQ== X-Received: by 2002:a05:600c:1:: with SMTP id g1mr30199972wmc.142.1589192005108; Mon, 11 May 2020 03:13:25 -0700 (PDT) Received: from localhost (ip-37-188-228-19.eurotel.cz. [37.188.228.19]) by smtp.gmail.com with ESMTPSA id n24sm9865895wmi.40.2020.05.11.03.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 03:13:24 -0700 (PDT) Date: Mon, 11 May 2020 12:13:22 +0200 From: Michal Hocko To: Konstantin Khlebnikov Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , cgroups@vger.kernel.org, Roman Gushchin Subject: Re: [PATCH] doc: cgroup: update note about conditions when oom killer is invoked Message-ID: <20200511101322.GE29153@dhcp22.suse.cz> References: <158894738928.208854.5244393925922074518.stgit@buzz> <20200511083904.GB29153@dhcp22.suse.cz> <0ddb8e58-5bfd-7754-6979-4276acf5b4c8@yandex-team.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ddb8e58-5bfd-7754-6979-4276acf5b4c8@yandex-team.ru> 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: On Mon 11-05-20 12:34:00, Konstantin Khlebnikov wrote: > > > On 11/05/2020 11.39, Michal Hocko wrote: > > On Fri 08-05-20 17:16:29, Konstantin Khlebnikov wrote: > > > 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 > > > > Acked-by: Michal Hocko > > > > > --- > > > 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. > > > > I would probably add -EFAULT but the less error codes we document the > > better. > > Yeah, EFAULT was a most obscure result of memory shortage. > Fortunately with new behaviour this shouldn't happens a lot. Yes, it shouldn't really happen very often. gup was the most prominent example but this one should be taken care of by triggering the OOM killer. But I wouldn't bet my hat there are no potential cases anymore. > Actually where it is still possible? THP always fallback to 0-order. > I mean EFAULT could appear inside kernel only if task is killed so > nobody would see it. Yes fatal_signal_pending paths are ok. And no I do not have any specific examples. But as you've said EFAULT was a real surprise so I thought it would be nice to still keep a reference for it around. Even when it is unlikely. -- Michal Hocko SUSE Labs