From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753689AbcHPRev (ORCPT ); Tue, 16 Aug 2016 13:34:51 -0400 Received: from foss.arm.com ([217.140.101.70]:48649 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753220AbcHPRet (ORCPT ); Tue, 16 Aug 2016 13:34:49 -0400 Date: Tue, 16 Aug 2016 18:34:46 +0100 From: Catalin Marinas To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vignesh R Subject: Re: [PATCH] mm: kmemleak: Avoid using __va() on addresses that don't have a lowmem mapping Message-ID: <20160816173445.GD7609@e104818-lin.cambridge.arm.com> References: <1471360856-16916-1-git-send-email-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471360856-16916-1-git-send-email-catalin.marinas@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2016 at 04:20:56PM +0100, Catalin Marinas wrote: > diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h > index 4894c6888bc6..380f72bc3657 100644 > --- a/include/linux/kmemleak.h > +++ b/include/linux/kmemleak.h > @@ -21,6 +21,7 @@ > #ifndef __KMEMLEAK_H > #define __KMEMLEAK_H > > +#include Given the kbuild-robot reports, this #include doesn't go well on some architectures. > #include > > #ifdef CONFIG_DEBUG_KMEMLEAK > @@ -109,4 +110,29 @@ static inline void kmemleak_no_scan(const void *ptr) > > #endif /* CONFIG_DEBUG_KMEMLEAK */ > > +static inline void kmemleak_alloc_phys(phys_addr_t phys, size_t size, > + int min_count, gfp_t gfp) > +{ > + if (!IS_ENABLED(CONFIG_HIGHMEM) || phys < __pa(high_memory)) > + kmemleak_alloc(__va(phys), size, min_count, gfp); > +} > + > +static inline void kmemleak_free_part_phys(phys_addr_t phys, size_t size) > +{ > + if (!IS_ENABLED(CONFIG_HIGHMEM) || phys < __pa(high_memory)) > + kmemleak_free_part(__va(phys), size); > +} > + > +static inline void kmemleak_not_leak_phys(phys_addr_t phys) > +{ > + if (!IS_ENABLED(CONFIG_HIGHMEM) || phys < __pa(high_memory)) > + kmemleak_not_leak(__va(phys)); > +} > + > +static inline void kmemleak_ignore_phys(phys_addr_t phys) > +{ > + if (!IS_ENABLED(CONFIG_HIGHMEM) || phys < __pa(high_memory)) > + kmemleak_ignore(__va(phys)); > +} I'll move these functions out of line and re-post the patch. -- Catalin