Skip to contentSkip to conversation

Handling of unused variable 'do-numainfo on compilation time

PATCH In review Geunsik Lim 3 participants 6 messages Feb 3, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Handling of unused variable 'do-numainfo on compilation time

Actually, Usage of the variable 'do_numainfo'is not suitable for gcc compiler. Declare the variable 'do_numainfo' if the number of NUMA nodes > 1.

---
 mm/memcontrol.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
mm/memcontrol.c +4 -1
index 556859f..4e17ac5 100644
@@ -776,7 +776,10 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)
 	/* threshold event is triggered in finer grain than soft limit */
 	if (unlikely(mem_cgroup_event_ratelimit(memcg,
 						MEM_CGROUP_TARGET_THRESH))) {
-		bool do_softlimit, do_numainfo;
+		bool do_softlimit;
+#if MAX_NUMNODES > 1
+                bool do_numainfo;
+#endif
 
 		do_softlimit = mem_cgroup_event_ratelimit(memcg,
 						MEM_CGROUP_TARGET_SOFTLIMIT);
Signature · 8 lines
1.7.8.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer
#1 lore raw

Michal, this keeps coming up, please decide between the proposed solutions ;-)

Quoted 27 lines · Geunsik Lim

Actually, Usage of the variable 'do_numainfo'is not suitable for gcc compiler. Declare the variable 'do_numainfo' if the number of NUMA nodes > 1.

---
 mm/memcontrol.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
mm/memcontrol.c +4 -1
index 556859f..4e17ac5 100644
@@ -776,7 +776,10 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)
 	/* threshold event is triggered in finer grain than soft limit */
 	if (unlikely(mem_cgroup_event_ratelimit(memcg,
 						MEM_CGROUP_TARGET_THRESH))) {
-		bool do_softlimit, do_numainfo;
+		bool do_softlimit;
+#if MAX_NUMNODES > 1
+                bool do_numainfo;
+#endif
 
 		do_softlimit = mem_cgroup_event_ratelimit(memcg,
 						MEM_CGROUP_TARGET_SOFTLIMIT);
Signature · 1 line
1.7.8.1
#2 lore raw
Quoted 2 lines · Johannes Weiner

Michal, this keeps coming up, please decide between the proposed solutions ;-)

Hmm, I thought we already sorted this out https://lkml.org/lkml/2012/1/26/25 ?

Quoted 29 lines · Geunsik Lim
Quoted 27 lines

Actually, Usage of the variable 'do_numainfo'is not suitable for gcc compiler. Declare the variable 'do_numainfo' if the number of NUMA nodes > 1.

---
 mm/memcontrol.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
mm/memcontrol.c +4 -1
index 556859f..4e17ac5 100644
@@ -776,7 +776,10 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)
 	/* threshold event is triggered in finer grain than soft limit */
 	if (unlikely(mem_cgroup_event_ratelimit(memcg,
 						MEM_CGROUP_TARGET_THRESH))) {
-		bool do_softlimit, do_numainfo;
+		bool do_softlimit;
+#if MAX_NUMNODES > 1
+                bool do_numainfo;
+#endif
 
 		do_softlimit = mem_cgroup_event_ratelimit(memcg,
 						MEM_CGROUP_TARGET_SOFTLIMIT);
Signature · 1 line
1.7.8.1
Signature · 13 lines
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#3 lore raw
Quoted 8 lines · Michal Hocko
Quoted 2 lines · Johannes Weiner

Michal, this keeps coming up, please decide between the proposed solutions ;-)

Hmm, I thought we already sorted this out
https://lkml.org/lkml/2012/1/26/25 ?

I don't know previous history about this variable.

Is it same? Please, adjust this patch or fix the unsuitable variable 'do_numainfo' as I mentioned.

Quoted 42 lines
Quoted 3 lines · Geunsik Lim
Quoted 1 line

Actually, Usage of the variable 'do_numainfo'is not suitable for gcc

compiler.

Quoted 7 lines
Quoted 7 lines

Declare the variable 'do_numainfo' if the number of NUMA nodes > 1.

---
 mm/memcontrol.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
Quoted 5 lines

mm/memcontrol.c static void memcg_check_events(struct mem_cgroup

Quoted 5 lines
mm/memcontrol.c +0 -0
index 556859f..4e17ac5 100644
@@ -776,7 +776,10 @@ static void memcg_check_events(struct mem_cgroup

*memcg, struct page *page)

Quoted 3 lines

mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) · line 783

Quoted 3 lines
mm/memcontrol.c +0 -0
    /* threshold event is triggered in finer grain than soft limit */
    if (unlikely(mem_cgroup_event_ratelimit(memcg,
 

MEM_CGROUP_TARGET_THRESH))) {

Quoted 8 lines

mm/memcontrol.c static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)

Quoted 8 lines
mm/memcontrol.c +4 -1
-           bool do_softlimit, do_numainfo;
+           bool do_softlimit;
+#if MAX_NUMNODES > 1
+                bool do_numainfo;
+#endif
 
            do_softlimit = mem_cgroup_event_ratelimit(memcg,
 

MEM_CGROUP_TARGET_SOFTLIMIT);

Quoted 3 lines
Quoted 3 lines

--
1.7.8.1

--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic

Signature · 9 lines
----
Best regards,
Geunsik Lim, Samsung Electronics
http://leemgs.fedorapeople.org
----
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Acked-by Acked-by Kirill A. Shutemov
#4 lore raw
Quoted 6 lines · Geunsik Lim
Quoted 4 lines · Michal Hocko
Quoted 2 lines · Johannes Weiner

Michal, this keeps coming up, please decide between the proposed solutions ;-)

Quoted 6 lines
Quoted 3 lines

Hmm, I thought we already sorted this out
https://lkml.org/lkml/2012/1/26/25 ?

I don't know previous history about this variable. Is it same? Please, adjust this patch or fix the unsuitable variable 'do_numainfo' as I mentioned.

The patch (I guess the author is Andrew) just silence the compiler warning which is the easiest fix in this case because we know it will be used only for MAX_NUMNODES > 1.
Your patch fixes it as well but it adds an ugly ifdef around the variable.

Andrew, could you pick up this one, please?
---