Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3901229imm; Mon, 6 Aug 2018 12:37:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe7ZWSfdIw6dpQOS3uNw684uGvvsxRrK1TxeXQmWHbpndUsdRuZ8BHzUW1zoz0nzb8Kx0e7 X-Received: by 2002:a63:3e4d:: with SMTP id l74-v6mr16029334pga.355.1533584245950; Mon, 06 Aug 2018 12:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533584245; cv=none; d=google.com; s=arc-20160816; b=dI1Fa4dRSfA8T+6MA9LeRUbl5lgqFL2nN+rTGJleyPtSwyLCgC010I7gX8D2ByzdSq nxs/T1q0Ch+m3T/sj9/T9mHRqJcZ/qB6WBz6XzhQ2dGE7aA5lcD2ponnM8z4cD58ybGD T93VUEH2I4zau21v2TK+20gCojge/UsKBlIB/7g/N0PNr1BCm5Elrsr80XBy9VUus04P yUGaNoYxU1IZ0W4DbcsQgD1I5PSS8kmh6oovUFWZT7azQ/yABoZz7QRIYDuLwhNIpiJU RkUJepw0OLr1cOu3eiOy8enlelWCQQr1VR8DoTQ5XBPlIiNQIIA1CVW+UNmy9LDfSVtI 8vVw== 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=b5Va6KSqd5bhJlronqHYf2RYoiFA0WcyeZTktxomJXY=; b=aw4xKvnsCwxtOJseKdHW9AOCrR02hiisOhX/oM0tW9iX8TW1LADg3TUb9HTsZDZMOR IqVr4QfUNoia34+Oz6/qdMGNqal4tH8LNYDIlKq2MBQtQnUNiMo8sukSk8GXBhoEGqeV bOGjJ7KhhUTZ4Lo+0ZM2xLRK4khuhMyTH2fn8aBRyjXR4Sd0LZQPw1EUlzEEJOoeiumE qtRJEpbibPmU011RwFuMlAAay/Pq9cpWP0Iog2GPZqEKhIeq/ElvKVmCMrtOt682MJWo k//W3YcQByzQr9Irl+UrT2z6L52mamuviAIngezKKmZUFKRbs71W33cCgD1qvbQXPgTx zWQg== 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 4-v6si11968794pla.311.2018.08.06.12.37.10; Mon, 06 Aug 2018 12:37:25 -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 S1732978AbeHFUuY (ORCPT + 99 others); Mon, 6 Aug 2018 16:50:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:44080 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728936AbeHFUuY (ORCPT ); Mon, 6 Aug 2018 16:50:24 -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 56B3FADFA; Mon, 6 Aug 2018 18:40:00 +0000 (UTC) Date: Mon, 6 Aug 2018 20:39:54 +0200 From: Michal Hocko To: syzbot Cc: cgroups@vger.kernel.org, dvyukov@google.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, penguin-kernel@I-love.SAKURA.ne.jp, syzkaller-bugs@googlegroups.com, vdavydov.dev@gmail.com Subject: Re: WARNING in try_charge Message-ID: <20180806183954.GF10003@dhcp22.suse.cz> References: <0000000000006350880572c61e62@google.com> <20180806174410.GB10003@dhcp22.suse.cz> <20180806175627.GC10003@dhcp22.suse.cz> <20180806181339.GD10003@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180806181339.GD10003@dhcp22.suse.cz> 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 20:13:39, Michal Hocko wrote: > I simply do not see how this is possible. Let's try with the following > extended debugging patch. > > #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 116b181bb646afedd770985de20a68721bdb2648 > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 4603ad75c9a9..e2dfdf4361ba 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; > @@ -2108,6 +2110,9 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, > > if (mem_cgroup_is_root(memcg)) > return 0; > + if (tsk_is_oom_victim(current)) > + pr_info("task=%s pid=%d charge for nr_pages=%d\n", > + current->comm, current->pid, nr_pages); > retry: > if (consume_stock(memcg, nr_pages)) > return 0; > @@ -2137,8 +2142,11 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, > */ > if (unlikely(tsk_is_oom_victim(current) || > fatal_signal_pending(current) || > - current->flags & PF_EXITING)) > + current->flags & PF_EXITING)) { > + pr_info("task=%s pid=%d charge bypass\n", > + current->comm, current->pid); > goto force; > + } > > /* > * Prevent unbounded recursion when reclaim operations need to > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 104ef4a01a55..7d9adcde8cf6 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -692,6 +692,8 @@ static void mark_oom_victim(struct task_struct *tsk) > __thaw_task(tsk); > atomic_inc(&oom_victims); > trace_mark_victim(tsk->pid); > + pr_info("task=%s pid=%d is oom victim now\n", > + current->comm, current->pid); > } Ble this should be s@current@tsk@g. But it didn't really help. I will have to think about this more. -- Michal Hocko SUSE Labs