lkml.org 
[lkml]   [2013]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 3/6] mm: numa: Handle side-effects in count_vm_numa_events() for !CONFIG_NUMA_BALANCING
On Tue, 22 Jan 2013 17:12:39 +0000
Mel Gorman <mgorman@suse.de> wrote:

> The current definitions for count_vm_numa_events() is wrong for
> !CONFIG_NUMA_BALANCING as the following would miss the side-effect.
>
> count_vm_numa_events(NUMA_FOO, bar++);

Stupid macros.

> There are no such users of count_vm_numa_events() but it is a potential
> pitfall. This patch fixes it and converts count_vm_numa_event() so that
> the definitions look similar.

Confused. The patch doesn't alter count_vm_numa_event(). No matter.

> --- a/include/linux/vmstat.h
> +++ b/include/linux/vmstat.h
> @@ -85,7 +85,7 @@ static inline void vm_events_fold_cpu(int cpu)
> #define count_vm_numa_events(x, y) count_vm_events(x, y)
> #else
> #define count_vm_numa_event(x) do {} while (0)
> -#define count_vm_numa_events(x, y) do {} while (0)
> +#define count_vm_numa_events(x, y) do { (void)(y); } while (0)
> #endif /* CONFIG_NUMA_BALANCING */
>
> #define __count_zone_vm_events(item, zone, delta) \



\
 
 \ /
  Last update: 2013-01-23 00:22    [W:0.252 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site