Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2180757imm; Thu, 9 Aug 2018 08:34:05 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx6pDQqzq+gGPLlnLB8ZWeWPeMqCjJpVxg9spiV2Aouhos6oN18Wc2Q1SCcKJgnCqm4l8EZ X-Received: by 2002:a17:902:8ec8:: with SMTP id x8-v6mr1683055plo.308.1533828845005; Thu, 09 Aug 2018 08:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533828844; cv=none; d=google.com; s=arc-20160816; b=x7SeSCEkrTarWh6bkrwbb2neprAZElg8kDmgtFtOkkfIkl4dpWwegpMOej80OIBtU1 +zrreYOSfiMeWD1n3/s5I9KQsQfWA3mYITbmUZcqGT/Z95VQ7KbFSMq98BNp7Odn44ea AxJdriUaL2OkKspNkNSk7vMnpFZGHZu2+GDnq9ikRv4+yV5pVETjeI6kwm2pDLIbB3pZ kgVPSvOhg9zqd9yLus/N/ppl8VYOKBSugbQk2ptDvTl5YXQMqMoSQCFIWvWSNyzxC4cW CtdB4zNgzSBCmgQuBEWHg0Oe2FQfGwHZfhE19zUNLkSyMG2hQQlELlfhaYeh8RSFK2k/ eVjA== 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:dkim-signature:arc-authentication-results; bh=Q+ybpDce2iHfmfRedVYwQZPbXrq5puum25iLpbPcm+k=; b=e1g1dke8doqMEdlDh9y4XK5r1twBfW6ehUYejUVRzX+DoXavJvgJrpi6A80fDV5PMc v7OrvXKsjq/0+pnzfjyr+dCTBGO64pScvAOEqiK6RJTX1NE8S/9heVwlt9yYXq2uNUAj 2wlnVZZpeGOdFLi3bVKj6DTnKlvEEZhXMoee5M5miNUvUCPeqqqid4Orwakqo0FVyn5Y dF4EIPQuyfl+YMeFKoN26tL9S0wrlWPSX4mXMEd0tZy1zIvTgqIJnu9psO2YnP7XodUx Gl3bzm1Ga9kJBg73iKpSBc5jUMbQiPUa9Z2jQobAAw/08Y2BCdfMNYf1o8Zls4AT5+18 ePIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=sVQQ1Gwb; 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=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a190-v6si6905786pgc.241.2018.08.09.08.33.50; Thu, 09 Aug 2018 08:34:04 -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; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=sVQQ1Gwb; 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=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732414AbeHIR45 (ORCPT + 99 others); Thu, 9 Aug 2018 13:56:57 -0400 Received: from mail-yw1-f44.google.com ([209.85.161.44]:46935 "EHLO mail-yw1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732298AbeHIR45 (ORCPT ); Thu, 9 Aug 2018 13:56:57 -0400 Received: by mail-yw1-f44.google.com with SMTP id e23-v6so4735285ywe.13 for ; Thu, 09 Aug 2018 08:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Q+ybpDce2iHfmfRedVYwQZPbXrq5puum25iLpbPcm+k=; b=sVQQ1GwbtgjJHMZdFMjdB2wIZHwdFpyHLMH4v4500uAedUyKe/FwD/qhp04Qmb/ymE ULUIhXrY/8Duu2bau/6FG0rT9I4LyNU0SVlGeoxf+h3+estv2Ms0PR9OBjAep8djwraH TOL1Nih/PSn3RcS7HY9mAPWai3/QA81UIMW9jEUS27RvjcBGY4XKNEazM2555SD6A3Qo 9XEeqHu6FquupXx9bKRsjCuq4VT6Y3UKgB0IL9cySuPgSAc/Tbb+ViNo3M8OJ2fH4grz KHgFYo/jjCA2CX1hyApiknC3Xjn5mj2HUltXlRLvygNnNbIItrieiaXht6tcBnI4TgWq DDBQ== 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:user-agent; bh=Q+ybpDce2iHfmfRedVYwQZPbXrq5puum25iLpbPcm+k=; b=HH8gOhi+fSur60WY06HVY+HDpmBC4+Y2PQcis76H6CjKA0xitceUqdkuQmNWeoS/VW azaFHR7dDBfM/3eNGeR9agpFWlWeHiBzHtP7s1AJ8eBZPzXaCYdkNFADrEk/Lr/NmShI 5wpgupdxWVmpBqcI7u2iusfyPcfIG7GJRN1VXfz0BnAhZgR/e55KnLIo5g9paJ10qzuq v9uXUDgVU4/bX6LjUfG3Nl7k6Sh0CQIDCiC4zRcThECD1IRxXkYZPE1swbPbaljRp6AG eJ4OIHmxzA+DByCtW0ffWLiFihe4bmjCVrVxbDmTxKGo/cmX3T1ckt9leK26nY0g3hjN vDBA== X-Gm-Message-State: AOUpUlEqXnActRbxkduCrd6tKdCvaTHN4nHAoTsORByoczn6b3Pw1Kxj 8scsZUfGuIy+VxvF53SoRpHW4w== X-Received: by 2002:a25:e905:: with SMTP id n5-v6mr1364769ybd.516.1533828691597; Thu, 09 Aug 2018 08:31:31 -0700 (PDT) Received: from localhost ([2620:10d:c091:180::1:7b61]) by smtp.gmail.com with ESMTPSA id 141-v6sm3575958ywj.65.2018.08.09.08.31.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 08:31:30 -0700 (PDT) Date: Thu, 9 Aug 2018 11:34:30 -0400 From: Johannes Weiner To: Tetsuo Handa Cc: mhocko@kernel.org, Vladimir Davydov , Oleg Nesterov , David Rientjes , syzbot , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, Andrew Morton Subject: Re: WARNING in try_charge Message-ID: <20180809153430.GA17445@cmpxchg.org> 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.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 09, 2018 at 10:57:43PM +0900, 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]. Huh? That's the memcg path, it has nothing to do with ALLOC_OOM. > 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. I have no idea how the first and the second half of this paragraph go together. They're completely independent code paths.