Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3376312imm; Mon, 6 Aug 2018 03:46:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcWTuNeQN83Mxh3IOn3V3CU+PJTpMa5gAVLRJxuqSDstFo9Jb/mH7BW48zUBYagUGKvGePQ X-Received: by 2002:a17:902:301:: with SMTP id 1-v6mr13404443pld.127.1533552407987; Mon, 06 Aug 2018 03:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533552407; cv=none; d=google.com; s=arc-20160816; b=L/Q6cPFAv/SoOSrMB9eFEO3JL/GfkFNTjXqTDs29TURPmmZ85aaawgZUcNCf3JYf+6 De9rmDk9gcDZOptsz8L1cElp/gNglHqKmHrPTMFsUjfQQuQsvo4SJBNiR4yXxBr/uiUq M2P1kJQN+dSKkpRd3a0uXKGUB8Ef97GgzekXBVsPQRPHsRXxjoaUy6V1/XoXUg/EXfyg qYJhLOptVCsz3UwZ94jygJaoFhk7VlUGVvBifac/2im3XsZjniOthkV5joC0KCV7+wNF ALEtWrs31wb6KNWI5sxMMJt2HYc2oGWY9N939Yyq7m723cJS7ebiRevHze0w/etQ0KJR 7KIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=E+aeLvSGXToLIFtcedgONOWxGzMemzGBoDY0ruBRbIs=; b=neQf82dkVL//WQIkWgndWvsNQpKEANkwz6tQ24EiW/2E8mvlvmQ5RRpBZrVnWoepAW 1YksZ/rOFvlKizqR92aGB/9IvMOqya79saRx0LhCaeifwneT/GjAkN5V3AgurnsSSGRr YxBzFkcs47bKyAnwX/+QNMnXtxssB+xm3ORXiZJxOX3se6IaHmkXcye1lRU14WY4fTOA OMNELUXjRd83pK98t7ETq5jqT3fDn4sl31z7cuMPebXJuGe6VuKHcuGF262P1QGOAdY9 wHagaDPEviwvI10zHp5GRwSKn2woWPGQis5L/K/uv7cEUz6zAF5WVumjQmw2WePrRMJP xJPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v129-v6si15071413pfc.330.2018.08.06.03.46.24; Mon, 06 Aug 2018 03:46:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727874AbeHFL4q (ORCPT + 99 others); Mon, 6 Aug 2018 07:56:46 -0400 Received: from mx2.suse.de ([195.135.220.15]:53746 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726572AbeHFL4q (ORCPT ); Mon, 6 Aug 2018 07:56:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 391A6AD21; Mon, 6 Aug 2018 09:48:28 +0000 (UTC) Date: Mon, 6 Aug 2018 11:48:27 +0200 From: Michal Hocko To: Dmitry Vyukov Cc: syzbot , cgroups@vger.kernel.org, Johannes Weiner , LKML , Linux-MM , syzkaller-bugs , Vladimir Davydov Subject: Re: WARNING in try_charge Message-ID: <20180806094827.GH19540@dhcp22.suse.cz> References: <0000000000005e979605729c1564@google.com> <20180806091552.GE19540@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 06-08-18 11:30:37, Dmitry Vyukov wrote: > On Mon, Aug 6, 2018 at 11:15 AM, Michal Hocko wrote: [...] > > More interesting stuff is higher in the kernel log > > : [ 366.435015] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=/,mems_allowed=0,oom_memcg=/ile0,task_memcg=/ile0,task=syz-executor3,pid=23766,uid=0 > > : [ 366.449416] memory: usage 112kB, limit 0kB, failcnt 1605 > > > > Are you sure you want to have hard limit set to 0? > > syzkaller really does not mind to have it. So what do you use it for? What do you actually test by this setting? [...] > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index 4603ad75c9a9..852cd3dbdcd9 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -1388,6 +1388,8 @@ static bool mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, > > bool ret; > > > > mutex_lock(&oom_lock); > > + pr_info("task=%s pid=%d invoked memcg oom killer. oom_victim=%d\n", > > + current->comm, current->pid, tsk_is_oom_victim(current)); > > ret = out_of_memory(&oc); > > mutex_unlock(&oom_lock); > > return ret; > > > > Anyway your memcg setup is indeed misconfigured. Memcg with 0 hard limit > > and basically no memory charged by existing tasks is not going to fly > > and the warning is exactly to call that out. > > > Please-please-please do not mix kernel bugs and notices to user into > the same bucket: Well, WARN_ON used to be a standard way to make user aware of a misbehavior. In this case it warns about a pottential runaway when memcg is misconfigured. I do not insist on using WARN_ON here of course. If there is a general agreement that such a condition is better handled by pr_err then I am fine with it. Users tend to be more sensitive on WARN_ONs though. Btw. running with the above diff on top might help us to ideantify whether this is a pre-mature warning or a valid one. Still useful to find out. -- Michal Hocko SUSE Labs