Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3338561ybz; Mon, 4 May 2020 00:44:01 -0700 (PDT) X-Google-Smtp-Source: APiQypLED/llJ50W0HGaQwjX8n+bVUPcBMMEt9o4AbfquC1oqq0eYjDVhb8rexCYS7YcXXxgTSL0 X-Received: by 2002:a05:6402:698:: with SMTP id f24mr13040511edy.260.1588578241146; Mon, 04 May 2020 00:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588578241; cv=none; d=google.com; s=arc-20160816; b=EVV/AMNFYGXbj/Gl9XbKCM+L44qBzslIXPkCIdSeGTiD+bzveb0F7rhrjwfSXDlppn or09qzhzYOuW88/e2I5XYuqYBjC5Ce6L1LuzEaGjr+SpfQo7TtRoTv/XM79h+4qcnQb0 2THQ0F9QcbS4SIsesslgGp2B89oy70XS4JfS0mLw/EvD/tidG/6LnpmKCBUTo1yKeIJV e0Z2K5j1t+mjg4V2cDTGxBYQeLGpv5EwgRSeoeDwij9RFC0LTnKzZm+IEr0wDnRNbihH 8fcDVuk3wr52fr0I/KFiEyRg4ZfFjvxuFyEixZX86jZkksmrXnFP2E4qPH4ER3ezunLE HD0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+OO9udw59FljC0Juy5HE0xNXWZK83D2kTv8ScoSvNNE=; b=hZERoQJAABn7oRyk9RykvoCOw0UW1p8QAjzJM+zAS+QKlDyy2Z0nR4e4UpbxKSChL6 JIkIN241nSpEu9tafqzbY01H64JMGLpyy5bWNs9oNvSfiYaFBHUNCK4BdrTe4uV2sH8J 96r1TtVq1lNCPoVlU+H+b0SVxVaUPuOxRd0pdVhEXD22G4+/Y9bcQVAv5Xt6NkLD6Dnq OWiBoKReNUCZdr7FiV264FIY3mlGS2zEGcgMpmXAofjxPCKvWjfVpHkucA7v7S3xjCP+ B5aAG/i4l9zG4+YtJm8qOJvuwXXt+0GVSAdU0W0Qz3X3qSv3Audmkv5HGg5WA10PcvVh UhFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RXefm4KB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id aq26si5829012ejc.26.2020.05.04.00.43.37; Mon, 04 May 2020 00:44:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RXefm4KB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbgEDHkz (ORCPT + 99 others); Mon, 4 May 2020 03:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727088AbgEDHkz (ORCPT ); Mon, 4 May 2020 03:40:55 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0970EC061A0E; Mon, 4 May 2020 00:40:55 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id m5so10332468ilj.10; Mon, 04 May 2020 00:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+OO9udw59FljC0Juy5HE0xNXWZK83D2kTv8ScoSvNNE=; b=RXefm4KBKTPlPnFlni95cg+CtOH9b765c48sU8nUlEhEB6EumsSO7LjzkJt8NUn65G vOOWU6bFdm2gvvMx6RlE8PrzCR8Ew8KJhXvf4za6A6ZT1DYzSx3ikRwQ2Yi2Bwhbvg1W HM5RxZ0vvltitG3kmuTKlIFvOfHLWsXcJak3TyNHBAJrQmnVbqbEnWRFYl/w61Gh6hb+ 8kwdkbqDZR1AW9HYi0FGI4Ck2gp1rw8FmIobCNYj1gmwoqD3rqkxaC/Wu/8y+/B4L7Sq 40pV1onyrHfUiU7qiqBrE1gN3DCUKq+l7gVCJRJKNNAshlTKbKzkc4NC7j9wSM52zncH 7PJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+OO9udw59FljC0Juy5HE0xNXWZK83D2kTv8ScoSvNNE=; b=QFVOu8sZDjgSEkG4idQnDPWE1AVh19pmetIQeuOniUf0cONhBUWw8O3HxlJTg6kAJs noI9SbANxPql2Ryapq05+iN2zt4eRAlb1ZvxATT8/4/bVJmWfV83iro3S0Nq245GSD8K 1XPD8uPtv9DCapA6GJTsheJ+TYeKz5Ln490aodMcwOcIIfkuNZ7v1QNc5KMIk/F/DiBs ffJjk92YrcT8YByNGz/KG6r2ugL+XuFWJbGMYcumfk4dAKC8ENJ6Gd4Laj2Xi/sS6Lhd BBnAKYQVKAskwIiCQp4t06zEOBXupGRp2QnLXCpafOHVnQ3UHOqLTl4STqnzqtyalFMN vI5w== X-Gm-Message-State: AGi0PuYMPR500hhIZEEH+FHjStT+h7ILSZ6KWSfN5NqUJ6Sy46Dyvxl1 /6ydLJjTfFPg651jRWnV8nfAam9WILBtYydY7DE= X-Received: by 2002:a92:1b91:: with SMTP id f17mr14838063ill.142.1588578054398; Mon, 04 May 2020 00:40:54 -0700 (PDT) MIME-Version: 1.0 References: <20200430182712.237526-1-shakeelb@google.com> <20200504070301.GC22838@dhcp22.suse.cz> <20200504073549.GE22838@dhcp22.suse.cz> In-Reply-To: <20200504073549.GE22838@dhcp22.suse.cz> From: Yafang Shao Date: Mon, 4 May 2020 15:40:18 +0800 Message-ID: Subject: Re: [PATCH] memcg: oom: ignore oom warnings from memory.max To: Michal Hocko Cc: Shakeel Butt , Johannes Weiner , Roman Gushchin , Greg Thelen , Andrew Morton , Linux MM , Cgroups , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 4, 2020 at 3:35 PM Michal Hocko wrote: > > On Mon 04-05-20 15:26:52, Yafang Shao wrote: > > On Mon, May 4, 2020 at 3:03 PM Michal Hocko wrote: > > > > > > On Fri 01-05-20 09:39:24, Yafang Shao wrote: > > > > On Fri, May 1, 2020 at 2:27 AM Shakeel Butt wrote: > > > > > > > > > > Lowering memory.max can trigger an oom-kill if the reclaim does not > > > > > succeed. However if oom-killer does not find a process for killing, it > > > > > dumps a lot of warnings. > > > > > > > > > > > > > I have been confused by this behavior for several months and I think > > > > it will confuse more memcg users. > > > > > > Could you be more specific what has caused the confusion? > > > > > > > No task is different from no eligible task. > > No eligible task means there are some candidates but no one is eligible. > > Whille no task means there is no candidate. > > I really fail to see a difference. It is clear the one is subset of the > other but in practical life tasks might come and go at any time and if > you try to reduce the hard limit and there are no tasks that could be > reclaimed then I believe we should complain whether it is only oom > disabled tasks or no tasks at all. It is certainly unexpected situation > in some cases because there are resources which are bound to the memcg > without any task we can act on. > > > > > We should keep the memcg oom behavior consistent with system oom - no > > > > oom kill if no process. > > > > > > This is not the global mmemcg behavior. We do complain loud on no > > > eligible tasks and actually panic the system. Memcg cannot simply > > > do the same by default for obvious reasons. > > > > > > > As explianed above, no eligible task is different from no task. > > If there are some candidates but no one is eligible, the system will panic. > > While if there's no task, it is definitely no OOM, because that's an > > improssible thing for the system. > > This is very much possible situation when all eligible tasks have been > already killed but they didn't really help to resolve the oom situation > - e.g. in kernel memory leak or unbounded shmem consumption etc... > That's still an impossible thing, because many tasks are invisible to the oom killer. See oom_unkillable_task(). -- Thanks Yafang