Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2154320imm; Thu, 9 Aug 2018 08:09:32 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzR5ZbO6+8b6LLTKXqTiRfAOcyddB/tcruSVR5uFR8A7TwIrEAKCaxtX8tPu397J+DosjwJ X-Received: by 2002:a62:2119:: with SMTP id h25-v6mr2777652pfh.112.1533827372772; Thu, 09 Aug 2018 08:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533827372; cv=none; d=google.com; s=arc-20160816; b=PEnww3+ATtx4EXWMBXeR+qehhwi67wFdw+T6wvmzCepZaZFQtwDSIxx7zPeGcDyzBZ lArPYOM57tdr35PkP2MZ8Z8VgPhuANT49TjvsFbXPFudTI2Xl9XZkW8yrLbAGRnHbCP1 tAww6irYTCrKQpdj044BmhmsV5oY4BdNGR5/0s+StlWc049j7/I1rDEVVk6GVMLU/Gnz Dk344Mh3tDraqUma6PVkhS9tUUGhPHVV6Vyw4O9KVKd8vGqk+cbkENrppyc5L88SB9Zn Tsnl41XIv2IR1pV5P2tFCgHE0jZX6E8HCU6k6jIKy8NxEQOhGiqOu5f0C12HNkcxlNhw 9Y1Q== 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=rGchRh2LpJUxUXifSSf/v7MMURinnhVbm88efRDyFe4=; b=yKQPOWRng2VP94waPNkvjnGgkz0914/6HMnGSeGowkdH0jKZPLqkYyIEPqitufFohi t/374iD0l551STg9x44QXVooHp21Ya7cgpiR1ni8BxGc+CbdiyhyDmKElPhfOL8F+PuU LaY70JLZs1rSm/jRnlRqcUzRzcMbQ09l8rox0cL9ZeCMjrS0LDKmNnZX21NeIXY9KHWv vfckZaRXzjG0Hvpcma1iAE/VI5RNxP7sINZhMrq5v3enacl2ZtVWDhxGpB16AKbJVAs0 prRIjdnglfIP3lb9aoDQfKfWCv6ycRZRNB/3RbWEkSWmTPIO+tDVayO8/9WhDlzNZ0Qo QDCQ== 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 u20-v6si7459067pgj.443.2018.08.09.08.09.18; Thu, 09 Aug 2018 08:09:32 -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 S1732668AbeHIRdD (ORCPT + 99 others); Thu, 9 Aug 2018 13:33:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:50086 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732422AbeHIRdC (ORCPT ); Thu, 9 Aug 2018 13:33:02 -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 C5EA4AD02; Thu, 9 Aug 2018 15:07:41 +0000 (UTC) Date: Thu, 9 Aug 2018 17:07:35 +0200 From: Michal Hocko To: Tetsuo Handa Cc: Vladimir Davydov , Oleg Nesterov , David Rientjes , syzbot , cgroups@vger.kernel.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, Andrew Morton Subject: Re: WARNING in try_charge Message-ID: <20180809150735.GA15611@dhcp22.suse.cz> References: <0000000000005e979605729c1564@google.com> 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 Thu 09-08-18 22:57:43, Tetsuo Handa wrote: > >From b1f38168f14397c7af9c122cd8207663d96e02ec Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa > Date: Thu, 9 Aug 2018 22:49:40 +0900 > Subject: [PATCH] mm, oom: task_will_free_mem(current) should retry until > memory reserve fails > > Commit 696453e66630ad45 ("mm, oom: task_will_free_mem should skip > oom_reaped tasks") changed to select next OOM victim as soon as > MMF_OOM_SKIP is set. But we don't need to select next OOM victim as > long as ALLOC_OOM allocation can succeed. And syzbot is hitting WARN(1) > caused by this race window [1]. It is not because the syzbot was exercising a completely different code path (memcg charge rather than the page allocator). > Since memcg OOM case uses forced charge if current thread is killed, > out_of_memory() can return true without selecting next OOM victim. > Therefore, this patch changes task_will_free_mem(current) to ignore > MMF_OOM_SKIP unless ALLOC_OOM allocation failed. And the patch is simply wrong for memcg. -- Michal Hocko SUSE Labs