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 X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 690EAC10DCE for ; Wed, 18 Mar 2020 12:31:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2BBBB20767 for ; Wed, 18 Mar 2020 12:31:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BBBB20767 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BE28F6B000A; Wed, 18 Mar 2020 08:31:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B928C6B000C; Wed, 18 Mar 2020 08:31:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA8E16B000D; Wed, 18 Mar 2020 08:31:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 8C27A6B000A for ; Wed, 18 Mar 2020 08:31:11 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 30088246B for ; Wed, 18 Mar 2020 12:31:11 +0000 (UTC) X-FDA: 76608417942.15.moon51_61a4c808b0249 X-HE-Tag: moon51_61a4c808b0249 X-Filterd-Recvd-Size: 3797 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Wed, 18 Mar 2020 12:31:10 +0000 (UTC) Received: by mail-wm1-f47.google.com with SMTP id 11so3127747wmo.2 for ; Wed, 18 Mar 2020 05:31:10 -0700 (PDT) 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; bh=J4S1KIZkd3A7M+OXs6nSrJJ9jI8n39NroLM1YJ8t0Co=; b=aLrqMrq7D7Lng4wjZjTksoY5y+x1S1UY0wn4Pee8LNnZKyCqGxJtHDiOTx/R9GwESc zmcMz02nNKnFJn2DBmxI8P3BjjKzCxCaxmft3SUZiJTi9cdJN1Rkg3e2U6bsfYrLRIz6 DjpF4IUobvC34J+N2uYqnSzlmNFoFYFaYHUh/RrjHT7o/FOfR5U76W7qu57+/eADRXqI pQ8zq0c3J5/VTwmIMarFEe16I05KjG3x/rg9Kiw8MkFu/kwLU8Lj2X+53fB+taBITwqv UpsroJDHRp7lFJFC0+Q+LKuBT6yhI7u/ffRTZlat1ba4XTfHi4t6Q7SeQLPLHRV6jnzo BZyg== X-Gm-Message-State: ANhLgQ2Cj8zogE7tL+TFgB177xdUA087xEAsGSwXslgIbxpGeSyD4mY5 LXa/hJFTTi7VFNC4RTn3b6A= X-Google-Smtp-Source: ADFU+vu1q7abU8bVDZ1169q2Hs+UDQnlepqGsBEOdo4xPzkzICgyOmwTMtg4eef6jId+ldfF84vv8w== X-Received: by 2002:a1c:3585:: with SMTP id c127mr5018236wma.124.1584534669710; Wed, 18 Mar 2020 05:31:09 -0700 (PDT) Received: from localhost (ip-37-188-180-89.eurotel.cz. [37.188.180.89]) by smtp.gmail.com with ESMTPSA id k126sm3928057wme.4.2020.03.18.05.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 05:31:08 -0700 (PDT) Date: Wed, 18 Mar 2020 13:31:07 +0100 From: Michal Hocko To: Roman Gushchin Cc: Andrew Morton , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: memcg: make memory.oom.group tolerable to task migration Message-ID: <20200318123107.GK21362@dhcp22.suse.cz> References: <20200316223510.3176148-1-guro@fb.com> <20200317075212.GC26018@dhcp22.suse.cz> <20200317183836.GA276471@carbon.DHCP.thefacebook.com> <20200317185529.GV26018@dhcp22.suse.cz> <20200317203645.GC276471@carbon.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200317203645.GC276471@carbon.DHCP.thefacebook.com> 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 Tue 17-03-20 13:36:45, Roman Gushchin wrote: [...] > > > And the we can put something like > > > if (WARN_ON_ONCE(!mem_cgroup_is_descendant(memcg, oom_domain))) > > > goto out; > > > to mem_cgroup_get_oom_group? > > > > This would be a user triggerable warning and that sounds like a bad idea > > to me. We should just live with races. The only question I still do not > > have a proper answer for is how much we do care. If we do not care all > > that much about the original memcg then go with your patch. But if we > > want to be slightly more careful then we should note the memcg in > > oom_evaluate_task and use it when killing. > > But it won't close the race, right? > > oom_evaluate_task() can race with a task migration too, so we can record > the old or the new cgroup. Are you sure? I thought that cgroups iterator code would take care of those races. The documentation doesn't tell much in that respect. Maybe it would be good to add a clarification there. > Then I'd stick with my original patch which solves the main problem here: > unnecessary killing of too many tasks. OK, I am fine with that. I couldn't convince myself that the other part of the problem is serious enough. Maybe we will find workloads which do care and we can add that later on. -- Michal Hocko SUSE Labs