Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4562380ybf; Wed, 4 Mar 2020 06:25:00 -0800 (PST) X-Google-Smtp-Source: ADFU+vuCzUv3ErfAdA0q3B5LPxPk3uGayisxPNT6XiS6UxahhRTbiZsX8L5wjjfO27r3bbs2RZSU X-Received: by 2002:a9d:2f05:: with SMTP id h5mr2580916otb.316.1583331900177; Wed, 04 Mar 2020 06:25:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583331900; cv=none; d=google.com; s=arc-20160816; b=r9JTJp3cGTVINowHYvcy+3cqj6jRdwUiFwfAoau4F44LcpJfMnEJIi0STwJbl50Ax2 U7SZx38NEps72m4+KVXz4JQOFLqHdwsn0EB0v6fmU4/SPCW2iRZhaBsBgW8Tfydc0Hne xh4BAAxJUqIEGpcPYhUWFPY20rRb0lPgveinulo0iiCJhi1flnim9Aq0YQeeUxnWCuXr VVp/f46n/2n6oYy9LLE3LGrGXnxn2rUChkeRepmlrHLFIZjFmDPa6HqIP1iweelmWScK j7bB1kjo757XCUFhvgyvloCg5S1FRQ2PkFFXPM+eqWH+W7fyQvtHg9rXm3MIsvWBzRmB fphg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=NzqUENSAKP5boZaY1Kep8tSJ8kYU8GldTyMgagr7nDA=; b=Z+fPcF93uf8iYdP/rwMCUYzyI9BtQfUimUBqH62EhzWlUVkAFmRljjJNHwie39/dhj iI4EqkD1oREDPFCwC43mg+SJge2MZi4ZPEef5wamSusLrWsy9SeIh3VnAQaghcyr5QlS ybymcUQeFcB46cqmy2f3JAGAQznupkQK8MnMkBzfwwYeeu6wztcURUbqxYMeH1BQ7s2k 06ITe0zp7NoH/ZpWFPU7aMgMavsiMydmTiJpUHM9lPK7OO6ZGBy08v3Z6zWPK7z8nZ2n gM8kTQGNLsYpxWYnoNDSBxMU3ejhKNhgBt8zwL46AHh85fzNhziTqWD9e01a4Yt4l6lV Lutw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si1303907oti.306.2020.03.04.06.24.42; Wed, 04 Mar 2020 06:25:00 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729598AbgCDOYE (ORCPT + 99 others); Wed, 4 Mar 2020 09:24:04 -0500 Received: from foss.arm.com ([217.140.110.172]:34938 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbgCDOYE (ORCPT ); Wed, 4 Mar 2020 09:24:04 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BC3FF31B; Wed, 4 Mar 2020 06:24:03 -0800 (PST) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9D5D63F6CF; Wed, 4 Mar 2020 06:24:02 -0800 (PST) From: Vincenzo Frascino To: cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Vincenzo Frascino , Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton Subject: [PATCH] mm: Make mem_cgroup_id_get_many dependent on MMU and MEMCG_SWAP Date: Wed, 4 Mar 2020 14:23:48 +0000 Message-Id: <20200304142348.48167-1-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mem_cgroup_id_get_many() is currently used only when MMU or MEMCG_SWAP configuration options are enabled. Having them disabled triggers the following warning at compile time: linux/mm/memcontrol.c:4797:13: warning: ‘mem_cgroup_id_get_many’ defined but not used [-Wunused-function] static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n) Make mem_cgroup_id_get_many() dependent on MMU and MEMCG_SWAP to address the issue. Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Andrew Morton Signed-off-by: Vincenzo Frascino --- mm/memcontrol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d09776cd6e10..628cebeb4bdd 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4794,10 +4794,12 @@ static void mem_cgroup_id_remove(struct mem_cgroup *memcg) } } +#if defined(CONFIG_MEMCG_SWAP) || defined(CONFIG_MMU) static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n) { refcount_add(n, &memcg->id.ref); } +#endif static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n) { -- 2.25.1