Received: by 10.192.165.148 with SMTP id m20csp1034013imm; Thu, 10 May 2018 04:42:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoypvtUWeynCR1kzD/wZMpALUW24wxm9SQsdEqvkBiuwgvehjuHffCXpygNBFEjZDGdsTHC X-Received: by 2002:a17:902:aa4b:: with SMTP id c11-v6mr1074926plr.17.1525952538189; Thu, 10 May 2018 04:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525952538; cv=none; d=google.com; s=arc-20160816; b=A79nkQB9rYvV8zTzb8QsN2l7BoOzl2BSVyqtHo9p8nbsrMruztq4igO/lF4VUem5RL 1W9EY+4xfPNyWPwRPwVqTYAURk4/jLZDSymWfcehlVoo3ZiIvBl9mUXRhvgEL/6UE/d9 6DyWK4rwe0cm/+yg5zvA4JBA7GrBcNKktR8Aple1BfTxwoPhBneEzcvhLX3c1FawLIWa J8cSxqMzZND3lqwShw6oq44Q0w0Iwya98rnO21p+XRH95AdxZ+WG5nQ1mv3mh/elK4g4 UZAbszGz3EdbRyhW16Z0bNopbBZ8KGLjYBl9hZtgd94wUgoDsjfeyIUeJ/CHLXBS+Zia NdRg== 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:arc-authentication-results; bh=xlWbJA6PN+XsslPYYDShs8KR2eQ6qfnw83Lvi0paixk=; b=bRuUCEY2pFyaM+D1IH9PLG7iPG9uWV/LVBtNit0w/1kG3BGs9wN5oyABEMKCnTYmWd lWrb7SQmojxoFfQD03RcftXywj7OSvJVcNx4HtaBF53hpHDjx963Guj0CqwHhZbjr/sR 2t8Czudse9zEagny4FsdyC9JjSm3bXXbVvzALv6n3X2lJT2k9T8m3wHd+y8GRCv3ZR3N RKyHrITlObxhVk5XTLoz5nNEb9yHa+Sv7NnvCVxEVRZGOqQuN9N70VcDT02j33h537Xs 3/VCamiarv1zIl+Sy1p4IaPn9FD95TNLo2jzM7TGpt5ls/UZOQYbkIZCYgOhUMxKVKxy zRJQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65-v6si645579pfo.229.2018.05.10.04.42.02; Thu, 10 May 2018 04:42:18 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935335AbeEJLlu (ORCPT + 99 others); Thu, 10 May 2018 07:41:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:37858 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935101AbeEJLlt (ORCPT ); Thu, 10 May 2018 07:41:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3A988ACD5; Thu, 10 May 2018 11:41:48 +0000 (UTC) Date: Thu, 10 May 2018 13:41:47 +0200 From: Michal Hocko To: Roman Gushchin Cc: kernel-team@fb.com, Johannes Weiner , Vladimir Davydov , Andrew Morton , Konstantin Khlebnikov , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm: fix oom_kill event handling Message-ID: <20180510114147.GB5325@dhcp22.suse.cz> References: <20180508124637.29984-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180508124637.29984-1-guro@fb.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 08-05-18 13:46:37, Roman Gushchin wrote: > Commit e27be240df53 ("mm: memcg: make sure memory.events is > uptodate when waking pollers") converted most of memcg event > counters to per-memcg atomics, which made them less confusing > for a user. The "oom_kill" counter remained untouched, so now > it behaves differently than other counters (including "oom"). > This adds nothing but confusion. > > Let's fix this by adding the MEMCG_OOM_KILL event, and follow > the MEMCG_OOM approach. This also removes a hack from > count_memcg_event_mm(), introduced earlier specially for the > OOM_KILL counter. I agree that the current OOM_KILL is confusing. But do we really need another memcg_memory_event_mm helper used for only one counter rather than reuse memcg_memory_event. __oom_kill_process doesn't have the memcg but nothing should really prevent us from adding the context (oom_control) there, no? [...] -- Michal Hocko SUSE Labs