Re: [PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread John Stoffel
George> John Stoffel wrote: >>> vmap_info_gen should be initialized to 1 to force an initial >>> cache update. >> Blech, it should be initialized with a proper #define >> VMAP_CACHE_NEEDS_UPDATE 1, instead of more magic numbers. George> Er... this is a joke, right? Not really. The comment

Re: [PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread George Spelvin
John Stoffel wrote: >> vmap_info_gen should be initialized to 1 to force an initial >> cache update. > Blech, it should be initialized with a proper #define > VMAP_CACHE_NEEDS_UPDATE 1, instead of more magic numbers. Er... this is a joke, right? First, this number is used exactly once, and

Re: [PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread John Stoffel
> "Ingo" == Ingo Molnar writes: Ingo> * George Spelvin wrote: >> First, an actual, albeit minor, bug: initializing both vmap_info_gen >> and vmap_info_cache_gen to 0 marks the cache as valid, which it's not. Ingo> Ha! :-) Fixed. >> vmap_info_gen should be initialized to 1 to force an

Re: [PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread Ingo Molnar
* Ingo Molnar wrote: > +/* > + * Return a consistent snapshot of the current vmalloc allocation > + * statistics, for /proc/meminfo: > + */ > +void get_vmalloc_info(struct vmalloc_info *vmi) > +{ > + int gen = READ_ONCE(vmap_info_gen); > + > + /* > + * If the generation counter of

[PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread Ingo Molnar
* George Spelvin wrote: > First, an actual, albeit minor, bug: initializing both vmap_info_gen > and vmap_info_cache_gen to 0 marks the cache as valid, which it's not. Ha! :-) Fixed. > vmap_info_gen should be initialized to 1 to force an initial > cache update. Yeah. > Second, I don't see

Re: [PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread John Stoffel
Ingo == Ingo Molnar mi...@kernel.org writes: Ingo * George Spelvin li...@horizon.com wrote: First, an actual, albeit minor, bug: initializing both vmap_info_gen and vmap_info_cache_gen to 0 marks the cache as valid, which it's not. Ingo Ha! :-) Fixed. vmap_info_gen should be initialized to

Re: [PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread George Spelvin
John Stoffel j...@stoffel.org wrote: vmap_info_gen should be initialized to 1 to force an initial cache update. Blech, it should be initialized with a proper #define VMAP_CACHE_NEEDS_UPDATE 1, instead of more magic numbers. Er... this is a joke, right? First, this number is used exactly

Re: [PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread John Stoffel
George John Stoffel j...@stoffel.org wrote: vmap_info_gen should be initialized to 1 to force an initial cache update. Blech, it should be initialized with a proper #define VMAP_CACHE_NEEDS_UPDATE 1, instead of more magic numbers. George Er... this is a joke, right? Not really. The

[PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread Ingo Molnar
* George Spelvin li...@horizon.com wrote: First, an actual, albeit minor, bug: initializing both vmap_info_gen and vmap_info_cache_gen to 0 marks the cache as valid, which it's not. Ha! :-) Fixed. vmap_info_gen should be initialized to 1 to force an initial cache update. Yeah. Second, I

Re: [PATCH 3/3 v4] mm/vmalloc: Cache the vmalloc memory info

2015-08-24 Thread Ingo Molnar
* Ingo Molnar mi...@kernel.org wrote: +/* + * Return a consistent snapshot of the current vmalloc allocation + * statistics, for /proc/meminfo: + */ +void get_vmalloc_info(struct vmalloc_info *vmi) +{ + int gen = READ_ONCE(vmap_info_gen); + + /* + * If the generation