From patchwork Sun Mar 18 20:24:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Rientjes X-Patchwork-Id: 10291357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BF17F60386 for ; Sun, 18 Mar 2018 20:25:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B01C328EA3 for ; Sun, 18 Mar 2018 20:25:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4D5228FC3; Sun, 18 Mar 2018 20:25:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B3C428EA3 for ; Sun, 18 Mar 2018 20:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754354AbeCRUYz (ORCPT ); Sun, 18 Mar 2018 16:24:55 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:41731 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753576AbeCRUYx (ORCPT ); Sun, 18 Mar 2018 16:24:53 -0400 Received: by mail-pg0-f66.google.com with SMTP id m24so425741pgv.8 for ; Sun, 18 Mar 2018 13:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=2W/02XBuWIo95g142aAkDkpAeBEC6wtcHwEmwOp8Cc8=; b=Ar5vIRqKr3XXOWr7061vrSh8B44m78Wctiq7Xz+CZm8mj+J33fyZxNEtnC06a+yfnO fDPI+zteruVsAiu9FsnX4FdlmM5uI0qOBoHPzXVbp8VIZMlaKkpMhP3F+gawAuqK+biM NqI84ZOWgURL3reE7YRobt6iSAlVnfGauvUwbxcynyK9eDWkKVcFxVnEoB3ipMf6VBAn 8kHB+K+pVvCxTvim6bK7OndeNH5nEGzUCUW2VxJIOYXTxz0y30lBFItJ5dt6UZf2RPSo APF4ddn7JPZa0xRPdrfckQ4uqoEV9u9tIH9RGe4MyrBXtbFmnSrSbIC4467GiXPch0bn zYWA== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=2W/02XBuWIo95g142aAkDkpAeBEC6wtcHwEmwOp8Cc8=; b=fXTZbDDWVNjLkJgkhCYl0V/GAMKuZVq/epq4bCyuu/xLTFrxBR/WO5J4teVyt8cnsg EiUv7dGC61x6SbkBZnd8dcJH8oeqeQKFssrtbfNIqG8s5UmFUy5+Z9JTCS/EfwWRju/9 hf7JhpRXpcGsCDPmRMbqKOpxxFgiKYftJRudCOGOaIecnI5+F1TCRVHjRVwAzCN5G+N6 pMkDo+N2ORr57udYZx4ZtLlSEfIx+ezcAy1xGAAxgtaCKK+Ae0lWPytiel4OD575js94 FGvsFd4eWMxLziXpYTeigAR7X/YEYTH8PPSWCgMWqlmY9Xa9SY10hhkLY9NyjCQpfIHj XgKg== X-Gm-Message-State: AElRT7Ep0oLmC5UPbZyo/5BjoMEGqk05LvTqxfH4Jxjn41yqC4v/EvIu sjn5qPw7DAQbWWiZeaQOdcbn0A== X-Google-Smtp-Source: AG47ELtk6e0qhgkpQbHyE6rdWWbk67KpSTJDf1iU0sFgBGfd31/puMRGyxEUCsH+4oqyArue0Tx7mw== X-Received: by 10.99.42.83 with SMTP id q80mr7323148pgq.115.1521404692715; Sun, 18 Mar 2018 13:24:52 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id 26sm15625490pfk.73.2018.03.18.13.24.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Mar 2018 13:24:52 -0700 (PDT) Date: Sun, 18 Mar 2018 13:24:51 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrew Morton cc: Shakeel Butt , Jan Kara , Amir Goldstein , Christoph Lameter , Pekka Enberg , Joonsoo Kim , Greg Thelen , Johannes Weiner , Michal Hocko , Vladimir Davydov , Mel Gorman , Vlastimil Babka , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [patch -mm] mm: memcg: remote memcg charging for kmem allocations fix In-Reply-To: <20180305182951.34462-2-shakeelb@google.com> Message-ID: References: <20180305182951.34462-1-shakeelb@google.com> <20180305182951.34462-2-shakeelb@google.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fix build warning for CONFIG_SLOB: mm/memcontrol.c:706:27: warning: 'get_mem_cgroup' defined but not used [-Wunused-function] static struct mem_cgroup *get_mem_cgroup(struct mem_cgroup *memcg) Reported-by: kbuild test robot Signed-off-by: David Rientjes --- mm/memcontrol.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -701,15 +701,6 @@ struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm) return memcg; } -static struct mem_cgroup *get_mem_cgroup(struct mem_cgroup *memcg) -{ - rcu_read_lock(); - if (!css_tryget_online(&memcg->css)) - memcg = NULL; - rcu_read_unlock(); - return memcg; -} - /** * mem_cgroup_iter - iterate over memory cgroup hierarchy * @root: hierarchy root @@ -2128,6 +2119,15 @@ static void commit_charge(struct page *page, struct mem_cgroup *memcg, } #ifndef CONFIG_SLOB +static struct mem_cgroup *get_mem_cgroup(struct mem_cgroup *memcg) +{ + rcu_read_lock(); + if (!css_tryget_online(&memcg->css)) + memcg = NULL; + rcu_read_unlock(); + return memcg; +} + static int memcg_alloc_cache_id(void) { int id, size;