Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4593627ybz; Tue, 28 Apr 2020 14:23:46 -0700 (PDT) X-Google-Smtp-Source: APiQypKpKV1rIPFT1AA5KuWyg16itJ7l5lcN20vP8P5X1djHbONqJVshwDFzNHPM8lyDXxcjeOsw X-Received: by 2002:a17:906:355b:: with SMTP id s27mr27323912eja.184.1588109026637; Tue, 28 Apr 2020 14:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588109026; cv=none; d=google.com; s=arc-20160816; b=NxrkBqtgMvu1oUZbtEiMvPF7T6pa70pY1p4lA0G2g0BX8G7b3uUvomYr6KfTz00Cw+ XQhCdDJh7xiE7c5XFZImdkbo/5QIjXVs3/2cZuaP09Z82La4BYA0hkRyiGZ+QCh/tR6z FIjp/1Y0xcyuZ4g+7t/AN8yVu3eq+cUZqiMbVoX+dLSapqC305Rfn9z5+HlgtpUcLDVz iUR5C54+6yafdiLtsA7IaNRsbmTHp2AUBJELGtrU+67vigSgXjaYi/nLJoBbtyjG3Lnu MZ4ZbGtjR3zdVAj4gWEgwusWi8+TWZiO5GuBhdkyHovZf430wfGlPO6obc67xiADJI3O 8GtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=DYMJh06e9iMMWdrsr02cndKE1zO1nSUZw6qGhVvzfJk=; b=d+i/t7oIeALLmjm/2V4ANrLdS2hLYhoSDw08U9lVkaWsr2QZxOEA3UGIS/dV8gPF2R yu8469WatRtD2Xo2GW5GY4vqQzS5HpoDb1ob7CnzjDEQaMoFxzMDm9rkMwPUpcbvY9uC MB32xbFnghNwh4O1ReUFKJ5aCyCGiQhsQINLji7oT/3yCTnw5IGAvXj8lHBr9KL1LWcM kkkDNGWGbEQ8WHOZOOyvZEvZ9FOoB6vhM6HC3mEcrq4bxUFFYSrsJI6W2p8L5ztRn0qx D/j8FTi/PWCZOKexIx4STLMhAIjrxNunRYo8hDwFxjm+1HNt9HU9CDhw0Q5NLhLnv0nd ZPZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b="Y04B/ety"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si2385034edv.573.2020.04.28.14.23.23; Tue, 28 Apr 2020 14:23:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b="Y04B/ety"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbgD1VUF (ORCPT + 99 others); Tue, 28 Apr 2020 17:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726309AbgD1VUE (ORCPT ); Tue, 28 Apr 2020 17:20:04 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52033C03C1AC for ; Tue, 28 Apr 2020 14:20:04 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id s63so23372902qke.4 for ; Tue, 28 Apr 2020 14:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=DYMJh06e9iMMWdrsr02cndKE1zO1nSUZw6qGhVvzfJk=; b=Y04B/etyyvTEoyxiFp/Ge/tIuXV13XVK0tWT0wMgXagiNpdXZHu671Z6uz1oRQxTB/ luDeG+Ku00p2UIdq6iTHAj9wPCunMVfBBb7rEmmQQoPJMnvNJbx9jNYKKvrwAxUM2POw NsPtGsFu+ENVdOtc0jqhTayn09DQb7BFMworUt92vQxYGwMip2kjIPcUtpO8P2SSG4Sb ipW+OfYq3uk7IwQhZ4zZTN20uXB8GtEQZsq8l1ttW9kaZJd9zkSybkcacHxlcVU7vCFm dGy41fvebrFw1PFFAc8HjEB30V0SWwU7SSLDh0nH1vGdWM2eUPfMopufnc0w0Wl3xMiG mujQ== 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=DYMJh06e9iMMWdrsr02cndKE1zO1nSUZw6qGhVvzfJk=; b=K7NzQA6EiqRL6ZKvmwyx24Y6TJGgl3AP2vxjxDuR0Bv/1NzlimTiJLLoe9K+YXqteM aRxT+WZZaZ9jKBTEESI/bCus3rJ74rb89+DM1sJdpZmDRT/eOTMLvHUe/iil6EhASOVS mzVwBPi4L0UPbsOFpxeW5sNzllULGfXo6RbcjU1cUhnFcYYZS87bEg57FnNZ2suweppi 1d+vG20XyR5UaNKFuEIarWjcamuDKbdUS8Yv9t255FPl01D49pK4EYUbB70NlHAPhSYG UJGN5p4+oneoLgWYVPq+Rv+U6+nXaO1+xyF1Mm6lcrOrbLau79ChVi3tyKILsf83btNE qS7Q== X-Gm-Message-State: AGi0Pua1V5igGZ8/C8DbfxUosvVn8ZNaEoqCrmplTy3uvs3hR8uUT6ya kjQziPQ79+a94d6/UWW6sydAKQ== X-Received: by 2002:a37:981:: with SMTP id 123mr29310832qkj.453.1588108803619; Tue, 28 Apr 2020 14:20:03 -0700 (PDT) Received: from localhost (70.44.39.90.res-cmts.bus.ptd.net. [70.44.39.90]) by smtp.gmail.com with ESMTPSA id 60sm14455678qtb.95.2020.04.28.14.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 14:20:03 -0700 (PDT) Date: Tue, 28 Apr 2020 17:19:53 -0400 From: Johannes Weiner To: Chris Down Cc: Andrew Morton , Michal Hocko , Roman Gushchin , Yafang Shao , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm, memcg: Decouple e{low,min} state mutations from protection checks Message-ID: <20200428211953.GB400178@cmpxchg.org> References: <51ffacb736bb02ecc09c828ebe8f4ec7fda68c48.1588092152.git.chris@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51ffacb736bb02ecc09c828ebe8f4ec7fda68c48.1588092152.git.chris@chrisdown.name> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 28, 2020 at 07:27:00PM +0100, Chris Down wrote: > mem_cgroup_protected currently is both used to set effective low and min > and return a mem_cgroup_protection based on the result. As a user, this > can be a little unexpected: it appears to be a simple predicate > function, if not for the big warning in the comment above about the > order in which it must be executed. > > This change makes it so that we separate the state mutations from the > actual protection checks, which makes it more obvious where we need to > be careful mutating internal state, and where we are simply checking and > don't need to worry about that. > > Signed-off-by: Chris Down > Suggested-by: Johannes Weiner > Cc: Michal Hocko > Cc: Roman Gushchin > Cc: Yafang Shao Acked-by: Johannes Weiner