Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp6351492imm; Sun, 20 May 2018 00:58:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqZnDZZZO+E7/X7cpFNT7Zrr4CowR3zY91xliFuvsOjf6bUTS8paJXHfvwDsYeqdCCtbGIG X-Received: by 2002:a65:4a02:: with SMTP id s2-v6mr12290895pgq.265.1526803123680; Sun, 20 May 2018 00:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526803123; cv=none; d=google.com; s=arc-20160816; b=XbdjnBJRi0EBM7YJgCxwqeWbyFtpU8xUyxvperMk+q+bbhEXPeQe64Cv3z7Jv2/pyX m1kU0Pu7d2aSiujD3b9oEkYKomHr6ALTayKojWdI4k4obLKsD8aOytW5LKdgfhYraqdK K76I2Dhmpn2x8bjPeWEuM49ZzQBNij9EFhWACpiiS40safak4QjtrKKIQONFSKPnCHz7 KXUbNGgCH/GPPuJpZaEuncloBM1hSSQTMtCHaMD+iGabYN0Z4mYzaMWAIXCwu6CG/X36 25SU7MrLANRqziuKoB1S0UFMof5RjfgmG31tlT4I5NVVLzt9NGS8qY9RLrsx7YovW6Hi BSkg== 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:arc-authentication-results; bh=0zsMSR6kJEgNU/dNslzPV/LIvOPSffcDo3AlUq9s7xo=; b=vysxzfoNq0piufsZs9bH2aqKgEA+MJjhXxZjgPq1V4VdU9WbiQQenrf9zT9CcnVkJ7 oWVenpKgmOsaKUfl+6velFwPCypKubNBlPOm5B1e7JoXhnRsrDpqK5Yh6IJWgLOY2hbc JRrsuJ2qTmyT7pBVSECTCMOJRTkGLOhnF3L7BEEbElTtBZr7eLnlkqVwFHXCRIlQ/zwk +Gcj2/9yy6npW7cfDAtSYnPHEDtELg/wgITE8JbhXKmbhDh/06FmKeDTrBBzcvFq1Zk4 6Ccj+RHhn0B8m0azDJyvT6U/Nlnvwq8/6b5wBtw3yOxslwppWM9M5N6Tj6/Nd//yrM9P NEJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MwiAEQTt; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si11535137pli.269.2018.05.20.00.58.29; Sun, 20 May 2018 00:58:43 -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=@gmail.com header.s=20161025 header.b=MwiAEQTt; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751460AbeETH5a (ORCPT + 99 others); Sun, 20 May 2018 03:57:30 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:44841 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbeETH50 (ORCPT ); Sun, 20 May 2018 03:57:26 -0400 Received: by mail-lf0-f65.google.com with SMTP id h197-v6so19611068lfg.11 for ; Sun, 20 May 2018 00:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0zsMSR6kJEgNU/dNslzPV/LIvOPSffcDo3AlUq9s7xo=; b=MwiAEQTt/waicPDpf9KkxdtDhP1X6hPqlJ/xVVhCKsFsI2yp3zss6yhdgMzbweEtIM PSE/rOIyu0NrSqreOY5iL7339hX03p7wrIuTZR6+YBmwV1+kEBUn38j2v8YpRch3PK+S z75yqtAQvz5r8vDmYnJcB99jjUcMllDwpoHuDIep6Q6e4JhbeWySV0P+Vtt0oCKN3o06 fUYTLSVIn46qsCNtzt6F+wCOCc3y4YKcFgYqtmIDUDnjuHrC8Z0Po6diNN8PnJCmoGTW fgfznLURz1M3aiR1ysFWxLbs9lqUQNp0BjmrBVptIPX8xZ1w1mgMqC2x9vIJgVHUfl8N 0Sdg== 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=0zsMSR6kJEgNU/dNslzPV/LIvOPSffcDo3AlUq9s7xo=; b=ds8C29AVM6VJr4oldkFi08dOOR7egbBktynmGAES+lw0qk5NLaPsE6Di84NNqtkiOp GwKoTfYGaMu+rOijJPkUmRLEHjGhFgCx+29oeJZRR14/V4Qg9D0iYC+Lej3/ttaK7/tW jX0Wlwd5+MRdNiPVrGMR+63YfgpjyMeNLQEcOUmAhtE8m25t73wxbwCDb5+ewZi5ELi4 knu6/l2D0p4O6lHSfNBTQrmn50ppePGyQJzGxCz5p0FVhmE5msUXaLLt0TYvYRFnrdbZ ii38rh1Te83cj8tQsN/VCvh9Ny2mIbGfiff7cRlO++m1dRVvCJuyPSY84+d5VQD4bjIG QEJQ== X-Gm-Message-State: ALKqPwcp2uFOWuLc86KrkH+uiTWa67mMq7QSZM8ucHOlz9yvf5k15773 1W+7Jmk3EOzA0wl0u0Nt4TX5sQ== X-Received: by 2002:a19:5a57:: with SMTP id o84-v6mr26194886lfb.62.1526803045364; Sun, 20 May 2018 00:57:25 -0700 (PDT) Received: from esperanza (81.5.110.211.dhcp.mipt-telecom.ru. [81.5.110.211]) by smtp.gmail.com with ESMTPSA id t4-v6sm2789844lff.48.2018.05.20.00.57.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 May 2018 00:57:24 -0700 (PDT) Date: Sun, 20 May 2018 10:57:22 +0300 From: Vladimir Davydov To: Kirill Tkhai Cc: akpm@linux-foundation.org, shakeelb@google.com, viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, tglx@linutronix.de, pombredanne@nexb.com, stummala@codeaurora.org, gregkh@linuxfoundation.org, sfr@canb.auug.org.au, guro@fb.com, mka@chromium.org, penguin-kernel@I-love.SAKURA.ne.jp, chris@chris-wilson.co.uk, longman@redhat.com, minchan@kernel.org, ying.huang@intel.com, mgorman@techsingularity.net, jbacik@fb.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, lirongqing@baidu.com, aryabinin@virtuozzo.com Subject: Re: [PATCH v6 13/17] mm: Export mem_cgroup_is_root() Message-ID: <20180520075722.qwwrxuz52kqulsnw@esperanza> References: <152663268383.5308.8660992135988724014.stgit@localhost.localdomain> <152663303322.5308.13190345531934617119.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152663303322.5308.13190345531934617119.stgit@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 18, 2018 at 11:43:53AM +0300, Kirill Tkhai wrote: > This will be used in next patch. > > Signed-off-by: Kirill Tkhai > --- > include/linux/memcontrol.h | 10 ++++++++++ > mm/memcontrol.c | 5 ----- > 2 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index 7ae1b94becf3..cd44c1fac22b 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -311,6 +311,11 @@ struct mem_cgroup { > > extern struct mem_cgroup *root_mem_cgroup; > > +static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg) > +{ > + return (memcg == root_mem_cgroup); > +} > + > static inline bool mem_cgroup_disabled(void) > { > return !cgroup_subsys_enabled(memory_cgrp_subsys); > @@ -780,6 +785,11 @@ void mem_cgroup_split_huge_fixup(struct page *head); > > struct mem_cgroup; > > +static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg) > +{ > + return false; > +} > + This stub must return true as one can think of !MEMCG as of the case when there's the only cgroup - the root.