* [PATCH] mm: memcontrol: avoid unused function warning
@ 2016-08-24 8:22 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-08-24 8:22 UTC (permalink / raw)
To: Vladimir Davydov
Cc: Arnd Bergmann, Johannes Weiner, Michal Hocko, Andrew Morton,
Tejun Heo, Mel Gorman, cgroups, linux-mm, linux-kernel
A bugfix in v4.8-rc2 introduced a harmless warning when CONFIG_MEMCG_SWAP
is disabled but CONFIG_MEMCG is enabled:
mm/memcontrol.c:4085:27: error: 'mem_cgroup_id_get_online' defined but not used [-Werror=unused-function]
static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
This adds an extra #ifdef that matches the one around the caller to
avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 1f47b61fb407 ("mm: memcontrol: fix swap counter leak on swapout from offline cgroup")
---
mm/memcontrol.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2ff0289ad061..e8d787163b65 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4082,6 +4082,7 @@ static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n)
atomic_add(n, &memcg->id.ref);
}
+#ifdef CONFIG_MEMCG_SWAP
static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
{
while (!atomic_inc_not_zero(&memcg->id.ref)) {
@@ -4099,6 +4100,7 @@ static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
}
return memcg;
}
+#endif
static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n)
{
--
2.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] mm: memcontrol: avoid unused function warning
@ 2016-08-24 8:22 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-08-24 8:22 UTC (permalink / raw)
To: Vladimir Davydov
Cc: Arnd Bergmann, Johannes Weiner, Michal Hocko, Andrew Morton,
Tejun Heo, Mel Gorman, cgroups, linux-mm, linux-kernel
A bugfix in v4.8-rc2 introduced a harmless warning when CONFIG_MEMCG_SWAP
is disabled but CONFIG_MEMCG is enabled:
mm/memcontrol.c:4085:27: error: 'mem_cgroup_id_get_online' defined but not used [-Werror=unused-function]
static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
This adds an extra #ifdef that matches the one around the caller to
avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 1f47b61fb407 ("mm: memcontrol: fix swap counter leak on swapout from offline cgroup")
---
mm/memcontrol.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2ff0289ad061..e8d787163b65 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4082,6 +4082,7 @@ static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n)
atomic_add(n, &memcg->id.ref);
}
+#ifdef CONFIG_MEMCG_SWAP
static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
{
while (!atomic_inc_not_zero(&memcg->id.ref)) {
@@ -4099,6 +4100,7 @@ static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
}
return memcg;
}
+#endif
static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n)
{
--
2.9.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: memcontrol: avoid unused function warning
2016-08-24 8:22 ` Arnd Bergmann
@ 2016-08-24 8:41 ` Michal Hocko
-1 siblings, 0 replies; 6+ messages in thread
From: Michal Hocko @ 2016-08-24 8:41 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Vladimir Davydov, Johannes Weiner, Andrew Morton, Tejun Heo,
Mel Gorman, cgroups, linux-mm, linux-kernel
On Wed 24-08-16 10:22:43, Arnd Bergmann wrote:
> A bugfix in v4.8-rc2 introduced a harmless warning when CONFIG_MEMCG_SWAP
> is disabled but CONFIG_MEMCG is enabled:
>
> mm/memcontrol.c:4085:27: error: 'mem_cgroup_id_get_online' defined but not used [-Werror=unused-function]
> static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
>
> This adds an extra #ifdef that matches the one around the caller to
> avoid the warning.
Thanks for fixing that! Could you please move the function to the same
ifdef section as its users please.
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 1f47b61fb407 ("mm: memcontrol: fix swap counter leak on swapout from offline cgroup")
Anyway
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/memcontrol.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 2ff0289ad061..e8d787163b65 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4082,6 +4082,7 @@ static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n)
> atomic_add(n, &memcg->id.ref);
> }
>
> +#ifdef CONFIG_MEMCG_SWAP
> static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
> {
> while (!atomic_inc_not_zero(&memcg->id.ref)) {
> @@ -4099,6 +4100,7 @@ static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
> }
> return memcg;
> }
> +#endif
>
> static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n)
> {
> --
> 2.9.0
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: memcontrol: avoid unused function warning
@ 2016-08-24 8:41 ` Michal Hocko
0 siblings, 0 replies; 6+ messages in thread
From: Michal Hocko @ 2016-08-24 8:41 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Vladimir Davydov, Johannes Weiner, Andrew Morton, Tejun Heo,
Mel Gorman, cgroups, linux-mm, linux-kernel
On Wed 24-08-16 10:22:43, Arnd Bergmann wrote:
> A bugfix in v4.8-rc2 introduced a harmless warning when CONFIG_MEMCG_SWAP
> is disabled but CONFIG_MEMCG is enabled:
>
> mm/memcontrol.c:4085:27: error: 'mem_cgroup_id_get_online' defined but not used [-Werror=unused-function]
> static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
>
> This adds an extra #ifdef that matches the one around the caller to
> avoid the warning.
Thanks for fixing that! Could you please move the function to the same
ifdef section as its users please.
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 1f47b61fb407 ("mm: memcontrol: fix swap counter leak on swapout from offline cgroup")
Anyway
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/memcontrol.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 2ff0289ad061..e8d787163b65 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4082,6 +4082,7 @@ static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n)
> atomic_add(n, &memcg->id.ref);
> }
>
> +#ifdef CONFIG_MEMCG_SWAP
> static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
> {
> while (!atomic_inc_not_zero(&memcg->id.ref)) {
> @@ -4099,6 +4100,7 @@ static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
> }
> return memcg;
> }
> +#endif
>
> static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n)
> {
> --
> 2.9.0
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: memcontrol: avoid unused function warning
2016-08-24 8:22 ` Arnd Bergmann
@ 2016-08-24 9:18 ` Vladimir Davydov
-1 siblings, 0 replies; 6+ messages in thread
From: Vladimir Davydov @ 2016-08-24 9:18 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Johannes Weiner, Michal Hocko, Andrew Morton, Tejun Heo,
Mel Gorman, cgroups, linux-mm, linux-kernel
On Wed, Aug 24, 2016 at 10:22:43AM +0200, Arnd Bergmann wrote:
> A bugfix in v4.8-rc2 introduced a harmless warning when CONFIG_MEMCG_SWAP
> is disabled but CONFIG_MEMCG is enabled:
>
> mm/memcontrol.c:4085:27: error: 'mem_cgroup_id_get_online' defined but not used [-Werror=unused-function]
> static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
>
> This adds an extra #ifdef that matches the one around the caller to
> avoid the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 1f47b61fb407 ("mm: memcontrol: fix swap counter leak on swapout from offline cgroup")
Acked-by: Vladimir Davydov <vdavydov@virtuozzo.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: memcontrol: avoid unused function warning
@ 2016-08-24 9:18 ` Vladimir Davydov
0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Davydov @ 2016-08-24 9:18 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Johannes Weiner, Michal Hocko, Andrew Morton, Tejun Heo,
Mel Gorman, cgroups, linux-mm, linux-kernel
On Wed, Aug 24, 2016 at 10:22:43AM +0200, Arnd Bergmann wrote:
> A bugfix in v4.8-rc2 introduced a harmless warning when CONFIG_MEMCG_SWAP
> is disabled but CONFIG_MEMCG is enabled:
>
> mm/memcontrol.c:4085:27: error: 'mem_cgroup_id_get_online' defined but not used [-Werror=unused-function]
> static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
>
> This adds an extra #ifdef that matches the one around the caller to
> avoid the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 1f47b61fb407 ("mm: memcontrol: fix swap counter leak on swapout from offline cgroup")
Acked-by: Vladimir Davydov <vdavydov@virtuozzo.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-08-24 16:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-24 8:22 [PATCH] mm: memcontrol: avoid unused function warning Arnd Bergmann
2016-08-24 8:22 ` Arnd Bergmann
2016-08-24 8:41 ` Michal Hocko
2016-08-24 8:41 ` Michal Hocko
2016-08-24 9:18 ` Vladimir Davydov
2016-08-24 9:18 ` Vladimir Davydov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.