lkml.org 
[lkml]   [2020]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: linux-next: build warning after merge of the akpm-current tree
On Fri, Jul 17, 2020 at 08:31:27PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the akpm-current tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> mm/vmstat.c:614: warning: "MAX_THRESHOLD" redefined
> 614 | #define MAX_THRESHOLD 0
> |
> mm/vmstat.c:172: note: this is the location of the previous definition
> 172 | #define MAX_THRESHOLD 125
> |
> mm/vmstat.c:614: warning: "MAX_THRESHOLD" redefined
> 614 | #define MAX_THRESHOLD 0
> |
> mm/vmstat.c:172: note: this is the location of the previous definition
> 172 | #define MAX_THRESHOLD 125
> |
>
> Introduced by commit
>
> 5f6bac149e10 ("mm: vmstat: fix /proc/sys/vm/stat_refresh generating false warnings")
>
> The preproccesor directives look like this:
>
> #ifdef CONFIG_SMP
> #define MAX_THRESHOLD 125
> #ifdef CONFIG_HAVE_CMPXCHG_LOCAL
> #else
> #define MAX_THRESHOLD 0
>
> So I guess the second MAX_THRESHOLD was put after the wrong #else?

Right, I missed it. Sorry for the inconvenience!
And thank you for pointing at it!

The following diff fixes it.

Andrew, can you, please, squash it into the
"mm: vmstat: fix /proc/sys/vm/stat_refresh generating false warnings" ?

Thank you!

--

diff --git a/mm/vmstat.c b/mm/vmstat.c
index 8f0ef8aaf8ee..08e415e0a15d 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -168,9 +168,12 @@ EXPORT_SYMBOL(vm_numa_stat);
EXPORT_SYMBOL(vm_node_stat);

#ifdef CONFIG_SMP
-
#define MAX_THRESHOLD 125
+#else
+#define MAX_THRESHOLD 0
+#endif

+#ifdef CONFIG_SMP
int calculate_pressure_threshold(struct zone *zone)
{
int threshold;
@@ -611,8 +614,6 @@ void dec_node_page_state(struct page *page, enum node_stat_item item)
EXPORT_SYMBOL(dec_node_page_state);
#else

-#define MAX_THRESHOLD 0
-
/*
* Use interrupt disable to serialize counter updates
*/
--
2.26.2
\
 
 \ /
  Last update: 2020-07-17 19:48    [W:0.045 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site