Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-07 Thread Catalin Marinas
On Thu, Dec 06, 2018 at 02:19:18PM +0100, Oscar Salvador wrote: > kmemleak_scan() goes through all online nodes and tries > to scan all used pages. > We can do better and use pfn_to_online_page(), so in case we have > CONFIG_MEMORY_HOTPLUG, offlined pages will be skiped automatically. > For boxes

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-07 Thread Catalin Marinas
On Thu, Dec 06, 2018 at 02:19:18PM +0100, Oscar Salvador wrote: > kmemleak_scan() goes through all online nodes and tries > to scan all used pages. > We can do better and use pfn_to_online_page(), so in case we have > CONFIG_MEMORY_HOTPLUG, offlined pages will be skiped automatically. > For boxes

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-07 Thread Wei Yang
On Fri, Dec 07, 2018 at 07:14:10AM +0100, Oscar Salvador wrote: > >> > + >> >> This one maybe not necessary. > >Yeah, that is a remind of an include file I used for time measurement. >I hope Andrew can drop that if this is taken. > >> > /* >> > * Kmemleak configuration and common defines. >> >

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-07 Thread Wei Yang
On Fri, Dec 07, 2018 at 07:14:10AM +0100, Oscar Salvador wrote: > >> > + >> >> This one maybe not necessary. > >Yeah, that is a remind of an include file I used for time measurement. >I hope Andrew can drop that if this is taken. > >> > /* >> > * Kmemleak configuration and common defines. >> >

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-06 Thread Oscar Salvador
> > + > > This one maybe not necessary. Yeah, that is a remind of an include file I used for time measurement. I hope Andrew can drop that if this is taken. > > /* > > * Kmemleak configuration and common defines. > > */ > > @@ -1547,11 +1548,14 @@ static void kmemleak_scan(void) > >

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-06 Thread Oscar Salvador
> > + > > This one maybe not necessary. Yeah, that is a remind of an include file I used for time measurement. I hope Andrew can drop that if this is taken. > > /* > > * Kmemleak configuration and common defines. > > */ > > @@ -1547,11 +1548,14 @@ static void kmemleak_scan(void) > >

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-06 Thread Oscar Salvador
I just realized I forgot to add that this was suggested by Michal. Sorry, I was a but rushy. On Thu, 2018-12-06 at 14:19 +0100, Oscar Salvador wrote: > kmemleak_scan() goes through all online nodes and tries > to scan all used pages. > We can do better and use pfn_to_online_page(), so in case we

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-06 Thread Oscar Salvador
I just realized I forgot to add that this was suggested by Michal. Sorry, I was a but rushy. On Thu, 2018-12-06 at 14:19 +0100, Oscar Salvador wrote: > kmemleak_scan() goes through all online nodes and tries > to scan all used pages. > We can do better and use pfn_to_online_page(), so in case we

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-06 Thread Wei Yang
On Thu, Dec 06, 2018 at 02:19:18PM +0100, Oscar Salvador wrote: >kmemleak_scan() goes through all online nodes and tries >to scan all used pages. >We can do better and use pfn_to_online_page(), so in case we have >CONFIG_MEMORY_HOTPLUG, offlined pages will be skiped automatically. >For boxes where

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-06 Thread Wei Yang
On Thu, Dec 06, 2018 at 02:19:18PM +0100, Oscar Salvador wrote: >kmemleak_scan() goes through all online nodes and tries >to scan all used pages. >We can do better and use pfn_to_online_page(), so in case we have >CONFIG_MEMORY_HOTPLUG, offlined pages will be skiped automatically. >For boxes where

[PATCH] mm, kmemleak: Little optimization while scanning

2018-12-06 Thread Oscar Salvador
kmemleak_scan() goes through all online nodes and tries to scan all used pages. We can do better and use pfn_to_online_page(), so in case we have CONFIG_MEMORY_HOTPLUG, offlined pages will be skiped automatically. For boxes where CONFIG_MEMORY_HOTPLUG is not present, pfn_to_online_page() will

[PATCH] mm, kmemleak: Little optimization while scanning

2018-12-06 Thread Oscar Salvador
kmemleak_scan() goes through all online nodes and tries to scan all used pages. We can do better and use pfn_to_online_page(), so in case we have CONFIG_MEMORY_HOTPLUG, offlined pages will be skiped automatically. For boxes where CONFIG_MEMORY_HOTPLUG is not present, pfn_to_online_page() will