Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2163054imm; Thu, 21 Jun 2018 08:07:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJJr3Nq3I5bwYjvzL204LJwYlsylwc2QFg8pQIQ4eryyHJ3KFGMzORBL4BewJBI7PcGpDjL X-Received: by 2002:a63:82c7:: with SMTP id w190-v6mr22877667pgd.172.1529593676400; Thu, 21 Jun 2018 08:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529593676; cv=none; d=google.com; s=arc-20160816; b=bqbSWu9OPdmwbJoy0FP4Gv8YmPrW8GHX2KLg6zgeaUPJEr4xUMqXy8WEBLhDewp7DI 0j3X7x+TYidkaojgDt3mHINd25R8jTsNwst+OjogaDy34Hc+7KTtaBr/uX1IRO8D6ysP l25PsgoWJiM2kmJFNBiVaWBlf24vJX0wWyTk/o4ALgzsQqMZWg9vU4kKAKyPbndMXUaX t8k4GdpHtoR7qphILOsGxQayMVJylQdhSAipQes707bbRap0JFof+CpQbR4WAPLwrTAE g3gW9jLClg1v+Z+S6CW5TTmuEHTnyeTFU/meNcjelMh5/j0eeKQIa385ZM7EySP8w6kT RERw== 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=ZpRyKGpd7z2BU4sukBMU+c4K9rVAMfQcDuSbntH/Vu8=; b=IOohEDjrv7k1oJ6w30kryol9105NsameYnU2Dmf22BuWDgg356kCqQUYZwy6PkJMro rcIia0JjpoLxU/ZDfAw4K1O7Kw8JTgUmHDUVyY3X8bZk6E6s15L8V5FS8zK8Hl+wZv6d qa9/eTi4cPV2t8DsoCCcKdkPoMuJnNz5LmGaX/kVyZD1H6gLczHv6wjkokIyqXGVaP1T BdRlTf5DsOVna+vc5LLlHEXiz00vGXbnKIyxaVrF1hQkLJaKzgpbTceKHE+bwqbJG5Sd UYeKbsWnzzO1i03mBfcMzdhb5gV9PBYuCpoyv3c323GrmCtPQL+qAPxphKWiKu0qbuX9 83CQ== 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 100-v6si5070773plc.205.2018.06.21.08.07.41; Thu, 21 Jun 2018 08:07:56 -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 S933178AbeFUPFn (ORCPT + 99 others); Thu, 21 Jun 2018 11:05:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:33031 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932808AbeFUPFm (ORCPT ); Thu, 21 Jun 2018 11:05:42 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 61830AEF3; Thu, 21 Jun 2018 15:05:41 +0000 (UTC) Date: Thu, 21 Jun 2018 17:05:40 +0200 From: Michal Hocko To: Johannes Weiner Cc: linux-mm@kvack.org, Greg Thelen , Shakeel Butt , Andrew Morton , LKML Subject: Re: [RFC PATCH] memcg, oom: move out_of_memory back to the charge path Message-ID: <20180621150540.GO10465@dhcp22.suse.cz> References: <20180620103736.13880-1-mhocko@kernel.org> <20180621080927.GE10465@dhcp22.suse.cz> <20180621143751.GA11230@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180621143751.GA11230@cmpxchg.org> 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 Thu 21-06-18 10:37:51, Johannes Weiner wrote: > On Thu, Jun 21, 2018 at 10:09:27AM +0200, Michal Hocko wrote: > > @@ -496,14 +496,14 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, > > > > static inline void mem_cgroup_oom_enable(void) > > { > > - WARN_ON(current->memcg_may_oom); > > - current->memcg_may_oom = 1; > > + WARN_ON(current->in_user_fault); > > + current->in_user_fault = 1; > > } > > > > static inline void mem_cgroup_oom_disable(void) > > { > > - WARN_ON(!current->memcg_may_oom); > > - current->memcg_may_oom = 0; > > + WARN_ON(!current->in_user_fault); > > + current->in_user_fault = 0; > > } > > Would it make more sense to rename these to > mem_cgroup_enter_user_fault(), mem_cgroup_exit_user_fault()? OK, makes sense. It is less explicit about the oom behavior... > Other than that, this looks great to me. Thanks for the review! I will wait few days for other feedback and retest and repost then. -- Michal Hocko SUSE Labs