From patchwork Thu Sep 15 14:27:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Weiner X-Patchwork-Id: 670444 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3sZgpz6DV2z9sC3 for ; Fri, 16 Sep 2016 00:32:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=wiIavxvh; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753532AbcIOOcD (ORCPT ); Thu, 15 Sep 2016 10:32:03 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:53124 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751905AbcIOObu (ORCPT ); Thu, 15 Sep 2016 10:31:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cmpxchg.org ; s=x; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NPVKID9S0b4dhiPMCLN+Td9fHKOjGPmqcyTTe9kXSHc=; b=wiIavxvh+Xo5SJr38Zh4vIOND+ DOgWhVx2mWN+qhKB0DcSkfOPDH3Zi9jDvJeGPwTt5aur0z0Ox0Ue/RM+NiM4CooBvZ1Ev3kCJQfLq fyxbaClHGDndwGUkEtVFiEoFLfUxJ5az/UofPXgQGNzpf5EQr6EfQUkv2z+MLrWBfRbs=; Date: Thu, 15 Sep 2016 10:27:33 -0400 From: Johannes Weiner To: Andrew Morton Cc: kbuild test robot , kbuild-all@01.org, Tejun Heo , "David S. Miller" , Michal Hocko , Vladimir Davydov , linux-mm@kvack.org, cgroups@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 3/3] mm: memcontrol: consolidate cgroup socket tracking Message-ID: <20160915142733.GA25519@cmpxchg.org> References: <20160914194846.11153-3-hannes@cmpxchg.org> <201609151357.bgs2EcXM%fengguang.wu@intel.com> <20160914151714.f6d1b2a57da0619bf9e2372c@linux-foundation.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160914151714.f6d1b2a57da0619bf9e2372c@linux-foundation.org> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Sep 14, 2016 at 03:17:14PM -0700, Andrew Morton wrote: > On Thu, 15 Sep 2016 13:34:24 +0800 kbuild test robot wrote: > > > Hi Johannes, > > > > [auto build test ERROR on net/master] > > [also build test ERROR on v4.8-rc6 next-20160914] > > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] > > [Check https://git-scm.com/docs/git-format-patch for more information] > > > > url: https://github.com/0day-ci/linux/commits/Johannes-Weiner/mm-memcontrol-make-per-cpu-charge-cache-IRQ-safe-for-socket-accounting/20160915-035634 > > config: m68k-sun3_defconfig (attached as .config) > > compiler: m68k-linux-gcc (GCC) 4.9.0 > > reproduce: > > wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # save the attached .config to linux build tree > > make.cross ARCH=m68k > > > > All errors (new ones prefixed by >>): > > > > net/built-in.o: In function `sk_alloc': > > >> (.text+0x4076): undefined reference to `mem_cgroup_sk_alloc' > > net/built-in.o: In function `__sk_destruct': > > >> sock.c:(.text+0x457e): undefined reference to `mem_cgroup_sk_free' > > net/built-in.o: In function `sk_clone_lock': > > (.text+0x4f1c): undefined reference to `mem_cgroup_sk_alloc' > > This? Thanks for fixing it up, Andrew. I think it'd be nicer to declare the dummy functions for !CONFIG_MEMCG; it also doesn't look like a hotpath that would necessitate the jump label in that place. Dave, any preference either way? Signed-off-by: Johannes Weiner diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index ca11b3e6dd65..61d20c17f3b7 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -773,13 +773,13 @@ static inline void mem_cgroup_wb_stats(struct bdi_writeback *wb, #endif /* CONFIG_CGROUP_WRITEBACK */ struct sock; -void mem_cgroup_sk_alloc(struct sock *sk); -void mem_cgroup_sk_free(struct sock *sk); bool mem_cgroup_charge_skmem(struct mem_cgroup *memcg, unsigned int nr_pages); void mem_cgroup_uncharge_skmem(struct mem_cgroup *memcg, unsigned int nr_pages); #ifdef CONFIG_MEMCG extern struct static_key_false memcg_sockets_enabled_key; #define mem_cgroup_sockets_enabled static_branch_unlikely(&memcg_sockets_enabled_key) +void mem_cgroup_sk_alloc(struct sock *sk); +void mem_cgroup_sk_free(struct sock *sk); static inline bool mem_cgroup_under_socket_pressure(struct mem_cgroup *memcg) { if (!cgroup_subsys_on_dfl(memory_cgrp_subsys) && memcg->tcpmem_pressure) @@ -792,6 +792,8 @@ static inline bool mem_cgroup_under_socket_pressure(struct mem_cgroup *memcg) } #else #define mem_cgroup_sockets_enabled 0 +static inline void mem_cgroup_sk_alloc(struct sock *sk) { }; +static inline void mem_cgroup_sk_free(struct sock *sk) { }; static inline bool mem_cgroup_under_socket_pressure(struct mem_cgroup *memcg) { return false;