Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3335864ybz; Mon, 4 May 2020 00:39:29 -0700 (PDT) X-Google-Smtp-Source: APiQypJDRUUKSwD2h7ChBanyggFlj6WA4Y+kkuh6vqm6xPpBI0SzY3s79Z4cF85qRxXYoZJ9TOwA X-Received: by 2002:a50:8b06:: with SMTP id l6mr3665440edl.190.1588577968930; Mon, 04 May 2020 00:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588577968; cv=none; d=google.com; s=arc-20160816; b=e4o+2JyrTAlNoaRMDlVuk23N3UJMD7gda2K+UgpDg4V95PUxrVWKij2ZbCvh9WSoVl VqAak4I9uOO3TLM3Z3m/RfqDvyJhCYIaVMhYTyCS8mBAqLH+TEsqRPqagS6PPDSaMnmH 5xKmtBJ0dRUepZ3QsDC1KWLM2Z3X//pJfLIozMwoYU3huHA7dpKq22LVhJqrf4p7i4wP aUezaNVDkBPLyntPI1XmIXKVSyNC5OJ2GxwVUoPdwyugYIPPoG6Q4ndYznv9TDnjiUXL 6Li1CoVdauDxoFNa7Pyrzal1LoSXhxiHbf0RhYZnEzIz7v8+TSv5zpTVsxalx96tFaYq y5xA== 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=4M+FRCJ74peE16t8SYWvqws7mT6RU/FjWmJ/yEmHyz4=; b=gYIQfSidV4ssJIw5lvnEyCZnY52n9Bgw9MQ+QjmfFe60adpKfB6oZN/Mbx3FXsHX+n a/HgEk2fqQRv1D6QFUa22DsBfOZTlzpxl8dguN19jPLsxVICQEpO2UQatnT1qPsG6tfO sALDTagTYJ7iDboHckT8rmKtV8nD0tn2Rms2/1nfqEcY46R6a47ICEth4yUQIgcUcoQq 5L7JkOixF68ml9EeuWDd2TOssBhf0kNIhCgh/eHvkRAeJbcE9jtS/FO6eIIrOfcZHVSd TBaBkn9pb8BjNsnyLEx+X/HBEuw2crEWTq2wx24y87/gn22FAmzl2ZnNRyuJlkzNKAjG ulKQ== 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 s9si6661520ejz.335.2020.05.04.00.39.05; Mon, 04 May 2020 00:39:28 -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 S1728113AbgEDHgC (ORCPT + 99 others); Mon, 4 May 2020 03:36:02 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51984 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726411AbgEDHgA (ORCPT ); Mon, 4 May 2020 03:36:00 -0400 Received: by mail-wm1-f68.google.com with SMTP id x4so7275257wmj.1; Mon, 04 May 2020 00:35:58 -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=4M+FRCJ74peE16t8SYWvqws7mT6RU/FjWmJ/yEmHyz4=; b=ctnDc4VdKcgsjnDDEMaTn4UVcqYWIf6mgLgViq//uEi3ez5IZ89J11+fOkj57ZscAp sGtK5kvDR02Dmc52cBVZbsWHFieTdzet6VIXC7M5z+wzJeDevf9lJXqiDhG/svUl7mIl oUd9vtbq6X2JKi1WzoL4lXu3ezHg/7cmrZ8bkI+8aG7aq3u0wohJkjKCGxbUYiwMWxea Je01tIUFNUaJIaTJAxqROB3TJzIxvMx5CZ3h2yUcw9it0UcWTfEJhb+PDnpVdE2vo1eD nWWlpog5X9iEqEXQL82wp7kVd+nstP9Ax7PNMtZZwPgqvZJWODidLwpPkZxgXNXo2b0m aylQ== X-Gm-Message-State: AGi0PuZNC2nyExO5m54YTINsDCAE6D5EvziFoOqi1bgpOGEyrxPk/b+b a0pT8AYqR6jbTEOJKX/XwG4= X-Received: by 2002:a1c:b445:: with SMTP id d66mr13680620wmf.187.1588577757859; Mon, 04 May 2020 00:35:57 -0700 (PDT) Received: from localhost (ip-37-188-183-9.eurotel.cz. [37.188.183.9]) by smtp.gmail.com with ESMTPSA id w6sm18583454wrm.86.2020.05.04.00.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 00:35:57 -0700 (PDT) Date: Mon, 4 May 2020 09:35:49 +0200 From: Michal Hocko To: Yafang Shao Cc: Shakeel Butt , Johannes Weiner , Roman Gushchin , Greg Thelen , Andrew Morton , Linux MM , Cgroups , LKML Subject: Re: [PATCH] memcg: oom: ignore oom warnings from memory.max Message-ID: <20200504073549.GE22838@dhcp22.suse.cz> References: <20200430182712.237526-1-shakeelb@google.com> <20200504070301.GC22838@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 04-05-20 15:26:52, Yafang Shao wrote: > On Mon, May 4, 2020 at 3:03 PM Michal Hocko wrote: > > > > On Fri 01-05-20 09:39:24, Yafang Shao wrote: > > > On Fri, May 1, 2020 at 2:27 AM Shakeel Butt wrote: > > > > > > > > Lowering memory.max can trigger an oom-kill if the reclaim does not > > > > succeed. However if oom-killer does not find a process for killing, it > > > > dumps a lot of warnings. > > > > > > > > > > I have been confused by this behavior for several months and I think > > > it will confuse more memcg users. > > > > Could you be more specific what has caused the confusion? > > > > No task is different from no eligible task. > No eligible task means there are some candidates but no one is eligible. > Whille no task means there is no candidate. I really fail to see a difference. It is clear the one is subset of the other but in practical life tasks might come and go at any time and if you try to reduce the hard limit and there are no tasks that could be reclaimed then I believe we should complain whether it is only oom disabled tasks or no tasks at all. It is certainly unexpected situation in some cases because there are resources which are bound to the memcg without any task we can act on. > > > We should keep the memcg oom behavior consistent with system oom - no > > > oom kill if no process. > > > > This is not the global mmemcg behavior. We do complain loud on no > > eligible tasks and actually panic the system. Memcg cannot simply > > do the same by default for obvious reasons. > > > > As explianed above, no eligible task is different from no task. > If there are some candidates but no one is eligible, the system will panic. > While if there's no task, it is definitely no OOM, because that's an > improssible thing for the system. This is very much possible situation when all eligible tasks have been already killed but they didn't really help to resolve the oom situation - e.g. in kernel memory leak or unbounded shmem consumption etc... -- Michal Hocko SUSE Labs