From: Catalin Marinas Date: Tue, 19 Mar 2019 11:57:47 +0000 Subject: Re: [PATCH v2] kmemleak: skip scanning holes in the .bss section Message-Id: <20190319115747.GB59586@arrakis.emea.arm.com> List-Id: References: <20190313145717.46369-1-cai@lca.pw> In-Reply-To: <20190313145717.46369-1-cai@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Qian Cai Cc: akpm@linux-foundation.org, paulus@ozlabs.org, benh@kernel.crashing.org, mpe@ellerman.id.au, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Hi Qian, On Wed, Mar 13, 2019 at 10:57:17AM -0400, Qian Cai wrote: > @@ -1531,7 +1547,14 @@ static void kmemleak_scan(void) > > /* data/bss scanning */ > scan_large_block(_sdata, _edata); > - scan_large_block(__bss_start, __bss_stop); > + > + if (bss_hole_start) { > + scan_large_block(__bss_start, bss_hole_start); > + scan_large_block(bss_hole_stop, __bss_stop); > + } else { > + scan_large_block(__bss_start, __bss_stop); > + } > + > scan_large_block(__start_ro_after_init, __end_ro_after_init); I'm not a fan of this approach but I couldn't come up with anything better. I was hoping we could check for PageReserved() in scan_block() but on arm64 it ends up not scanning the .bss at all. Until another user appears, I'm ok with this patch. Acked-by: Catalin Marinas