Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3848494imm; Mon, 6 Aug 2018 11:37:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeGRQ16fhthXzytmgKzgYiUsiFMJLf3bqD5pte2D+8fAWZJMJNjN78gzTSr/APYUm5EK44r X-Received: by 2002:a63:df50:: with SMTP id h16-v6mr14719194pgj.300.1533580635845; Mon, 06 Aug 2018 11:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533580635; cv=none; d=google.com; s=arc-20160816; b=ukYvUTGZIAergwTeRchIS4xY+Iq8xpg/M2otx22AJz8Aq/23oQ+H/g44LdPzzL9h8Q nz9sgV4EVw8z+2ncpD2skcCX4x+ZJ0BxRf06UAtLCIJqzm+yO4xkZf22XAF45qGc19Mp SQHMmJwPg8oeHfDoQxK7CwXEUin5eEzzYLAkG1TmcftQDVPJYtDdeqQkYjwutRjjDej9 ImIECuKVvAHuu954hnlpyG8aL3GygpvoeTqgztYY5M1ryoa/SwBBMy9FxZtMf/pr4RVj p8wW/ovoock3kbR/q1aduDgMjN0qFbV2WjIzQYqOgAS96Eap+XWvygGKydP4/BEqfOPO kBew== 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=mEGp7HnWRufSgBR8035S+TT5eTs+oMzQdFbgS3KANJA=; b=DC9yugj9VY9P28oE8iTyX/8br9uE9BTWK7HxNRQgHF2yjR60xyL1U0Za0LF3w0xAt3 3h6Ah6DVftisZsmGJBrx3QaJqRcRQ70D1mzwbymZqFxsz2poy02KRi4MaUaaTiyNuo7Y u42xOe2EQ/R/P6158/g3JzaZ6Sp+xndIl3SFmZ4tL68+rka4wTEHLLGd9KYj5EzM3Gdz t6B0Wg90sUWiG+TOSZGA2V28k3zPaAmkiQuurZPexuSJHiDOttOjdZcRHIYB2NDEPS2D qf+A1vhDYk8K9G67icDYHme6Z3/JrS4ZH3G/ISz5GJfEsR9DS2yFtA7G3YyxNe7eK44m C+fQ== 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 h8-v6si11852253pli.14.2018.08.06.11.37.00; Mon, 06 Aug 2018 11:37:15 -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 S1732730AbeHFUX5 (ORCPT + 99 others); Mon, 6 Aug 2018 16:23:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:40346 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726279AbeHFUX4 (ORCPT ); Mon, 6 Aug 2018 16:23:56 -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 08451ACE1; Mon, 6 Aug 2018 18:13:39 +0000 (UTC) Date: Mon, 6 Aug 2018 20:13:39 +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: <20180806181339.GD10003@dhcp22.suse.cz> References: <0000000000006350880572c61e62@google.com> <20180806174410.GB10003@dhcp22.suse.cz> <20180806175627.GC10003@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180806175627.GC10003@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 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); } /** -- Michal Hocko SUSE Labs