Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1744507ybk; Mon, 11 May 2020 03:15:42 -0700 (PDT) X-Google-Smtp-Source: APiQypKgXrstTwguXm5IXdnGDFDzxCBfJ0xvvchzK7zt85JdIe41DE3+6TIdyV5iTl6HxkfXGJWd X-Received: by 2002:a17:906:4dd6:: with SMTP id f22mr12933684ejw.181.1589192142128; Mon, 11 May 2020 03:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589192142; cv=none; d=google.com; s=arc-20160816; b=QcVjl2M9KQn/42nfcffCY5c1XzKMmqbxzyhLfM4PJJG1pApJoEnldQayjIVmmWMZvf VM1OHlnbSzRp1wS1kYogQ9DxGBjpNuVhUVdDQGBlbvQAL9Amuss/Rsr2CyAM2A+wXSSR HTBXBozoJURAkvFqnlsE/wN8ONl+gQsi+vBT0Xe9rDEtqmVni0cucSiz8sGY0rHpef5G jZIeG1Fdlk+c2VxIC4OUXT4W4PqsHvCQocV8BPoD3OGhai5V/fi9jrERH//BsvP6fUW3 TUPk6c78zefbFoVr5w+BYvVx3MPc/Jd5UkYV+BY7sR3Wu5jOtaCpZL2/s3e37bBP11Nh SotA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=uOhWjc2sd24xbu0R8XTgR/bnPdX/gR8GhK7Om+UST/I=; b=q3AgmLbIfYrJ56wpsNbOX9uN+rGVLVW/KxKAzPkbs7PyusNuamOH7CrsNIgCf4RFnP 8Wtdldv5f0JZ81v99S/B99vGElUs6V4htU8P65W9QsxDwMuutfF8HzZ+V/G18bNPs5sk seY367/Q8ZLvQO7r+MzuJ+c0akR0SNns36fWZbey0KtfqIhPiQhhf8PGzyP/ZyQZINal gg9oaEM5bcI9g3qq279iEgeMsFHCDRcEaeNlk8Xe58h+GvYiijBVcHIv+k6hBD9yi28O LsYFvEbFdOIn+crocdFsltchiiQrbClT1CdvlDWoTNHYmMazib4JSjfFZsdLFJ3kPNOP gmag== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si1135581edz.400.2020.05.11.03.15.19; Mon, 11 May 2020 03:15:42 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729405AbgEKKN2 (ORCPT + 99 others); Mon, 11 May 2020 06:13:28 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55019 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728402AbgEKKN1 (ORCPT ); Mon, 11 May 2020 06:13:27 -0400 Received: by mail-wm1-f65.google.com with SMTP id h4so17424143wmb.4; 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=ezyocZerD4gU4npRNtCYjOYn0Exnl9L0VxO9/kMy3ngXYqEIjtK4o51pSM+UeI7c9R Kl4171hv14/HbBbzww+rD+xoEHwNbsUi6nuN2LY7q5l/N5Gf8KVml31ljQyPyu1EKdQi F6+xthoNCMoFUSbxKSIwWSqg8l0HIBzi2iNfxVa8KMcTL5UbzU836cKNO57GUULZiIQC rUwmuig5wx3a4pXjPqR/xC3Y3Ww8odGq8jgOKj4HJLhQ+V79A8QU1wCrVEXsYHrlsh6c vyshvteGOBOJZ+Gq8J/+Tlxne4o2Nk6k8o7uoS/Ky8ZouCOcAMn40x5jt8RDWWGeURDB SPaw== X-Gm-Message-State: AGi0Pubu7b+b4MUs8QD9NJE4ss5wZZnIXZtJpsMllRfTtv9vX1bn8Ykp POQa+X3XKysi+6tnTKJkPYw= 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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