From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63025C433EF for ; Sat, 4 Dec 2021 00:46:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A6096B007E; Fri, 3 Dec 2021 19:46:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 758DD6B0080; Fri, 3 Dec 2021 19:46:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61E2E6B0081; Fri, 3 Dec 2021 19:46:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0052.hostedemail.com [216.40.44.52]) by kanga.kvack.org (Postfix) with ESMTP id 4F0B36B007E for ; Fri, 3 Dec 2021 19:46:18 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 15EBE1847A0C8 for ; Sat, 4 Dec 2021 00:46:08 +0000 (UTC) X-FDA: 78878270016.09.B1EB915 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by imf05.hostedemail.com (Postfix) with ESMTP id BBF2C100003 for ; Sat, 4 Dec 2021 00:46:07 +0000 (UTC) Received: by mail-lj1-f169.google.com with SMTP id p8so9335724ljo.5 for ; Fri, 03 Dec 2021 16:46:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=84mOUp3LokD6J3j/XPGM8Gdyu0TNZ1hY1SXnt8ueQl0=; b=W00VL1dQdtqB96CSXr76uDShRNGRcJZoc5gxPBZH6JD2lO3sXg/MbNgoIepxvjgy/v 1ngl4zAcaMGNYSSMFZUmcTZGNuuO8BREoXOAvrLF1NuaG6twbr/BvF8zVlA2WCvc2n+s 3atBTFjXpvf1BSw+xfGON8yWnXNLilAs33nqQ3TOiIIAryw8JTfFkO7b1WoJAv3zh/vW q1r05yy7mWaFNdo7OI46VANrC5cGCWMoG3EInP4CFFm8+Q/q39qu7nPEsJ9jSHTc3IgO oyiqNf62GHUrdj+I5THRVlKdw6jqwGTlCFLYmU1q+05R2IZ7CtOuatZgdbmNpnfUpW6C 1BoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=84mOUp3LokD6J3j/XPGM8Gdyu0TNZ1hY1SXnt8ueQl0=; b=4b7lNMwpewieUcn3fRbzZBTd8JlfcqBmu5//cMbu11ETgschtH3Gh7V1fijg2S7E1F pNM9kv6WWRn8doP6eUuQlrfmElP9FYBhSadj4QnEoLjWWiPbRpnDbX+Y1yWflnIplrVW SqUFuK+BgMlcuF9zlxiLvrSyRloHVIfk8Zj8GyeMuCj/pZhvv82iqPo5snAPpiw11xTR 4d34SpUqG6f3+VL6YwqfyXdn1Q4YzT6EC5sZcwABr/5ZQnYSIljIqNOpXvrWbq08d1aK yrPN5jh7Z1UnvgX06e66e9k/043SIxI7sej2dpF/zDLui7GeYbqzmEGwrlQaZi1xJp3M VX5Q== X-Gm-Message-State: AOAM530AoY7HAN/eaydXM7R9pGPk/E7CIxBUrv4KTL3Mz5duif0Zv5Xv 2QTgC6BpuCW+67hKaPjhhxP3iiRhxmbZziLkCytixw== X-Google-Smtp-Source: ABdhPJzLV+ZZmoda/NgcR2Lu4eylwVG/7x4I9dAzKn8K8L/25X9VSHMV6CmA5i65Wuva7AzCKFziwlqii0mxLRX3B38= X-Received: by 2002:a05:651c:545:: with SMTP id q5mr20684058ljp.202.1638578765757; Fri, 03 Dec 2021 16:46:05 -0800 (PST) MIME-Version: 1.0 References: <20211203162426.3375036-1-schatzberg.dan@gmail.com> In-Reply-To: <20211203162426.3375036-1-schatzberg.dan@gmail.com> From: Shakeel Butt Date: Fri, 3 Dec 2021 16:45:54 -0800 Message-ID: Subject: Re: [PATCH] mm: add group_oom_kill memory event To: Dan Schatzberg Cc: Johannes Weiner , Roman Gushchin , Tejun Heo , Zefan Li , Jonathan Corbet , Michal Hocko , Vladimir Davydov , Andrew Morton , "Matthew Wilcox (Oracle)" , Muchun Song , Alex Shi , Wei Yang , "open list:CONTROL GROUP (CGROUP)" , "open list:DOCUMENTATION" , open list , "open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BBF2C100003 X-Stat-Signature: z44c9hb3tx9dtihyg5jheb5cs9yzqjy5 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=W00VL1dQ; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf05.hostedemail.com: domain of shakeelb@google.com designates 209.85.208.169 as permitted sender) smtp.mailfrom=shakeelb@google.com X-HE-Tag: 1638578767-257209 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Dec 3, 2021 at 8:24 AM Dan Schatzberg wrote: > > Our container agent wants to know when a container exits if it was OOM > killed or not to report to the user. We use memory.oom.group = 1 to > ensure that OOM kills within the container's cgroup kill > everything. Existing memory.events are insufficient for knowing if > this triggered: > > 1) Our current approach reads memory.events oom_kill and reports the > container was killed if the value is non-zero. This is erroneous in > some cases where containers create their children cgroups with > memory.oom.group=1 as such OOM kills will get counted against the > container cgroup's oom_kill counter despite not actually OOM killing > the entire container. > > 2) Reading memory.events.local will fail to identify OOM kills in leaf > cgroups (that don't set memory.oom.group) within the container cgroup. > > This patch adds a new oom_group_kill event when memory.oom.group > triggers to allow userspace to cleanly identify when an entire cgroup > is oom killed. > > Signed-off-by: Dan Schatzberg So, with this patch, will you be watching oom_group_kill from memory.events or memory.events.local file for your use-case? Reviewed-by: Shakeel Butt