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 B15F5C433EF for ; Fri, 10 Dec 2021 20:00:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 191396B0072; Fri, 10 Dec 2021 15:00:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 11A346B0073; Fri, 10 Dec 2021 15:00:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED5DE6B0074; Fri, 10 Dec 2021 15:00:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id D90536B0072 for ; Fri, 10 Dec 2021 15:00:21 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8B0122027A for ; Fri, 10 Dec 2021 20:00:11 +0000 (UTC) X-FDA: 78902951022.03.262E8AD Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by imf18.hostedemail.com (Postfix) with ESMTP id AB59C1C0006 for ; Fri, 10 Dec 2021 20:00:09 +0000 (UTC) Received: by mail-qk1-f175.google.com with SMTP id m186so8814568qkb.4 for ; Fri, 10 Dec 2021 12:00:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yLZJvjoofMd+xeF11awcZvcV4Nn3U+z+fMY0sp4o/sA=; b=BjS8Vig6e8gQ4F0ZwsS3QThNYRE1ejxTIXemMKWA/aHL8GjyLyTAhPf/Yn4mdskwdf aGk3YFZk3sckvjvH/XRMg6GqWCMnutMR9SLLbsDTP1CWCGbMFyuGWDDSQPaHvMh5uDPY z3K0J/UJ88uHGHrSEaJG1bGYB13RPUe6ug+5eyDprQAY+8kISqRD/Kokt2j8/3EEjF+w Ij8EsV1Mq18LEA8wgQtDhSBN+KwwoFXMxKkv0Z2fiFWa5YOwIw2jy2ERGW9Ua+or7G2V K+1YH+vLDsvdwnJNUccX+KEsh3seflpRZHOnjBrh8z4QksUW5Fl5x9DJB9B0f+zojjUf OS7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yLZJvjoofMd+xeF11awcZvcV4Nn3U+z+fMY0sp4o/sA=; b=Sxq6N5yu5bLC6AkGgXqeBqsFJz+i4ZRCgySt1TLGyGOxV1vzV9ES0qNHdbwrMB4Xjk fqrmnWArt7Xq7s2iZCImp73WZDpfzrkpyHmYZXj17R9VnrEZC1Zd3yuthrkxDUnamPSQ WynJHP4+e3AVPzMYIdsOLOYKha/WzJ6vZpmIRlvhZtbJPRpweTuhRe54VM8FKU9xV0yC KAmm+6tccKBa39NG4BUJHidTgbLDHUWNxlsj+vhClcmhH8xf2Je74ATWfejHI4ZmxUFC 5J3fIqkJlpA6klJWCCM71TVlvxCoUai7ZDvwyjoUY33CjNm+PeimFRCMFWpfigOLc1iD Szgg== X-Gm-Message-State: AOAM533dmIALv5dbNYcoSxXgmNCAeQpgH4ReVWbyfmdyoDWoSpbaRK1E m5ygc+DANScDKfq2k84HYAw= X-Google-Smtp-Source: ABdhPJxcyt16X640iWzcAvnwZWhPX3Xnns70Dp67SogNqM2UhY/oywrxq/hOGQnDCQLuwDoSew/1nA== X-Received: by 2002:a37:e105:: with SMTP id c5mr22591377qkm.777.1639166409684; Fri, 10 Dec 2021 12:00:09 -0800 (PST) Received: from dschatzberg-fedora-PC0Y6AEN.dhcp.thefacebook.com ([2620:10d:c091:500::1:a9d6]) by smtp.gmail.com with ESMTPSA id v4sm1734537qkp.118.2021.12.10.12.00.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 12:00:09 -0800 (PST) Date: Fri, 10 Dec 2021 15:00:06 -0500 From: Dan Schatzberg To: Shakeel Butt 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)" Subject: Re: [PATCH] mm: add group_oom_kill memory event Message-ID: References: <20211203162426.3375036-1-schatzberg.dan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: AB59C1C0006 X-Stat-Signature: iniuo6ieehyewnju49igr74kxom6y4mh Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BjS8Vig6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of schatzberg.dan@gmail.com designates 209.85.222.175 as permitted sender) smtp.mailfrom=schatzberg.dan@gmail.com X-HE-Tag: 1639166409-747428 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 03, 2021 at 04:45:54PM -0800, Shakeel Butt wrote: > 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 We will watch from memory.events.local. If containers want to construct their own child cgroups and allow for group oom to occur inside, that's fine - a future container exit should not result in us claiming the container was OOM killed. If the container exits and memory.event.local shows oom_group_kill > 0 then we know the container was OOM killed.