Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1432663imm; Fri, 22 Jun 2018 17:12:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJjpyCh8+AWawUTuVonxSqPpgc7M77/KKgDrhEHiiAhGHFtddRTJGOaqecbfNXrk4MLyTw9 X-Received: by 2002:a62:6941:: with SMTP id e62-v6mr3803561pfc.56.1529712721873; Fri, 22 Jun 2018 17:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529712721; cv=none; d=google.com; s=arc-20160816; b=IKHpo6ftwn60QghDrSltTU9B0TgkhKC9ke3AZYP/SIoihTOSXdPpuLh7avBXteb5W4 U6b/wqJ8GzBLlFrm9oWoVl/pYWyaXGKvEZfvsICp2AwkvxMC09+HSu/Q14FmmKq5RlOS k1HnRuuMXAqrsARWvqqRvIOCjfRJGb65ewH42Isx80VYYfPyEactQrYg/3vneuLy9waq O29fIcN1eRB5um1XFn2c9V421ZQtEi5DrUlpd2a4uuyrLMJmU1yjLPbN9MbFLX+aV78i +SlIwH2C3CsIAzI1GrbzeHQfo/E+pql/StRSwmhaJw8O2nqcTvSPn2UO2BjHFj5XsSuC 9nSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=gEmPFdXvf0sw7TJkUTy6uePegI7ZtVokewO48Q9HrNA=; b=RqQJu4erq98S3/OMSUKuuE/MHqMEx8uPxuVL2Wppn/BrZBwfZfSVKOkdXtJ5pvJ9sK daQbS2pIh4NCM4FVeZQmwvU/EvNckioREO99N9fZtJ0pScZuBzLYHPd4lXKSi01BZDCn MiiH8ioL5Y8RhuXY1xpCrmyUxHRN9uqAo/GTS6HlK1kqx7Nzjb6zviswpWfmYY+PdDdx mj5chNbyHSOaR8SAUewl2K26cAXxCMxA9H/4JSnAsDCvwcnwXz2JReQDzG6Atodn2wY5 Y3EJYqCWgf3PwaHowCzOfnBdJ51PSIFNwLuYinBsD/L/VAZXsLFUol85KwqOdbOz58jS Qf2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tv5BAHb5; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13-v6si8756063pls.70.2018.06.22.17.11.47; Fri, 22 Jun 2018 17:12:01 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=tv5BAHb5; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934366AbeFWALD (ORCPT + 99 others); Fri, 22 Jun 2018 20:11:03 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:53318 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933934AbeFWALC (ORCPT ); Fri, 22 Jun 2018 20:11:02 -0400 Received: by mail-wm0-f68.google.com with SMTP id x6-v6so3668248wmc.3 for ; Fri, 22 Jun 2018 17:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gEmPFdXvf0sw7TJkUTy6uePegI7ZtVokewO48Q9HrNA=; b=tv5BAHb50vsuaMCh3tP2BTIvIO4oB+oo9R14jAMRAXlI80x5O2K+d5Zb6aTRqDWDwS 0TSdGE4oXf4E0jvokTQgCNgFh2sPbIUEceEfrl05erkyDlJOOUxZXZ24xkg6nZYtkcaL d6U80HO415HkbU8CvP8mbXpo+2+T6VF12O8UKl4J2ctSW13p+PpfSVrkmL1IPcQyD/sy vdia5lNy+52HWhL94kcivMK4btsm+NeBD47/J3icGilACdDkI93m7E1cPm1Nf8DpxvIz Aw5GPGDfZ5RY0g3+dhLKJAcL97zc7kIqDRZsw/5d2LCNXUQnRpl892Z/gVc36PHZmiE6 v9Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gEmPFdXvf0sw7TJkUTy6uePegI7ZtVokewO48Q9HrNA=; b=Zx6BRxjYJfDvUEvLebV84FJ1yuHtfi91ILptPLDCcrGDe4ZFckDG6rCZn/dI7zuLZx 0GWXJwiXtaN9sFF+rp3Fwjy2KIwl9WOsFT7lDrHPQJeo0VCnbwI7yxIv25t2p6SwCwLd ib1tCdeXJGzs6oXsJVHDX4ycRI6Huu5JDHHae/ElbBNY5dyKwQVfr8XB/jV9BsggKj9Q LH7953r0myjVnnXGFNGGJhdU07hVqccTLOPijXevTKIO6z0BDeeh+N1AxbTJWd2HBljO oJu00O3TDePQ/b1GInZGLP8b9+CtTvw2NB2LeIfvoreR8pUgIlcmn/EWu4k1XxduyhSN n9FA== X-Gm-Message-State: APt69E2LlYkoTHdeF8caXQWiB10T3Z/Dsc+R91qgtpvBRj9x4lMVQeF2 QoP4v6nWMJdMkxATfjkf1mgLwACob6b5QmTblHsyDA== X-Received: by 2002:a1c:443:: with SMTP id 64-v6mr3292942wme.140.1529712660830; Fri, 22 Jun 2018 17:11:00 -0700 (PDT) MIME-Version: 1.0 References: <20180623000600.5818-1-guro@fb.com> <20180623000600.5818-2-guro@fb.com> In-Reply-To: <20180623000600.5818-2-guro@fb.com> From: Shakeel Butt Date: Fri, 22 Jun 2018 17:10:48 -0700 Message-ID: Subject: Re: [PATCH 2/2] mm: introduce mem_cgroup_put() helper To: Roman Gushchin Cc: Linux MM , LKML , Johannes Weiner , Michal Hocko , Andrew Morton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 22, 2018 at 5:06 PM Roman Gushchin wrote: > > Introduce the mem_cgroup_put() helper, which helps to eliminate > guarding memcg css release with "#ifdef CONFIG_MEMCG" in multiple > places. > > Signed-off-by: Roman Gushchin Reviewed-by: Shakeel Butt > Cc: Shakeel Butt > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Andrew Morton > --- > include/linux/memcontrol.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index cf1c3555328f..3607913032be 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -383,6 +383,11 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css){ > return css ? container_of(css, struct mem_cgroup, css) : NULL; > } > > +static inline void mem_cgroup_put(struct mem_cgroup *memcg) > +{ > + css_put(&memcg->css); > +} > + > #define mem_cgroup_from_counter(counter, member) \ > container_of(counter, struct mem_cgroup, member) > > @@ -852,6 +857,10 @@ static inline bool task_in_mem_cgroup(struct task_struct *task, > return true; > } > > +static inline void mem_cgroup_put(struct mem_cgroup *memcg) > +{ > +} > + > static inline struct mem_cgroup * > mem_cgroup_iter(struct mem_cgroup *root, > struct mem_cgroup *prev, > -- > 2.14.4 >